Discovery mDNS

Mantieni tutto organizzato con le raccolte Salva e classifica i contenuti in base alle tue preferenze.

Visualizza origine su GitHub

OTBR registra un servizio _meshcop._udp denominato OpenThread BorderRouter. Questo servizio è configurato nel file OTBR CMakeLists.txt.

Esistono diversi modi per scoprire la rete Thread.

DNS Service Discovery (DNS-SD)

Utilizza dns-sd per cercare un servizio su raspberrypi.local.:49155:

dns-sd -L "OpenThread BorderRouter" _meshcop._udp local
Lookup OpenThread BorderRouter._meshcop._udp.local
DATE: ---Tue 16 Nov 2021---
13:31:03.197  ...STARTING...
13:31:03.350  OpenThread\032BorderRouter._meshcop._udp.local. can be reached at raspberrypi.local.:49155 (interface 3)

Recupera gli indirizzi IP associati al tuo nome di dominio OTBR:

dns-sd -G v4/v6 raspberrypi.local
DATE: ---Tue 16 Nov 2021---
14:21:29.485  ...STARTING...
Timestamp     A/R Flags if Hostname           Address                                      TTL
14:21:29.486  Add     3  3 raspberrypi.local. FDDE:AD11:11DE:0000:74D0:6FC9:6BE6:3582%<0>  120
14:21:29.486  Add     3  3 raspberrypi.local. FD00:0000:0000:0000:74D0:6FC9:6BE6:3582%<0>  120
14:21:29.486  Add     3  3 raspberrypi.local. FE80:0000:0000:0000:74D0:6FC9:6BE6:3582%eth0 120
14:21:29.486  Add     3  3 raspberrypi.local. FE80:0000:0000:0000:287F:87CA:F4B3:498A%eth0 120
14:21:29.486  Add     2  3 raspberrypi.local. 192.168.0.10                                 120

Invia un ping al tuo indirizzo IP. Dai risultati dns-sd scegli un indirizzo raggiungibile dalla tua rete, ad esempio l'indirizzo <0>globaleFD00::74D0:6FC9:6BE6:3582:

ping -6 FD00::74D0:6FC9:6BE6:3582
PING FD00::74D0:6FC9:6BE6:3582(fd00::74d0:6fc9:6be6:3582) 56 data bytes
64 bytes from fd00::74d0:6fc9:6be6:3582: icmp_seq=1 ttl=64 time=27.1 ms
64 bytes from fd00::74d0:6fc9:6be6:3582: icmp_seq=2 ttl=64 time=3.18 ms
64 bytes from fd00::74d0:6fc9:6be6:3582: icmp_seq=3 ttl=64 time=2.76 ms

Utilità Avahi

Installa avahi-daemon e avahi-utils:

sudo apt-get install -y avahi-daemon avahi-utils

Avvia avahi-daemon:

sudo service avahi-daemon start

Usa avahi-browse:

avahi-browse -r -t _meshcop._udp
+ eth0 IPv6 OpenThread BorderRouter   _meshcop._udp        local
= eth0 IPv6 OpenThread BorderRouter   _meshcop._udp        local
   hostname = [raspberrypi.local]
   address = [192.168.0.10]
   port = [49155]
   txt = []

App mDNS

Cerca Google Play per le app di rilevamento mDNS, ad esempio: