CANDY-LINE / node-red-contrib-lwm2m

Step-by-step tutorial is available at
http://candy-line.tumblr.com/post/166976363228/oma-lwm2m-node-red-node
Apache License 2.0
7 stars 3 forks source link

Question: How to trigger "LwM2M Client Out" node to send Register / Deregister request? #15

Closed djDuff closed 5 years ago

djDuff commented 5 years ago

Dear @dbaba san, I am trying to prepare end-to-end scenario, where device registers on LwM2M Server, sends measurements, then de-register.

How can I trigger LwM2M Client Out node to initiate registration? And how can I trigger Deregistration?

For example, what should I specify in Inject node (connected to Client Out Node), so when I Trigger Inject node, it will send some request towards LwM2M Client Out node, and it will start Registration on LwM2M Gateway? Same for De-registration. As I understand, in current version, once Deployed, Client Out Node will start Registration, and will never De-register (until re-deployed) Could you explain, please, if it is possible?

dbaba commented 5 years ago

Thank you for the question. Here is the description regarding Registration/De-registration behaviors performed by LwM2M nodes.

Register message will be issued on starting the Node-RED flow by the underlying lwm2m client process. The process then keeps issuing Registration message repeatedly to LwM2M Server with lifetime interval. You can change lifetime by sending Write command to /1/0/1(Lifetime resource in Server object).

De-register message will be sent only when the client process exiting, which is caused by stopping Node-RED flow in order to re-deploy it or to terminate the Node-RED process.

So both Registration and De-registration operations are currently out of LwM2M nodes control.

Could you please tell me why you'd like to send register/de-register messages by your Node-RED flow?

djDuff commented 5 years ago

I am capturing the traces with DTLS enabled. To decode it in Wireshark, the trace should have client register messages - then it would decode DTLS. Otherwise, it won't be able to decode. So I have to re-deploy every time I need to capture trace. I thought there is simplier way to do this. I have to re-deploy "full", "only modified nodes" doesnt work (client is not de-registered). But it is okay, thank you so much for clarification!