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

CoAP client application can't reach nrf52840 CoAP server whereas IPv6 pings work

Hello all ! 

So here is my problem, I have a computer as a CoAP client running the Python script from :https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.3.0%2Fiot_sdk_user_guides_linux_commands.html&cp=5_1_5_5_0_5

I connect a nrf52840 DK running the CoAP server example through a Raspberry Pi used as border router. 

Pings from my computer to the nrf52840  works fine and I can see the CoAP Get requests directed to my CoAP server from my computer on Wireshark.

However the nrf52840 doesn't seem to receive the request and nothing happens on the DK (and the computer doesn't receive a response). 

I have the folowing logs on Segger: 

<info> app: Physical layer in connectable mode.
<info> app: Physical layer: connected.
<info> app: Got IP Application Handler Event on interface 0x0x20004F9C
<info> app: New interface added!
<info> app: Sending Router Solicitation to all routers!

Here I launch the Python script and get the Wireshark capture.

<info> app: Got IP Application Handler Event on interface 0x0x20004F9C
<info> app: Interface removed!
<info> app: Physical layer: disconnected.
<info> app: Physical layer in connectable mode.

Note: After 25 seconds, the interface is removed. This refers to an other problem I have with my setup that a connection between the border router and the nrf52840 never last more than ~30 seconds, I have another bug about it is someone wants to help: 

https://devzone.nordicsemi.com/f/nordic-q-a/48277/ble-over-ipv6-between-nrf52840-dev-kit-and-rapberry-3-b-border-router-connection-interface-is-removed-after-30-sec

Does anyone have an idea why this happens or some tips to keep trying to resolve this issue ? 

Thanks in advance,

Aloïs KYROU

Parents
  • Hi,

     

    The server does not seem to reply.

    The IP seems to be 2001:db8::d5:f7ff:fed1:70f6. This amounts to 5 byte BLE address, d5:f7:d1:70:f6, looks like you're missing a byte?

    what does "hcitool con" show?

     

    Kind regards,

    Håkon

  • Hello and thank you for answering :) 

    pi@raspberrypi:~ $ hcitool con
    Connections:
    < LE 00:D5:F7:D1:70:F6 handle 64 state 1 lm MASTER

    In my understanding, since the MAC starts with 00 we can concatenate 00:D5 into D5. 

  • Ah, yes. You're right. The coap example reads out the BLE address, and sets it as public (upper bits set to '00'), but it was a bit suspicious that the remainder of the byte was all zero's, but then I noticed that the FW actually sets the whole byte to 0..

    I just tested the example, with #define BLE_6LOWPAN_LEGACY_MODE 0, in ubuntu 19.10. Which coap-client are you using? If you're using libcoap-2-0-bin, I couldn't even get anything out (wireshark concluded the same, req was not sent from PC -> device)

    installing libcoap-1-0-bin, then use coap-client to get, it started working:

    $ coap-client -m get coap://[fe80::6c:30FF:fe79:30b5]/lights/led3
    v:1 t:CON c:GET i:6c25 {} [ ]
    0
    

    Note: I set this up on my local PC, so I just use FE80:: prefix, but you still need to route bt0 and eth0.

    Since I'm using FE80:: for testing, it looks like this:

    sudo route -A inet6 add fe80::/64 dev bt0

     

    You can test this by pinging directly, without specifying the interface, i.e. ping6 ABCD::MY:IP:ADDR. If this does not work, then the route is not OK.

     

    Here's my wireshark log btw: coap_ipv6.pcapng

     

    Could it be either the libcoap-1-0, or the route that is the problem on your side?

      

    Cheers,

    Håkon

  • Thanks a lot for taking the time to realise these tests ! 

    I did as you suggested and made work the example from border router with libcoap-1-0 with local-link address. 

    I Set a second Rpi as Client for test that successefully pings the nRF52840 through the border router (replacing the PC in my previous example). I downloaded the same libcoap as the border router and sadly it doesn't work. 

    On my PC I used the Python script from https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.3.0%2Fiot_sdk_app_coap_server.html&cp=5_1_4_2_4_1_0_4&anchor=iot_sdk_app_coap_server_python_sample

    I guess my routes are the problem, but if it is the case how come I'm able to Ping from the Client ??

    Global address of the CoAP Server : 2001:db8::/64 fc00::dcba:a54e:1868:4107

    Global address of the RPi border router :  fc00::dcba:a54e:1868:4107 

    Global address of the CoAP Client  (RPi)  :  fc00::5b16:ec6f:61a8:3e0c

    Routes on the Rpi used as CoAP Client: 

    pi@raspberrypi:~ $ route -A inet6
    Table de routage IPv6 du noyau
    Destination Next Hop Flag Met Ref Use If
    2001:db8::/64 fc00::dcba:a54e:1868:4107 UG 1024 4 21 eth0
    fc00::/64 [::] U 202 3 8 eth0
    fe80::/64 [::] U 256 1 0 eth0
    [::]/0 [::] !n -1 1 99 lo
    localhost/128 [::] Un 0 4 3 lo
    fc00::5b16:ec6f:61a8:3e0c/128 [::] Un 0 3 23 eth0
    fe80::9bfa:892c:6e1c:a50c/128 [::] Un 0 3 18 eth0
    ff00::/8 [::] U 256 5 815 eth0
    ff00::/8 [::] U 256 1 0 wlan0
    [::]/0 [::] !n -1 1 99 lo

    Routes RPi used as border router: 

    route -A inet6
    Kernel IPv6 routing table
    Destination Next Hop Flag Met Ref Use If
    2001:db8::/64 [::] U 256 1 0 bt0
    fc00::/64 [::] U 202 1 0 eth0
    fe80::/64 [::] U 256 2 0 eth0
    fe80::/64 [::] U 256 1 0 bt0
    [::]/0 [::] !n -1 1 0 lo
    localhost/128 [::] Un 0 3 0 lo
    2001:db8::/128 [::] Un 0 3 0 bt0
    2001:db8::1/128 [::] Un 0 3 0 bt0
    fc00::/128 [::] Un 0 3 0 eth0
    fc00::dcba:a54e:1868:4107/128 [::] Un 0 3 0 eth0
    fe80::/128 [::] Un 0 3 0 eth0
    fe80::/128 [::] Un 0 3 0 bt0
    fe80::233e:c816:c332:c668/128 [::] Un 0 5 0 eth0
    fe80::b827:ebff:fe76:ebd8/128 [::] Un 0 2 0 bt0
    ff00::/8 [::] U 256 6 0 eth0
    ff00::/8 [::] U 256 1 0 wlan0
    ff00::/8 [::] U 256 4 0 bt0
    [::]/0 [::] !n -1 1 0 lo

    Ifconfig of the border router : 

    ifconfig
    bt0: flags=4161<UP,RUNNING,MULTICAST> mtu 1280
    inet6 fe80::b827:ebff:fe76:ebd8 prefixlen 64 scopeid 0x20<link>
    inet6 2001:db8::1 prefixlen 64 scopeid 0x0<global>
    unspec B8-27-EB-76-EB-D8-18-67-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC)
    RX packets 7 bytes 230 (230.0 B)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 25 bytes 1891 (1.8 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    inet 192.168.1.209 netmask 255.255.128.0 broadcast 192.168.127.255
    inet6 fe80::233e:c816:c332:c668 prefixlen 64 scopeid 0x20<link>
    inet6 fc00::dcba:a54e:1868:4107 prefixlen 64 scopeid 0x0<global>
    ether b8:27:eb:dc:41:72 txqueuelen 1000 (Ethernet)
    RX packets 2299 bytes 215909 (210.8 KiB)
    RX errors 2 dropped 0 overruns 0 frame 0
    TX packets 344 bytes 34727 (33.9 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    If you see something that looks suspicious, because according to me this looks ok but I'm not very experimented... 

    Thank you !

    Regards,

    Aloïs KYROU.

Reply
  • Thanks a lot for taking the time to realise these tests ! 

    I did as you suggested and made work the example from border router with libcoap-1-0 with local-link address. 

    I Set a second Rpi as Client for test that successefully pings the nRF52840 through the border router (replacing the PC in my previous example). I downloaded the same libcoap as the border router and sadly it doesn't work. 

    On my PC I used the Python script from https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.3.0%2Fiot_sdk_app_coap_server.html&cp=5_1_4_2_4_1_0_4&anchor=iot_sdk_app_coap_server_python_sample

    I guess my routes are the problem, but if it is the case how come I'm able to Ping from the Client ??

    Global address of the CoAP Server : 2001:db8::/64 fc00::dcba:a54e:1868:4107

    Global address of the RPi border router :  fc00::dcba:a54e:1868:4107 

    Global address of the CoAP Client  (RPi)  :  fc00::5b16:ec6f:61a8:3e0c

    Routes on the Rpi used as CoAP Client: 

    pi@raspberrypi:~ $ route -A inet6
    Table de routage IPv6 du noyau
    Destination Next Hop Flag Met Ref Use If
    2001:db8::/64 fc00::dcba:a54e:1868:4107 UG 1024 4 21 eth0
    fc00::/64 [::] U 202 3 8 eth0
    fe80::/64 [::] U 256 1 0 eth0
    [::]/0 [::] !n -1 1 99 lo
    localhost/128 [::] Un 0 4 3 lo
    fc00::5b16:ec6f:61a8:3e0c/128 [::] Un 0 3 23 eth0
    fe80::9bfa:892c:6e1c:a50c/128 [::] Un 0 3 18 eth0
    ff00::/8 [::] U 256 5 815 eth0
    ff00::/8 [::] U 256 1 0 wlan0
    [::]/0 [::] !n -1 1 99 lo

    Routes RPi used as border router: 

    route -A inet6
    Kernel IPv6 routing table
    Destination Next Hop Flag Met Ref Use If
    2001:db8::/64 [::] U 256 1 0 bt0
    fc00::/64 [::] U 202 1 0 eth0
    fe80::/64 [::] U 256 2 0 eth0
    fe80::/64 [::] U 256 1 0 bt0
    [::]/0 [::] !n -1 1 0 lo
    localhost/128 [::] Un 0 3 0 lo
    2001:db8::/128 [::] Un 0 3 0 bt0
    2001:db8::1/128 [::] Un 0 3 0 bt0
    fc00::/128 [::] Un 0 3 0 eth0
    fc00::dcba:a54e:1868:4107/128 [::] Un 0 3 0 eth0
    fe80::/128 [::] Un 0 3 0 eth0
    fe80::/128 [::] Un 0 3 0 bt0
    fe80::233e:c816:c332:c668/128 [::] Un 0 5 0 eth0
    fe80::b827:ebff:fe76:ebd8/128 [::] Un 0 2 0 bt0
    ff00::/8 [::] U 256 6 0 eth0
    ff00::/8 [::] U 256 1 0 wlan0
    ff00::/8 [::] U 256 4 0 bt0
    [::]/0 [::] !n -1 1 0 lo

    Ifconfig of the border router : 

    ifconfig
    bt0: flags=4161<UP,RUNNING,MULTICAST> mtu 1280
    inet6 fe80::b827:ebff:fe76:ebd8 prefixlen 64 scopeid 0x20<link>
    inet6 2001:db8::1 prefixlen 64 scopeid 0x0<global>
    unspec B8-27-EB-76-EB-D8-18-67-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC)
    RX packets 7 bytes 230 (230.0 B)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 25 bytes 1891 (1.8 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    inet 192.168.1.209 netmask 255.255.128.0 broadcast 192.168.127.255
    inet6 fe80::233e:c816:c332:c668 prefixlen 64 scopeid 0x20<link>
    inet6 fc00::dcba:a54e:1868:4107 prefixlen 64 scopeid 0x0<global>
    ether b8:27:eb:dc:41:72 txqueuelen 1000 (Ethernet)
    RX packets 2299 bytes 215909 (210.8 KiB)
    RX errors 2 dropped 0 overruns 0 frame 0
    TX packets 344 bytes 34727 (33.9 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    If you see something that looks suspicious, because according to me this looks ok but I'm not very experimented... 

    Thank you !

    Regards,

    Aloïs KYROU.

Children
Related