How to control the Thread stack via Cli commands.
Connectivity, 802.15.4 protocol, Thread, CLI
This example runs on STM32WBA52xx devices.
This example has been tested with an STMicroelectronics STM32WBA55CGA_Nucleo board and can be easily tailored to any other supported device and development board.
The Cli (Command Line Interface) commands are sent via an UART from an HyperTerminal (PC) to the STM32WBA55xx Nucleo Board.
___________________________ | | | ________________| _____________________________________ | |USART1 | | HyperTerminal 1 | | | | |=> Used to ctrl the stack via Cli Cmd| | | | | | | | | | | | | |______________________| | | | |______________________| ST_Link virtual port | | | | ST_Link Cable | | | | | | | | | | | | | | | | | | |________________| |_____________________________________| | | | _______________ | ______________________________________ | |USART2 | | HyperTerminal 2 (Optional) | | | | |=> Used to display traces | | | | | | | |CN4 (Pin37) RX |______________________|TX | | | | | | | | | RS232 Cable | | | | | | | | |CN4 (Pin35) TX |______________________|RX | | | | | | | |________________| |______________________________________| | | | | | | |_STM32WBA55xx_Nucleo_______|
On the HyperTerminal, the user can type the command ‘help’ in order to display the list of all available cli commands. Additional information can be found looking at the OpenThread web site: https://openthread.io/guides/
>panid 0x1234
Done
>channel 12
Done
>ifconfig up
Done
>networkkey 00112233445566778899AABBCCDDEEFF
>thread start
Done
At this point, the user can check the state of its device by using the cli command ‘state’:
>state
leader
Done
Note: With MTD config, we have only Child role.
Note: The application needs to ensure that the SysTick time base is always set to 1 millisecond to have correct HAL operation.
To get the traces you need to connect your Board to the Hyperterminal (through the STLink Virtual COM Port).
The UART must be configured as follows:
BaudRate = 115200 baud Word Length = 8 Bits Stop Bit = 1 bit Parity = none Flow control = none Terminal “Go to the Line” : LF