<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nrf5 SDK IoT cannot ping nrf52840 from router</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/62942/nrf5-sdk-iot-cannot-ping-nrf52840-from-router</link><description>Hi! 
 I&amp;#39;m trying to do the TCP example with the nRF5_SDK_16.0.0_98a08e2, a nrf52840 DK board and a Raspberry Pi 3 B+ as a gateway but I got some problems. 
 For connecting the board to the Raspberry Pi I&amp;#39;ve followed the instructions from the tutorials</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 18 Mar 2021 20:46:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/62942/nrf5-sdk-iot-cannot-ping-nrf52840-from-router" /><item><title>RE: nrf5 SDK IoT cannot ping nrf52840 from router</title><link>https://devzone.nordicsemi.com/thread/300788?ContentTypeID=1</link><pubDate>Thu, 18 Mar 2021 20:46:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:888859b8-68ee-402e-bae3-f3c83cfed398</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;The solution for the 30 second disconnect is described in this post: &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/37179/ipv6_medium_ble-c---on_ble_evt-does-not-implement-ble_gap_evt_data_length_update_request-event-which-leads-to-ll-request-timeout-with-linux-6lowpan-module"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/37179/ipv6_medium_ble-c---on_ble_evt-does-not-implement-ble_gap_evt_data_length_update_request-event-which-leads-to-ll-request-timeout-with-linux-6lowpan-module&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5 SDK IoT cannot ping nrf52840 from router</title><link>https://devzone.nordicsemi.com/thread/260714?ContentTypeID=1</link><pubDate>Sun, 19 Jul 2020 18:08:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0ab664c-2c68-4357-b104-2765c33f0f47</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Thanks for reporting back on the error! Sorry for not answering you yet, but we have limited capacity due to summer vacations. What I can say about the 30 seconds timeout is that, if I recall correctly, there is a connection update from the RPi which is not handled in the SDK code. I think it requests extended MTU, DLE or similar, which is not responded to, which leads to a disconnect. If you have a BLE sniffer you can see which request this is.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5 SDK IoT cannot ping nrf52840 from router</title><link>https://devzone.nordicsemi.com/thread/257916?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2020 15:10:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9990a17-1e72-419b-b05d-40ae41fbee4d</guid><dc:creator>Moritz</dc:creator><description>&lt;p&gt;FYI:&lt;/p&gt;
&lt;p&gt;I found the error. Apparently the ipv6 address calculation is different than explained here: &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.iotsdk.v0.9.0/iot_sdk_user_guides_ipv6_address_creation.html?cp=7_4_2_4"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.iotsdk.v0.9.0/iot_sdk_user_guides_ipv6_address_creation.html?cp=7_4_2_4&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The ipv6 address which worked is 2001:db8::81:1dff:fe38:2271 (global) respectively fe80::81:1dff:fe38:2271 (local).&lt;/p&gt;
&lt;p&gt;I somehow had to remove the &amp;#39;2&amp;#39; before &amp;#39;81:1dff:...&amp;#39; but I don&amp;#39;t know why because the board uses a public BLE address and therefore should have a &amp;#39;2&amp;#39; at this position.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But I still have the problem with the automatic BLE disconnect after approx. 30s, even if I spam ping requests or establish a tcp connection. Does anybody have a solution for this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5 SDK IoT cannot ping nrf52840 from router</title><link>https://devzone.nordicsemi.com/thread/256763?ContentTypeID=1</link><pubDate>Wed, 24 Jun 2020 16:01:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e80ed4f-6bbf-4c04-97a0-da6323dfb9e9</guid><dc:creator>Moritz</dc:creator><description>&lt;p&gt;Hi Stian thanks for your response!&lt;/p&gt;
&lt;p&gt;1. Thanks for mentioning the typo in the address. I removed it but unfortunately it didn&amp;#39;t solve the problem.&lt;/p&gt;
&lt;p&gt;2. I ran the two &amp;quot;cat&amp;quot; commands you mentioned and both times the result was 1, so the values were set correctly.&lt;/p&gt;
&lt;p&gt;3. I am running the TCP server example from $(SDK_ROOT)/examples/iot/tcp/server&lt;/p&gt;
&lt;p&gt;4. The log from a connected terminal is always the same an doesn&amp;#39;t really help. It just confirms that the BLE connect was successful and that the ipv6 interface was initialized:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; app_timer: RTC: initialized.␍␍␊
&amp;lt;info&amp;gt; app: Application started.␍␍␊
&amp;lt;info&amp;gt; app: Physical layer in connectable mode.␍␍␊
&amp;lt;info&amp;gt; app: Physical layer: connected.␍␍␊
&amp;lt;info&amp;gt; app: IPv6 interface up.␍␍␊&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;5. Concerning the ping of the link local address I did another try, but this time ensuring that the radvd service is stopped before and I also ensured that no global address to the bt0 interface is added. The shell script I wrote for this is the following:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;#!/bin/sh
# execute as superuser!!!

