CoAP between two ESP 32
CoAP between two ESP 32
Hi,
Has anyone tried to use CoAP protocol between two ESP 32. Any lead would be helpful
Has anyone tried to use CoAP protocol between two ESP 32. Any lead would be helpful
Re: CoAP between two ESP 32
Hi Preetam,
You can find CoAP client and server examples here:
https://github.com/espressif/esp-idf/tr ... /protocols
Angus
You can find CoAP client and server examples here:
https://github.com/espressif/esp-idf/tr ... /protocols
Angus
-
- Posts: 6
- Joined: Wed Oct 04, 2017 10:54 pm
Re: CoAP between two ESP 32
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.
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 using two esp32. Screenshot show two terminal : one each of client and server
- coap_experiment_problem.PNG (132.89 KiB) Viewed 15396 times
Re: CoAP between two ESP 32
Looks like the boards have not connected to WiFi AP. Have you set the AP SSID/password in `make menuconfig > Example Configuration` correctly?
-
- Posts: 6
- Joined: Wed Oct 04, 2017 10:54 pm
Re: CoAP between two ESP 32
Sorry, wifi AP information was not correct. Thank you. I am new to ESP32, so making silly mistakes .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?
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 (101.98 KiB) Viewed 15300 times
-
- coap_experiment_problem.PNG (97.88 KiB) Viewed 15300 times
-
- Posts: 6
- Joined: Wed Oct 04, 2017 10:54 pm
Re: CoAP between two ESP 32
I would appreciate any help
- gunar.kroeger
- Posts: 143
- Joined: Fri Jul 27, 2018 6:48 pm
Re: CoAP between two ESP 32
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.
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."
- gunar.kroeger
- Posts: 143
- Joined: Fri Jul 27, 2018 6:48 pm
Re: CoAP between two ESP 32
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
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."
- gunar.kroeger
- Posts: 143
- Joined: Fri Jul 27, 2018 6:48 pm
Re: CoAP between two ESP 32
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?
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: No registered users and 94 guests