Page 1 of 1
CoAP between two ESP 32
Posted: Tue Feb 07, 2017 8:07 pm
by preetam
Hi,
Has anyone tried to use CoAP protocol between two ESP 32. Any lead would be helpful
Re: CoAP between two ESP 32
Posted: Tue Feb 07, 2017 11:15 pm
by ESP_Angus
Hi Preetam,
You can find CoAP client and server examples here:
https://github.com/espressif/esp-idf/tr ... /protocols
Angus
Re: CoAP between two ESP 32
Posted: Wed Oct 04, 2017 11:06 pm
by prateek1069
Hi,
Did you get the solution for your problem? If yes, can you please explain your experiment in detail here. I am trying the same coap experiment between two esp32, but it is not clear what to expect from coap_server and coap_client code. I have attached the screenshot of two terminal- one each for client and server terminal. The problem is that the 'client' is not printing/dispalying any data. I am not sure what to do next or how to be sure that it is running correctly.
Re: CoAP between two ESP 32
Posted: Fri Oct 06, 2017 8:01 am
by ESP_igrr
Looks like the boards have not connected to WiFi AP. Have you set the AP SSID/password in `make menuconfig > Example Configuration` correctly?
Re: CoAP between two ESP 32
Posted: Sat Oct 14, 2017 7:29 am
by prateek1069
ESP_igrr wrote:Looks like the boards have not connected to WiFi AP. Have you set the AP SSID/password in `make menuconfig > Example Configuration` correctly?
Sorry, wifi AP information was not correct. Thank you. I am new to ESP32, so making silly mistakes
.
However, what exactly should the "Target uri" be? I am using the syntax at client as 'coap://ip address(of server):port' in "make menuconfig --> example configuration"...For example coap://10.13.215.136:4629/ (see attached) but getting an error 'DNS lookup failed'. Am I doing anything wrong here? Pls help.
Re: CoAP between two ESP 32
Posted: Thu Oct 26, 2017 8:32 pm
by prateek1069
I would appreciate any help
Re: CoAP between two ESP 32
Posted: Thu Oct 24, 2019 5:36 pm
by gunar.kroeger
soo... what is the coap-client example supposed to do?
I ran the example from esp-idf-v3.3 using the coap://californium.eclipse.org url, but I get no response from the server.
Code: Select all
I (1583) wifi: pm start, type: 1
I (2693) event: sta ip: 192.168.0.117, mask: 255.255.255.0, gw: 192.168.0.254
I (2693) CoAP_client: Connected to AP
I (2703) CoAP_client: DNS lookup succeeded. IP=104.196.15.150
E (7893) CoAP_client: select timeout
E (12893) CoAP_client: select timeout
E (17893) CoAP_client: select timeout
E (22893) CoAP_client: select timeout
E (27893) CoAP_client: select timeout
E (32893) CoAP_client: select timeout
E (37893) CoAP_client: select timeout
E (42893) CoAP_client: select timeout
E (47893) CoAP_client: select timeout
E (52893) CoAP_client: select timeout
E (57893) CoAP_client: select timeout
E (62893) CoAP_client: select timeout
E (67893) CoAP_client: select timeout
E (72893) CoAP_client: select timeout
E (77893) CoAP_client: select timeout
E (82893) CoAP_client: select timeout
E (87893) CoAP_client: select timeout
E (92893) CoAP_client: select timeout
Re: CoAP between two ESP 32
Posted: Thu Oct 24, 2019 7:19 pm
by gunar.kroeger
I tested the CoAP server example and it worked fine using a java program to send the GET commands.
Next thing I did was trying to get an esp32 with the client example to connect to the esp32 with the server example.
The server shows that a GET command was indeed received, but either the response message is not correctly parsed on the client_example or it is never received.
any help would be appreciated
Re: CoAP between two ESP 32
Posted: Thu Oct 24, 2019 8:38 pm
by gunar.kroeger
Got it to work with 2 esp32. But not with coap://californium.eclipse.org
The message handler is called, but COAP_RESPONSE_CLASS(received->hdr->code) returns 4 instead of 2.
Does someone know what coap response class means and if that's what I should be getting from this URI?