# stop a possibly running radvd service
service radvd stop
# Mount debugfs file system.
mount -t debugfs none /sys/kernel/debug
# Load 6LoWPAN module.
modprobe bluetooth_6lowpan
# Enable the bluetooth 6lowpan module.
echo 1 &amp;gt; /sys/kernel/debug/bluetooth/6lowpan_enable
# Look for available HCI devices.
hciconfig
# Reset HCI device - for example hci0 device.
hciconfig hci0 reset
sleep 2
# Read 00:AA:BB:XX:YY:ZZ address of the nRF5x device.
#timeout 3s hcitool lescan
# Connect to the device.
echo &amp;quot;Connecting to device 00:81:1D:38:22:71&amp;quot;
echo &amp;quot;connect 00:81:1D:38:22:71 1&amp;quot; &amp;gt; /sys/kernel/debug/bluetooth/6lowpan_control
sleep 20 #sleep long enough to refresh wireshark interfaces
# Check if you have established a connection.
ifconfig bt0
echo &amp;quot;discover the link local addresses of the board&amp;quot;
ping6 -I bt0 ff02::1 -c 5
sleep 2
# Try to ping the device using its link-local address, for example, on bt0 interface.
echo &amp;quot; &amp;quot;
ping6 -I bt0 fe80::281:1dff:fe38:2271 -c 5&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The corresponding terminal output to this shell script is:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;mount: none is already mounted or /sys/kernel/debug busy
hci0:	Type: Primary  Bus: UART
	BD Address: B8:27:EB:F5:2A:08  ACL MTU: 1021:8  SCO MTU: 64:1
	UP RUNNING 
	RX bytes:2825 acl:49 sco:0 events:140 errors:0
	TX bytes:5831 acl:53 sco:0 commands:104 errors:0

Connecting to device 00:81:1D:38:22:71
bt0: flags=4161&amp;lt;UP,RUNNING,MULTICAST&amp;gt;  mtu 1280
        inet6 fe80::b827:ebff:fef5:2a08  prefixlen 64  scopeid 0x20&amp;lt;link&amp;gt;
        unspec B8-27-EB-F5-2A-08-00-00-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)
        RX packets 1  bytes 28 (28.0 B)
        RX errors 0  dropped 2  overruns 0  frame 0
        TX packets 17  bytes 1361 (1.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

discover the link local addresses of the board
PING ff02::1(ff02::1) from fe80::b827:ebff:fef5:2a08%bt0 bt0: 56 data bytes
64 bytes from fe80::b827:ebff:fef5:2a08%bt0: icmp_seq=1 ttl=64 time=0.185 ms
64 bytes from fe80::b827:ebff:fef5:2a08%bt0: icmp_seq=2 ttl=64 time=0.198 ms
64 bytes from fe80::b827:ebff:fef5:2a08%bt0: icmp_seq=3 ttl=64 time=0.168 ms
64 bytes from fe80::b827:ebff:fef5:2a08%bt0: icmp_seq=4 ttl=64 time=0.103 ms
64 bytes from fe80::b827:ebff:fef5:2a08%bt0: icmp_seq=5 ttl=64 time=0.106 ms

--- ff02::1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4194ms
rtt min/avg/max/mdev = 0.103/0.152/0.198/0.039 ms
 
PING fe80::281:1dff:fe38:2271(fe80::281:1dff:fe38:2271) from fe80::b827:ebff:fef5:2a08%bt0 bt0: 56 data bytes
From fe80::b827:ebff:fef5:2a08%bt0 icmp_seq=1 Destination unreachable: Address unreachable
From fe80::b827:ebff:fef5:2a08%bt0 icmp_seq=2 Destination unreachable: Address unreachable
From fe80::b827:ebff:fef5:2a08%bt0 icmp_seq=3 Destination unreachable: Address unreachable
From fe80::b827:ebff:fef5:2a08%bt0 icmp_seq=4 Destination unreachable: Address unreachable
From fe80::b827:ebff:fef5:2a08%bt0 icmp_seq=5 Destination unreachable: Address unreachable

--- fe80::281:1dff:fe38:2271 ping statistics ---
5 packets transmitted, 0 received, +5 errors, 100% packet loss, time 4148ms&lt;/pre&gt;&lt;br /&gt;Apparently, the RaspberryPi&amp;#39;s bt0 interface is not able to discover the link local address of the BLE board and therefore also cannot ping it.&lt;/p&gt;
&lt;p&gt;The data sniffed by whireshark on the bt0 interface was as follows:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_ipv6_5F00_nrf_5F00_sdk_5F00_local.pcapng"&gt;devzone.nordicsemi.com/.../ble_5F00_ipv6_5F00_nrf_5F00_sdk_5F00_local.pcapng&lt;/a&gt;&lt;br /&gt;It just shows the ping requests from the bt0 interface but no response from the nrf52840 dk.&lt;/p&gt;
&lt;p&gt;The serial terminal log output was again similar as shown above in point 4.&lt;/p&gt;
&lt;p&gt;6. I could show you similar results for my try with radvd enabled and a global bt0 address (to address your point here: I indeed added/add the global address every time I reconnect the BLE device), but I don&amp;#39;t think that the problem lies in the configuration of radvd, ipv6 forwarding and global addresses, if I&amp;#39;m even not able to detect and ping the BLE device&amp;#39;s link local address.&lt;/p&gt;
&lt;p&gt;I hope this gives you more information for further debugging help. Thank you very much!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5 SDK IoT cannot ping nrf52840 from router</title><link>https://devzone.nordicsemi.com/thread/256696?ContentTypeID=1</link><pubDate>Wed, 24 Jun 2020 12:32:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:058dc7ae-b79d-4bf5-a330-6ad2b9510d3b</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Can you check if&amp;nbsp;&amp;nbsp;6lowpan_enable and forwarding are actually set by running:&lt;/p&gt;
&lt;pre&gt;cat /proc/sys/net/ipv6/conf/all/forwarding
cat /sys/kernel/debug/bluetooth/6lowpan_enable&lt;/pre&gt;
&lt;p&gt;if you install wireshark you can sniff the bt0 interface and see the traffic that is going though the bt0 interface. If you post the log here I can try and see if there&amp;#39;s something wrong.&lt;/p&gt;
&lt;p&gt;Which example are you running from the SDK, and have you made any changes? If you connect a terminal to the DK what is the log telling you?&lt;/p&gt;
&lt;p&gt;There is still a typing mistake in the ping command in your last post. The last two bytes should be 2271, not 22:71&lt;/p&gt;
&lt;p&gt;The ping command where you ping the link local address is correct, but here you don&amp;#39;t add the global address to the bt0 interface, or restart radvd. You need to add the global address to the bt0 interface every time you reconnect to the BLE device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5 SDK IoT cannot ping nrf52840 from router</title><link>https://devzone.nordicsemi.com/thread/256628?ContentTypeID=1</link><pubDate>Wed, 24 Jun 2020 09:23:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4647e8e-018c-4b19-895e-8295e1cebd0a</guid><dc:creator>Moritz</dc:creator><description>&lt;p&gt;EDIT: I made a small mistake with the ping of the global ipv6 address of the board&lt;/p&gt;
&lt;p&gt;The address has to be 2001:db8::281:1dff:fe38:22:71&lt;/p&gt;
&lt;p&gt;But with this address I get no ping response:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;ping the BLE device using the global address
PING 2001:db8::281:1dff:fe38:22:71(2001:db8:0:281:1dff:fe38:22:71) 56 data bytes

--- 2001:db8::281:1dff:fe38:22:71 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4198ms&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>