CoAP between two ESP 32

preetam
Posts: 49
Joined: Thu Jan 26, 2017 2:31 pm
Location: Germany

CoAP between two ESP 32

Postby preetam » Tue Feb 07, 2017 8:07 pm

Hi,

Has anyone tried to use CoAP protocol between two ESP 32. Any lead would be helpful

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: CoAP between two ESP 32

Postby ESP_Angus » Tue Feb 07, 2017 11:15 pm

Hi Preetam,

You can find CoAP client and server examples here:
https://github.com/espressif/esp-idf/tr ... /protocols

Angus

prateek1069
Posts: 6
Joined: Wed Oct 04, 2017 10:54 pm

Re: CoAP between two ESP 32

Postby prateek1069 » Wed Oct 04, 2017 11:06 pm

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.
Attachments
coap_experiment_problem.PNG
Coap experiment using two esp32. Screenshot show two terminal : one each of client and server
coap_experiment_problem.PNG (132.89 KiB) Viewed 14167 times

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: CoAP between two ESP 32

Postby ESP_igrr » Fri Oct 06, 2017 8:01 am

Looks like the boards have not connected to WiFi AP. Have you set the AP SSID/password in `make menuconfig > Example Configuration` correctly?

prateek1069
Posts: 6
Joined: Wed Oct 04, 2017 10:54 pm

Re: CoAP between two ESP 32

Postby prateek1069 » Sat Oct 14, 2017 7:29 am

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.
Attachments
target_uri.PNG
target_uri.PNG (101.98 KiB) Viewed 14071 times
coap_experiment_problem.PNG
coap_experiment_problem.PNG (97.88 KiB) Viewed 14071 times

prateek1069
Posts: 6
Joined: Wed Oct 04, 2017 10:54 pm

Re: CoAP between two ESP 32

Postby prateek1069 » Thu Oct 26, 2017 8:32 pm

I would appreciate any help :)

User avatar
gunar.kroeger
Posts: 143
Joined: Fri Jul 27, 2018 6:48 pm

Re: CoAP between two ESP 32

Postby gunar.kroeger » Thu Oct 24, 2019 5:36 pm

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

"Running was invented in 1612 by Thomas Running when he tried to walk twice at the same time."

User avatar
gunar.kroeger
Posts: 143
Joined: Fri Jul 27, 2018 6:48 pm

Re: CoAP between two ESP 32

Postby gunar.kroeger » Thu Oct 24, 2019 7:19 pm

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
"Running was invented in 1612 by Thomas Running when he tried to walk twice at the same time."

User avatar
gunar.kroeger
Posts: 143
Joined: Fri Jul 27, 2018 6:48 pm

Re: CoAP between two ESP 32

Postby gunar.kroeger » Thu Oct 24, 2019 8:38 pm

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?
"Running was invented in 1612 by Thomas Running when he tried to walk twice at the same time."

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 111 guests