OpenThread includes Windows 10 drivers necessary for interfacing with UART NCP devices. The design allows for support of both simple radio devices and devices running the complete OpenThread stack.
NOTE: OpenThread‘s Windows integration has not been actively maintained for some time. While Windows builds are still a part of OpenThread’s continuous integration (CI), the Windows CI only tests basic compilation.
Details on the architecture can be found here.
To build locally using the Windows platform, use Visual Studio 2015. To build for the POSIX and TI CC2538 platforms, use Bash on Ubuntu on Windows.
All the following steps assume you have already cloned and checked out a branch.
To build OpenThread on Windows you need to install the following:
Once all these are installed, open the Solution file etc/visual-studio/openthread.sln. Select the Configuration and Platform (i.e. Release/x64) and then Build All (F6).
Bash on Ubuntu on Windows is a new feature to Windows 10. To set it up, follow the steps here. Other FAQs can be found here.
Once installed, open the “Bash on Ubuntu on Windows” app. Do the following to install everything necessary to build OpenThread.
Make sure line ending are UNIX style:
git config core.autocrlf false git rm --cached -r . && git reset --hard
Install the compilers:
apt install gcc apt install g++
Install Python (with pexpect):
apt install python apt install python-pip pip install pexpect
To build the TI CC2538 platform, you need to install the correct toolchain:
add-apt-repository ppa:team-gcc-arm-embedded/ppa apt-get update apt-get install gcc-arm-embedded
Set up the build environment:
./bootstrap
Before building, manually configure features as desired. For example:
./configure --enable-cli --enable-diag --enable-commissioner --enable-joiner --with-examples=posix make
Or clean and build with desired features enabled:
make -f examples/Makefile-<platform-name> clean COMMISSIONER=1 JOINER=1 make -f examples/Makefile-<platform-name>
For detailed instructions on building and creating binaries for Windows-supported platforms, see each platform's respective README:
Microsoft has made available a test VHD specifically modified for virtually testing OpenThread. To get access, please email nibanks via his @microsoft.com email address.
Once the Windows VHD is loaded and you have gone through OOBE, see C:\OpenThread\readme.txt for additional instructions on how to set everything up.
Note: Since none of the binaries mentioned below are production signed; you need to enable test signing on the machine:
bcdedit /set testsigning on. All these binaries require Windows 10 at a minimum.
Since most of these drivers are still under development, it is recommended to also have a kernel debugger configured for the test machine.
The filter driver otlwf.sys exposes the IOCTL interface that otapi.dll uses and houses the bulk of the actual Thread logic. otapi.dll exposes the C interface for user mode applications to use to control the Thread interfaces.
install_otlwf.cmd fileThe miniport driver ottmp.sys binds to serial devices on the machine and exposes them to otlwf.sys. It is only needed if you are connecting to an actual device (such as the TI CC2538 or Nordic Semiconductor nRF52840 device).
devcon.exe restart *ottmp*
The command line tool otCli.exe exposes many of the APIs in otApi.dll via the command line. It is included with the same release binaries downloaded above. See the CLI example README for more details.
The main differences between otCli.exe on Windows and the ot-cli on Linux, are the following:
instance and instancelist commands.The instance command allows for getting/setting the current instance that the rest of the commands act on.
> instance 0
Done
> instance
[0] {01234567-89AB-CDEF-0123-4567890ABCDE} (Compartment 1)
The instancelist command queries for all available instances/interfaces on the machine.
> instancelist
1 instances found:
[0] {01234567-89AB-CDEF-0123-4567890ABCDE} (Compartment 1)
The latest builds of the sample universal app can be downloaded from the latest AppVeyor build.
The Python certification tests approximate the testing done for real certification. On Windows they are run using virtual OpenThread devices. To set up the environment:
C:\Python36 for all users. Make sure to add the install path to PATH.python.exe C:\Python36\Scripts\pip.exe install pycryptodome==3.4.3To run all the tests:
otTestRunner.exe scripts Cert_* parallel:4 retry:2