Trying CoAP Request with gcoap example

Hi all.

I’m using gcoap example in a nRF52840 DK board and my purpose is to make a request to that board from my PC using

coap-client-gnutls coap://[2001:db8:2:0:d8c9:942f:47:4827]:5683/riot/board

Where /riot/board is one of the resources that gcoap has by default if I’m not mistaken.

To do so, I have a Dongle as Border Router (gnrc_border_router) and, thanks to it, I have achieved to have ping between my Linux host and the board. In fact, I have ping among all 3 components in any direction.

However, when I try from a Linux terminal that CoAP Request, where 2001:db8:2:0:d8c9:942f:47:4827 is the global IPv6 address from the DK board, the terminal waits some seconds and then the process ends. I have added a

printf("Request received for /riot/board\n");

In static ssize_t _riot_board_handler function from server.c, so I have some kind of debug, but nothing is written on the board RIOT terminal.

I would appreciate if anyone has clues in order to complete this issue. Thanks in advance!

Can you ping that address from your Linux host?

ping 2001:db8:2:0:d8c9:942f:47:4827

You can also check how your Linux machine tries to route traffic to that host

ip route get 2001:db8:2:0:d8c9:942f:47:4827

Hi Benpicco. Thanks for reading.

Yes, that ping works and the traffic route seems ok:

ip -6 route show 2001:db8:2::/64
2001:db8:2::/64 via 2001:db8:1::2 dev enxa6e91023eea6 metric 1024 pref medium

Where 2001:db8:1::2 is the global address from the Border Router in the wired interface. enxa6e91023eea6 global address in my PC is 2001:db8:1::1.

I’ll update my answer once I execute your command.

From ip route get 2001:db8:2:0:d8c0:942f:47:4827 I have:

2001:db8:2:0:d8c0:942f:47:4827 from :: via 2001:db8:1::2 dev enxa6e91023eea6 src 2001:db8:1::1 metric 1024 pref medium

Surprisingly, updating to libcoap-3 made it work!