Skip to content
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 collect and send gateway object including the IoT Device Objects resource #1660

Open
kipusoep opened this issue Oct 18, 2024 · 9 comments
Labels
client Impact LWM2M client demo Impact our demo (not libraries) enhancement Improvement of existing features

Comments

@kipusoep
Copy link

Question

Small question I guess; using the Leshan client, how can I make sure the IoT Device Objects resource (3) of the Gateway object (25) is present and filled?

@kipusoep kipusoep added the question Any question about leshan label Oct 18, 2024
@sbernard31
Copy link
Contributor

I'm not sure I get the question.

Could you give me some context ? What are you trying to achieve ?

@kipusoep
Copy link
Author

I try to send the object 25 to my lwm2m server, but it doesn't include resource 3 of object 25 (IoT Device Objects).
It only includes resource 0 and 1.

@sbernard31
Copy link
Contributor

Ok so you want to use Leshan Client to simulate a LWM2M Gateway ?

But are you coding your own client using Leshan library OR you are just playing with leshan-client-demo ?

@kipusoep
Copy link
Author

Yes exactly, with the leshan cliënt demo.

@sbernard31
Copy link
Contributor

sbernard31 commented Oct 18, 2024

Ok you launch your leshan-client-demo then use command create 25, then you see the object but the resource 3 is empty ?

leshan-client-demo does NOT really implement object 25.
When you call create 25, it will just create a dummy object with some random value depending of the type of the resource.
See : https://github.com/eclipse-leshan/leshan/wiki/Adding-new-objects#leshan-client-demo (this is documentation about v1.x but this is still mainly true for 2.x)

You can have a look at the DummyInstanceEnabler.

It seems for this multiresource corelink resource currently leshan demo doesn't provide any default resource ..
We can try to generate a random value for corelink resource if needed ? but keep in mind this is just a dummy object.

@kipusoep
Copy link
Author

kipusoep commented Oct 18, 2024

I was just wondering if it was possible to set it somehow. No need to do any code changes 😏
I think I can manipulate the payload server side to populate the resource.

@sbernard31
Copy link
Contributor

I think I can manipulate the payload server side to populate the resource.

I'm not sure what you have in mind but this is about sending a WRITE request from LWM2M server to Client. It seems this will not be possible because resource /25/?/3 is Read only.

See : https://github.com/OpenMobileAlliance/lwm2m-registry/blob/76aaf5becb46daf1acd859fb45ef50c005eb6da4/25.xml#L90-L99

No need to do any code changes

Currently we generate value for all type except coreLink resource, so it could make sense to me to change it.
There is also an option in client demo :

      -fb, --factory-bootstrap=<LwM2mPath=String>[,<LwM2mPath=String>...]
                             Can be used to initialize existing resource with
                               custom value.
                             LWM2M Text Content format encoding should be used
                               for resource value
                             E.g. to change Short Server ID :
                              -fb /0/0/10=1234,/1/0/0=1234

This allow to initialize client with custom value.
But for now this doesn't enable new object automatically maybe this could be modify to allow that 🤔

Let me know if one of those changes could fit your need ?

@kipusoep
Copy link
Author

No I needed to send the gateway object to my lwm2m server, not from the server to the client :-)
I already managed to manipulate the sample message from the demo client to my needs, so as far as I'm concerned this can be closed.

@sbernard31 sbernard31 added client Impact LWM2M client demo Impact our demo (not libraries) enhancement Improvement of existing features and removed question Any question about leshan labels Oct 23, 2024
@sbernard31
Copy link
Contributor

Note that Leshan doesn't really support the Gateway use case, so you could face some limitation at some point.

so as far as I'm concerned this can be closed.

Ok I will let this open as possible enhancement for client demo.
But I will not work on this now, as I understand you don't really need that improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Impact LWM2M client demo Impact our demo (not libraries) enhancement Improvement of existing features
Projects
None yet
Development

No branches or pull requests

2 participants