0
votes

I have succesfully built the CoAP protocol example for ARM mbed (https://developer.mbed.org/teams/sandbox/code/coap-example/file/0681e205d0e9/) on a K64F board. It comes out of the box, except for the server name (coap.me) changed to an internal IP address.

I see that it runs correctly and connects to the network:

[EasyConnect] Using Ethernet
[EasyConnect] Connected to Network successfully
[EasyConnect] IP address 192.168.1.15
[EasyConnect] MAC address 0e:43:54:d9:7c:71
Connected to the network. Opening a socket...
Calculated message length: 11 bytes
Starting server
Sent 11 bytes to coap://192.168.1.10:5683

I have set a computer that can connect to it. It can ping correctly to the board and I see that the ARP is negotiating with the correct MAC address.

I have launched an NMAP test and I see that the port is closed:

PORT     STATE     SERVICE
5683/udp closed    unknown

If I set a CoAP client in the computer (Copper) I see no connection in the terminal.

What I am missing?

1
Where does the message gets lost? The computer does not receive the request, or the board does not receive the response? coap-example is only tested with device -> server -> device, not server -> device -> server...Jan Jongboom
Board -> Computer message arrives (I have no server on it but tcpdump sees it)jordi
Computer -> Board message is not received. (I see no trace on the terminal)jordi
Yeah, I think for UDP calling bind() and then having a recvfrom hook is enough...Jan Jongboom
It works. I am on the next problem now.jordi

1 Answers

1
votes

Moving this to the answer section as well, in case someone else runs into this problem.

If you want to use an mbed OS 5 device as a UDP server, make sure to call .bind() on the socket.