how can i send a 100 or 500 bytes Payload from nRF9160 to Leshan server?

Hello,

i had a look at lwm2m_client_sample and it worked pretty well. Now my next step is to be able to send for example a 100 or 500 Bytes Payload from nRf9160 to Leshan server.

Since i am a new comer, i don't really know how to go about it.

Questions:

1. Is it possible in the first place to be able to send payload data to leshan server?

2. When yes. How can i go about it? 

3. When no. Is there any alternative of sending payload data using lwm2m?

I will be glad, if someone could help me.

best regards

Cedric

  • I will really appreciate if you can help me with this issue

  • At the moment, it is not possible to send something from the client without the server either reading or observing the resource.

    However, once the server has started to observe a resource, the device can send updates without the server sending something for each time.

    Is there a reason observing a resource isn't good enough?

  • Thanks for your reply.

    Observing is not good enough because it is server initiated. My goal it is to send something from the client to server without the server reading or observing th resource (client initiated). That means the client just sends data and then enters a Power saving mode(PSM). 

    And in this mode the client is not accessible, for the server to proceed a reading or observing of the resources.

    When the client wakes up from PSM, it sends data again and the cycle continues. In this way i will be able to serve battery energy. Another reason is, it will not have to wait for the server to start reading or observing.

    Do you have any suggestions on how i may do this, may be using a broker as intermediate station? Any suggestions will be welcome.

    Best regards

  • ced27 said:
    Observing is not good enough because it is server initiated. My goal it is to send something from the client to server without the server reading or observing th resource (client initiated). That means the client just sends data and then enters a Power saving mode(PSM). 

    I still don't quite understand why observing doesn't fit your use case here. Except for the initial setup, everything is initiated from the client. Or doesn't the client register with the LwM2M server at all?

    If that is the case, is LwM2M really the best fit for your usecase over a pure CoAP or UDP server?

    ced27 said:
    Another reason is, it will not have to wait for the server to start reading or observing.

    This is true, but how fast after the device is online do you need to push updates? I am not convinced that this small initial delay is a big issue.

    The server should not need to observe the resource again after the device comes out of PSM.

    Anyway, I'll stop arguing now. You probably know your use case better than me Slight smile

    Currently observing the the closest you get in Zephyr's LwM2M client. LwM2M 1.1 introduces a "Send operation", which would fit your requirement, but it hasn't been implemented in Zephyr yet.

    Another option would be to not use LwM2M (at least for these updates), and just send a plain UDP/CoAP message to a listening socket on the server.

  • Thanks for your support, i really appreciate.

    I still don't quite understand why observing doesn't fit your use case here. Except for the initial setup, everything is initiated from the client. Or doesn't the client register with the LwM2M server at all?

    If that is the case, is LwM2M really the best fit for your usecase over a pure CoAP or UDP server?

    The client does register with the server and all the client does, is providing resouces of the objects for the server to either read or observe the resources. Meaning the client doesn't really sends something, it just provides something.

    This is true, but how fast after the device is online do you need to push updates?

    For my use case, all i want is to send data from client to server without pushing any updates from the server side. Meaning the server only receives data and then does nothing.

    Another option would be to not use LwM2M (at least for these updates), and just send a plain UDP/CoAP message to a listening socket on the server.

    Can you please tell me how i may do that?

    Thank in avance.

Related