Installation native

Afficher la source sur GitHub

Obtenir le code OTBR

Sur Raspberry Pi :

  1. Installez git :

    sudo apt install git
    

  2. Clonez ot-br-posix depuis GitHub :

    git clone --depth=1 https://github.com/openthread/ot-br-posix
    

Compiler et installer OTBR

OTBR dispose de deux scripts qui amorcent et configurent le routeur de bordure Thread :

cd ot-br-posix
./script/bootstrap
INFRA_IF_NAME=wlan0 ./script/setup

OTBR fonctionne à la fois sur une interface Thread et sur une interface réseau d'infrastructure (par exemple, Wi-Fi/Ethernet) spécifiée avec INFRA_IF_NAME. L'interface Thread est créée par OTBR lui-même et nommée wpan0 par défaut. L'interface d'infrastructure a une valeur par défaut de wlan0 si INFRA_IF_NAME n'est pas spécifié explicitement. Si votre Raspberry Pi est connecté par un câble Ethernet, spécifiez le nom de l'interface Ethernet (par exemple, eth0) :

INFRA_IF_NAME=eth0 ./script/setup

Le service otbr-agent est désormais activé et démarrera au redémarrage. Pour démarrer le service immédiatement sans redémarrer, utilisez le script server :

./script/server

Vérifiez que le service otbr-agent est actif :

sudo service otbr-agent status
● otbr-agent.service - Border Router Agent
   Loaded: loaded (/lib/systemd/system/otbr-agent.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2021-03-01 05:46:26 GMT; 2s ago
 Main PID: 2997 (otbr-agent)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/otbr-agent.service
           └─2997 /usr/sbin/otbr-agent -I wpan0 -B wlan0 spinel+hdlc+uart:///dev/ttyACM0

Mar 01 05:46:26 raspberrypi otbr-agent[2997]: Stop publishing service
Mar 01 05:46:26 raspberrypi otbr-agent[2997]: [adproxy] Stopped
Mar 01 05:46:26 raspberrypi otbr-agent[2997]: PSKc is not initialized
Mar 01 05:46:26 raspberrypi otbr-agent[2997]: Check if PSKc is initialized: OK
Mar 01 05:46:26 raspberrypi otbr-agent[2997]: Initialize OpenThread Border Router Agent: OK
Mar 01 05:46:26 raspberrypi otbr-agent[2997]: Border router agent started.
Mar 01 05:46:26 raspberrypi otbr-agent[2997]: [INFO]-CORE----: Notifier: StateChanged (0x00038200) [NetData PanId NetName ExtPanId]
Mar 01 05:46:26 raspberrypi otbr-agent[2997]: [INFO]-PLAT----: Host netif is down