This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Thread Network : Border Router configuration

Hi,

I'm working on a thread network and I have some difficulties to configure the BorderRouter.

I use the BorderRouter V2 rapsberry image from Nordic, I recompile the openthread library with the pre-release Thread reference 2018-09-26 (https://github.com/openthread/openthread/releases/tag/thread-reference-20180926) for the ncp and all works find.

But I want to put a static configuration in the Border Router to configure the PANID, the Channel, the Network Name and the master key.

I try to edit the file /etc/wpantund.conf file with this :

Config:TUN:InterfaceName wpan0
Config:NCP:SocketPath "serial:/dev/ttyACM0,raw,b115200,crtscts=1"
Config:NCP:DriverName spinel
Daemon:SyslogMask "all -debug"

NCP:Channel 20
NCP:TXPower 4

Network:Name Test-Thread
Network:XPANID DEAD00BEEF00CAFE
Network:PANID 0xABCD
Network:Key 00112233445566778899AABBCCDDEEFF

When I reeboot the system, the NCP:state is offline and the thread network is not up. If I restart the wpantund.service (sudo systemctl restart wpantund.service), the thread network restart and it's work. I don't understand why this happen and how can I be sure that the thread network goes up.

I find the file /etc/border_router.conf but it doesn't change thread parameter... I don't understand how this file is using...

Are someone knows how change automaticaly the  thread network parameters from BR after power on?

Thank you,

Valentin

Parents
  • Hello,

    I have tested your solution and it's work ! It doesn't work with a reboot command of the raspberry because the nrf52840 DK NCP keep the power active and the parameter changed in a weird way...

    With a reboot, I make a script with a crontab tack at reboot :

    #!/bin/bash
    wpanctl leave
    wpanctl reset
    sleep 5
    wpanctl form -T 2 GL-BLUEGRioT
    wpanctl dataset get-active
    wpanctl set dataset:Channel 20
    wpanctl set dataset:NetworkName "Test"
    wpanctl set dataset:Panid 0xABCD
    wpanctl set dataset:ExtendedPanid DEAD00BEEF00CAFE
    wpanctl set dataset:Masterkey 00112233445566778899AABBCCDDEEFF
    wpanctl set dataset:MeshLocalPrefix "fdde:ad00:beef::64"
    wpanctl dataset set-active

    This reset my network data, if this can help someone.

    Thank you for your response. Do you know what are the difference between the MeshLocalPrefix in the dataset and the thread_on_mesh_prefix in the /etc/border_router.conf ?

    Valentin

  • Hello Valentin, 

    Thank you for sharing!

    I am sorry, I am not sure about the way that the border router works, but as you say: 

    "It doesn't work with a reboot command of the raspberry because the nrf52840 DK NCP keep the power active and the parameter changed in a weird way"

    I believe it is because this data is stored in flash. Even power cycling the nRF52840 DK will not change this. The "best" way to reset the behavior is to erase the chip (including the flash pages where the masterkeys are stored) using nrfjprog -e and reprogramming it. 

Reply Children
No Data
Related