Pyspinel is a Python CLI for the Spinel protocol, used to configure and manage OpenThread NCPs. This CLI is primarily targeted to CI tests, but can be used manually to experiment with and test OpenThread NCP instances.
Pyspinel is used to:
- Add simulated NCP testing to continuous integration.
- Automate testing of testbeds running NCP firmware on hardware.
- Debug NCP builds of OpenThread.
- Convert an OpenThread NCP into a packet sniffer.
For more information, see the
README in the Pyspinel
The quickest way to get started with Pyspinel is to try out the CLI:
- Install dependencies:
sudo apt install python3-pip
pip3 install --user pyserial ipaddress
- Clone the Pyspinel repository:
git clone https://github.com/openthread/pyspinel
- Install Pyspinel:
python3 setup.py install
- Clone and build a simiulated OpenThread NCP as described in
How to build OpenThread.
After cloning and bootstraping, build the sim example:
make -f examples/Makefile-simulation
- Run the Pyspinel CLI, using the path to your simulated build:
spinel-cli.py -p path-to-openthread/output/x86_64-unknown-linux-gnu/bin/ot-ncp-ftd -n 1
- Verify the OpenThread version:
versionOPENTHREAD/20180926-01310-g9fdcef20; SIMULATION; Feb 11 2020 14:09:56
- Start Thread on the simulated NCP and verify that it has become the leader
in a Thread network:
- View the help menu to see what commands are available:
You can contribute to the ongoing development of Pyspinel by submitting bug reports and feature requests to the Issue Tracker.