-
Notifications
You must be signed in to change notification settings - Fork 407
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
How to handle SEND messages from a device whose IP may change #1544
Comments
Firstly, if you device is an IP changing environment it should use Queue Mode. After its absent/sleeping period it should start the communication by an UPDATE. See for more details : https://github.com/eclipse-leshan/leshan/wiki/LWM2M-Devices-with-Dynamic-IP If it does not behave like this. It doesn't respect the specification and so you will face some interoperability issue. Now if you don't care about interoperability (which is generally not a good idea)
Let me know if this works for you. About reusing demo : |
Hi sbernard31, thanks for your reply. I've tried the second approach and when I try to simulate it (using the leshan-client-demo but changing the update to every 2 hours) the server returns a 400 (no registration found). The only changes I've made to the actual code is that inside the leshanServerDemo I've added both builder.setUpdateRegistrationOnSend(true) and builder.setUpdateRegistrationOnNotification(true). To simulate a device changing its IP address, I've done the following
Also this behaviour happens with the real device, and the server returns the same (BAD_REQUEST(400)]: no registration found. Thank you very much |
I'm not sure I get you. But I understand that when you are using : My guess you are not using CoAP over DTLS but just CoAP. In that case there is no way for the server to know from who came the Send Request. In other words, this works only with protocol with authentication like |
Thank you very very much sbernard31, now I totally understand what is happening. We'll try to see if we can start using Coap over DTLS. |
You're welcome 😉. I reopen this issue, just to remember to update javadoc and maybe wiki page. |
I adapt the wiki page about it : https://github.com/eclipse-leshan/leshan/wiki/LWM2M-Devices-with-Dynamic-IP and also adapt javadoc in commit 4614ebb. |
We can close this issue now 🙂 |
Question
Hello everyone,
We are using a leshan server demo connected to a redis store database, currently the M13 release. The devices we are supporting can change it's IP address and we are using as a workaround the already existing solution to update the registration on every observation so this issue is resolved.
However, the device doesn't send an UPDATE message periodically and performs the send according to the frequency time that we set, but as the IP of the device may change, when the device publishes the message we can't detect it because the SendHandler tries to verify the message from an incoming IP address and not from the REGID (as it is done inside the ObservationHandler). Is it possible to handle the incoming SEND messages using this field? I'm really sorry if the question sounds a bit newbie, but I'm kind of a beginner in this area and as far as my knowledge and the tests I've done, I can't see how I can change the code to support this (or even if it's possible).
Thank you very much.
The text was updated successfully, but these errors were encountered: