edgexfoundry / device-coap-c

EdgeX device service for CoAP-based REST protocol
Apache License 2.0
3 stars 18 forks source link

Coap-client doesn't receives data #39

Open rosemgo opened 2 years ago

rosemgo commented 2 years ago

I keep the issue open here: https://github.com/edgexfoundry/edgex-compose/issues/252#issuecomment-1153966946

I want to use device-coap in edge x and I used containers. I have a problem when I try to send data to edgex with the command: coap-client -m post -t 0 -e 1001 coap://127.0.0.1/a1r/d1/int I receive the message: WARN coap_network_read: unreachable.

If instead you execute the commands: coap-client-notls -m post -t 0 -e 1001 coap://127.0.0.1:5684/a1r/d1/int I do not receive any error message but neither the data that the d2 device inside the edgex should send. Thank you

EdgeXFoundry Jakarta 2.2

lenny-goodell commented 2 years ago

@rosemgo , please be aware that 127.0.01 (localhost) is the container, not the host system. Never use localhost from within a container. You must use the actual IP address of the host system if you are expecting to address it from the container.

rosemgo commented 2 years ago

I have this problem:

terminale coap client

I want to send data from the linux terminal with the 'coap-client POST' command to the edgeX internal device called d2. I don't understand why it doesn't send data to edgeX.

d2 EdgeX

The device-coap service is active:

servizio ping coap