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

Unable to connect with IoT SDK dns example

I have followed instructions at the link below to setup a Raspberry Pi 3 as a 6lowPAN router, and am trying to run the dns example from nRF5 IoT SDK 0.9.x on an nRF52-DK:

infocenter.nordicsemi.com/index.jsp

I think my Pi is setup correctly. I am able to detect and connect to the nRF52-DK, and ping it as well.

root@raspberrypi:/home/pi# hcitool lescan
LE Scan ...
00:4E:CC:9A:19:F2 DNS_Client
00:4E:CC:9A:19:F2 (unknown)
^C
root@raspberrypi:/home/pi# echo "connect 00:4E:CC:9A:19:F2 1" > /sys/kernel/debug/bluetooth/6lowpan_control 
root@raspberrypi:/home/pi# hcitool con
Connections:
	< Unknown 00:4E:CC:9A:19:F2 handle 64 state 1 lm MASTER 
root@raspberrypi:/home/pi# echo 2 > /proc/sys/net/ipv6/conf/bt0/accept_ra
root@raspberrypi:/home/pi# sudo ifconfig bt0 add 2001:db8::1/64
root@raspberrypi:/home/pi# ifconfig bt0
bt0       Link encap:UNSPEC  HWaddr B8-27-EB-FF-FE-57-53-C5-00-00-00-00-00-00-00-00  
          inet6 addr: 2001:db8::ba27:ebff:fe57:53c5/64 Scope:Global
          inet6 addr: 2001:db8::1/64 Scope:Global
          inet6 addr: fe80::ba27:ebff:fe57:53c5/64 Scope:Link
          UP POINTOPOINT RUNNING MULTICAST  MTU:1280  Metric:1
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:28 (28.0 B)  TX bytes:813 (813.0 B)

root@raspberrypi:/home/pi# ping6 -I bt0 fe80::ba27:ebff:fe57:53c5
PING fe80::ba27:ebff:fe57:53c5(fe80::ba27:ebff:fe57:53c5) from fe80::ba27:ebff:fe57:53c5 bt0: 56 data bytes
64 bytes from fe80::ba27:ebff:fe57:53c5: icmp_seq=1 ttl=64 time=0.207 ms
64 bytes from fe80::ba27:ebff:fe57:53c5: icmp_seq=2 ttl=64 time=0.172 ms
64 bytes from fe80::ba27:ebff:fe57:53c5: icmp_seq=3 ttl=64 time=0.169 ms
^C
--- fe80::ba27:ebff:fe57:53c5 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.169/0.182/0.207/0.023 ms

Pinging the device (nRF52-DK) also works. (MAC addr is 00:4E:CC:9A:19:F2):

root@raspberrypi:/home/pi# ping6 2001:db8::24e:ccff:fe9a:19f2
PING 2001:db8::24e:ccff:fe9a:19f2(2001:db8::24e:ccff:fe9a:19f2) 56 data bytes
64 bytes from 2001:db8::24e:ccff:fe9a:19f2: icmp_seq=1 ttl=64 time=254 ms
64 bytes from 2001:db8::24e:ccff:fe9a:19f2: icmp_seq=2 ttl=64 time=266 ms
64 bytes from 2001:db8::24e:ccff:fe9a:19f2: icmp_seq=3 ttl=64 time=210 ms
64 bytes from 2001:db8::24e:ccff:fe9a:19f2: icmp_seq=4 ttl=64 time=358 ms
^C
--- 2001:db8::24e:ccff:fe9a:19f2 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms

But the dns code on the nRF52-DK seems to be failing. LED2 remains lit after BLE connection, and pressing buttons 1/2 does nothing.

I think I am still missing something - maybe the 6LowPAN network is still not able to connect to the internet.

I'd appreciate any help in making this work. Thanks!

Update #3

I added a route and now I am able to ping DK externally.

sudo route -A inet6 add 2001:470:6d:3fd::/64 dev bt0

And low and behold, the DNS example works! :-)

