-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tokens missing in response #25
Comments
Hi @Extropy , |
Any update on this issue? I ran into the same problem. Also Node.js with node-coap keeps retrying to send. |
Apologies, I don't bring any solution to the (potentially) core problem. I also found aiocoap to be problematic when developing on an ESP32 as a coap server. I ended up having better luck interfacing with the server using the trusty libcoap client ( It isn't perfect as I no longer have access to this hardware, but a nice starting point for python might be scottzach1/CoapTesting (apologies yes self-promotion 😅). |
Hi guys, I check the aiocoap(0.4.1, on Mac python3), simple coap lib(1.3.22: latest) on ESP32 with aiocoap sample time server works well. so I don't find problem... Anyway, if guys have something problem, please reports with your source code. Thank you. |
I ran into an issue using this library running on an ESP32, talking to a host application in Python using aiocoap. I am just starting with COAP, so I might be missing something, but I was able to fix it as follows:
Problem: aiocoap would keep sending a message and a reset because it could not associate the response from the ESP32 with a message it had sent. For my application, including the (packet.tokens, packet.tokenlen) in the call to sendResponse fixed the issue, but when the Python script requested an endpoint that I did not have on the ESP32 side, the problem persisted.
Suspected cause: aiocoap using tokens in a way not compatible with CoAP-simple
Work around/fix: I changed line 287/288 of coap-simple.cpp to read:
sendResponse(_udp->remoteIP(), _udp->remotePort(), packet.messageid, NULL, 0,COAP_NOT_FOUNT, COAP_NONE, packet.token, packet.tokenlen);
This way, when an unknown URI is requested, the response just also includes any tokens sent.This fixed the problem. This did not happen when using Linux coap-client.
The text was updated successfully, but these errors were encountered: