OpenThread Control Interface
The OpenThread Control Interface (OTCI) is a library which provides uniform python interfaces to connect and control various kinds of devices running OpenThread.
Supported device types
- OpenThread CLI
- SOC device via Serial
- OpenThread NCP (limited support via pyspinel)
- SOC device via Serial
- OpenThread Border Router
- OTBR device via SSH
Example
import otci
# Connect to an OTBR device via SSH
node1 = otci.connect_otbr_ssh("192.168.1.101")
# Connect to an OpenThread CLI device via Serial
node2 = otci.connect_cli_serial("/dev/ttyACM0"))
# Start node1 to become Leader
node1.dataset_init_buffer()
node1.dataset_set_buffer(network_name='test', network_key='00112233445566778899aabbccddeeff', panid=0xface, channel=11)
node1.dataset_commit_buffer('active')
node1.ifconfig_up()
node1.thread_start()
node1.wait(5)
assert node1.get_state() == "leader"
# Start Commissioner on node1
node1.commissioner_start()
node1.wait(3)
node1.commissioner_add_joiner("TEST123",eui64='*')
# Start node2
node2.ifconfig_up()
node2.set_router_selection_jitter(1)
# Start Joiner on node2 to join the network
node2.joiner_start("TEST123")
node2.wait(10, expect_line="Join success")
# Wait for node 2 to become Router
node2.thread_start()
node2.wait(5)
assert node2.get_state() == "router"
Release files for openthread-otci 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| openthread_otci-0.0.1.tar.gz | 37.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openthread_otci-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 76.7 kB
Release files / openthread_otci-0.0.1.tar.gz
| Download URL | openthread_otci-0.0.1.tar.gz |
|---|---|
| Size | 37.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d7dc450063ca98b3608ddb002698b97bfeae8af7b0069a9a7025cd2eb39de803
|
|
BLAKE2b-256 checksum How to use checksums |
1a65de7e34ed2217aa894e219bc50bd64796f72736244c327f0df8e7ec2f2776
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.13
|
Release files / openthread_otci-0.0.1-py3-none-any.whl
| Download URL | openthread_otci-0.0.1-py3-none-any.whl |
|---|---|
| Size | 39.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c946380d69af67ccf0bacc44bdedc5caf20d3486ae470879202b084dd307c6d7
|
|
BLAKE2b-256 checksum How to use checksums |
8bba0f08aad73dc2ff1eac9fe1bf2b1bbbc1d3dc67c15de19156acc73b982bb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.13
|