Update #2

root@raspberrypi:/home/pi# ifconfig
bt0       Link encap:UNSPEC  HWaddr B8-27-EB-FF-FE-57-53-C5-00-00-00-00-00-00-00-00  
          inet6 addr: 2001:470:6d:3fd:ba27:ebff:fe57:53c5/64 Scope:Global
          inet6 addr: 2001:470:6d:3fd::2/64 Scope:Global
          inet6 addr: fe80::ba27:ebff:fe57:53c5/64 Scope:Link
          UP POINTOPOINT RUNNING MULTICAST  MTU:1280  Metric:1
          RX packets:17 errors:0 dropped:0 overruns:0 frame:0
          TX packets:46 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:1100 (1.0 KiB)  TX bytes:3145 (3.0 KiB)

eth0      Link encap:Ethernet  HWaddr b8:27:eb:fd:f9:6f  
          inet addr:192.168.3.94  Bcast:192.168.3.255  Mask:255.255.252.0
          inet6 addr: 2001:470:6d:3fd::1/64 Scope:Global
          inet6 addr: fe80::fa5c:d96c:8152:622b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:83859 errors:0 dropped:28 overruns:0 frame:0
          TX packets:81398 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:82505717 (78.6 MiB)  TX bytes:83383851 (79.5 MiB)

he-ipv6   Link encap:IPv6-in-IPv4  
          inet6 addr: fe80::c0a8:35e/64 Scope:Link
          inet6 addr: 2001:470:6c:3fd::2/64 Scope:Global
          UP POINTOPOINT RUNNING NOARP  MTU:1480  Metric:1
          RX packets:59927 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19478 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:78821152 (75.1 MiB)  TX bytes:2073148 (1.9 MiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:230 errors:0 dropped:0 overruns:0 frame:0
          TX packets:230 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:19776 (19.3 KiB)  TX bytes:19776 (19.3 KiB)

root@raspberrypi:/home/pi# ping6 -I bt0 ff02::1
PING ff02::1(ff02::1) from fe80::ba27:ebff:fe57:53c5 bt0: 56 data bytes
64 bytes from fe80::ba27:ebff:fe57:53c5: icmp_seq=1 ttl=64 time=0.149 ms
64 bytes from fe80::218:bbff:fe3c:1e76: icmp_seq=1 ttl=64 time=274 ms (DUP!)
^C
--- ff02::1 ping statistics ---
2 packets transmitted, 2 received, +2 duplicates, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.111/106.643/274.694/115.059 ms

root@raspberrypi:/home/pi# ping6 -I bt0 -c 4 2001:470:6d:3fd:218:bbff:fe3c:1e76
PING 2001:470:6d:3fd:218:bbff:fe3c:1e76(2001:470:6d:3fd:218:bbff:fe3c:1e76) from 2001:470:6d:3fd:ba27:ebff:fe57:53c5 bt0: 56 data bytes
64 bytes from 2001:470:6d:3fd:218:bbff:fe3c:1e76: icmp_seq=1 ttl=64 time=230 ms
64 bytes from 2001:470:6d:3fd:218:bbff:fe3c:1e76: icmp_seq=2 ttl=64 time=242 ms
64 bytes from 2001:470:6d:3fd:218:bbff:fe3c:1e76: icmp_seq=3 ttl=64 time=321 ms
64 bytes from 2001:470:6d:3fd:218:bbff:fe3c:1e76: icmp_seq=4 ttl=64 time=265 ms

--- 2001:470:6d:3fd:218:bbff:fe3c:1e76 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 230.845/264.887/321.060/34.698 ms
root@raspberrypi:/home/pi# 

External ping of 2001:470:6d:3fd:ba27:ebff:fe57:53c5 (bt0) works.

External ping of 2001:470:6d:3fd:218:bbff:fe3c:1e76 (DK) does not work.

Update #1

I now have a Hurricane Electric tunnel setup and can ping6 ipv6.google.com. But unfortunately the example still does not work.

Related