-
Notifications
You must be signed in to change notification settings - Fork 424
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
sending a coap request to an unreachable server: missing notification? #249
Comments
And on a similar note: If I send a request to a server using an old/wrong IP address, I see multiple times in the logs I do note a number of lines containing |
Do you have a NACK handler defined by coap_register_nack_handler()? For confirmable messages, I would expect this to be getting called in your first case, otherwise in all cases for your second case. |
I don't have this handler defined (and I noticed some other handlers that might me interesting as well!). |
I registered a However, in the second case (when using an invalid IP) I would expect a callback when The log below is a log using
The log below is a log using
|
In your first case, encryption has been set up and then you drop the traffic. In the second case, encryption has not been agreed between client and server - so a NACK is not so appropriate here. Tinydtls is a separate project - libcoap is just using it for one of the DTLS type options, and so changes in the tinydtls code will not be integrated into libcoap. The only possibility is changes to src/coap_tinydtls.c - the glue between libcoap and tinydtls. The coap-client is setting a global timeout of 90 seconds - which when expired closes the session and triggers the NACK. With PR #183 has many event/nack fixes, and it looks like this may already fix the issue you are highlighting. |
Is it correct that this PR #183 is not yet merged to the develop branch (I'm no git expert at all)? If so, when do you expect that this merge will happen? I certainly prefer using your lib to modifying coap_tinydtls.c myself. |
Yes we are waiting on PR #183 to get merged in. In terms of when, not sure, but would expect it to be soon. based on https://sourceforge.net/p/libcoap/mailman/message/36346758/ last update. |
As PR #183 has been merged, can you check if this has solved this issue? |
Current status with the latest 4.2.0 prerelease:
|
|
Thanks a lot for your input (again!) Marc |
As a test case, I want to send a coap request to an unreachable server.
Precondition: my coap client app is started up correctly and I've been able to toggle the (Ikea) light on and off a few times.
Next, I unplug the network cable from the Ikea hub and try to toggle the light again.
I notice that the packet is retransmitted 4 times (as expected I guess) and afterwards, I see in the logs
tid=44815: give up after 4 attempts
However, there seems to be no notification/callback to the coap-client, right?
What would be the best way to get this information ? an extra call to coap_handle_event where the "give up" mesage is logged?
Edit: I just noted that the comment before
coap_event_t
statesThanks in advance,
Marc
The text was updated successfully, but these errors were encountered: