OpenThread COAP Client to a public server over Internet

Hello,

I am trying to make a Thread COAP Client on nRF52840 DK work with coap.me public server. I have created a Border Router with a Raspberry Pi and a nRF52 dongle and I am sure that it works as I can ping and run COAP CLI commands successfully with the OpenThread CLI sample. I can COAP GET and PUT to coap.me.

The coap.me IPv6 address was converted by me with the well known 64:ff9b::/96 prefix. The path was added to the border router as I can see with ot netdata show. 

The problem is with the COAP Client sample provided. I modified the destination IPv6 address to be the same I use with the CLI sample and the URI path to "coap://coap.me:5683/hello". I have also tried just "hello". No luck so far. 

As I said the CLI sample works fine: I get a response which is "world". Here the CLI commands I use after having joined the Thread network:

ot coap start

ot coap get 64:ff9b:0:0:0:0:8666:da12 hello 

NOTE: in my COAP client program the Thread network is joined automatically as I have added the following options:

CONFIG_OPENTHREAD_JOINER=y
CONFIG_OPENTHREAD_JOINER_AUTOSTART=y
CONFIG_OPENTHREAD_JOINER_PSKD="J01NME"

Indeed I can ping the Border router IPV6 address from my board running the modified COAP Client and vice-versa so they see each other. 

Can you please help to understand why my program directly derived from your COAP client sample does not work while CLI works fine?

Thank you.

Marco

Parents
  • Hi Marco,

    I still need to work on some issues with my OTBR.

    If your CLI command "ot coap get 64:ff9b:0:0:0:0:8666:da12 hello" works on your setup, you can test with the following coap client sample provided by our developer: GitHub - canisLupus1313/ot-sensor

    It basically send "hello" GET request to coap.me and prints out the reply "world". Please remember to modify the following configuration to join your OTBR-formed thread network.

    CONFIG_OPENTHREAD_NETWORKKEY="00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff"
    CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread-7cf7"
    CONFIG_OPENTHREAD_XPANID="3b:78:ce:62:9c:bc:8e:23"
    CONFIG_OPENTHREAD_PANID=31991

    Best regards,

    Charlie

  • Hi Charlie,

    yes the CLI command works fine. The sample code you provided does exactly what I am trying to do. It looks the same of my code but I am gonna try it out to see if that works in my environment.

    I'll let you know.

    Thanks.

Reply Children
No Data
Related