Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse SmartHome » LightweightM2M / Leshan / IPSO(Implement LwM2m binding)
LightweightM2M / Leshan / IPSO [message #1713086] Fri, 30 October 2015 17:51 Go to next message
Mattias Tornblad is currently offline Mattias TornbladFriend
Messages: 6
Registered: October 2015
Junior Member
Hello,

I've been playing around a bit with launching the Leshan-server (https://projects.eclipse.org/projects/iot.leshan) inside Openhab2 to get lwm2m/IPSO objects into OpenHab! I've gotten so far that when a lwm2m client connects to the leshan server it is shown in the paperui inbox. My biggest issue right now before i continue is how i should map the lwm2m objects against the "thing" structure.

From: h_t_t_p://www.ipso-alliance.org/wp-content/media/draft-ipso-app-framework-04.pdf

An example design of a theoretical plug socket sensor, with two plugs
(index of 0 and 1) a button and a LED, along with temperature and CO2
sensors in CoRE Link Format. The following examples make use of this
resource design.
Quote:

</dev/mfg>;rt="ipso.dev.mfg",
</dev/ser>;rt="ipso.dev.ser",
</dev/mdl>;rt="ipso.dev.mod",
</pwr/0/w>;rt="ipso.pwr.w",
</pwr/0/kwh>;rt="ipso.pwr.kwh",
</pwr/0/rel>;rt="ipso.pwr.rel",
</pwr/1/w>;rt="ipso.pwr.w",
</pwr/1/kwh>;rt="ipso.pwr.kwh",
</pwr/1/rel>;rt="ipso.pwr.rel",
</gpio/btn/0>;rt="ipso.gpio.btn",
</lt/led0/on>;rt="ipso.lt.on",
</sen/temp>;rt="ucum.Cel";obs,
</sen/co2>;rt="ucum.ppm"

What would make most sense from the above sample, try to create one thing and add channels dynamically that maps to the above items, or to make one "thing" per sub device, ie 2 plug-things, 1 button-thing... etc, and in this case, is there a way to group them together?

If you think the dynamic channels is the way to go, how is this made? I tried to test that approach in the handle-class, but just ended up with errors.

//Mattias
Re: LightweightM2M / Leshan / IPSO [message #1713785 is a reply to message #1713086] Fri, 06 November 2015 16:07 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
Hi Mattias,

Sorry for taking so long to come back to you, but I've been traveling the past two weeks.
Leshan integration in Eclipse SmartHome sounds great - both being Eclipse IoT projects, it would be definitely nice to see them interact.

Things do not necessarily have to correspond to physical devices, they should rather be considered as a unit that can be discovered/added/removed/configured as one piece. So I think the right granularity would be to have one Thing for one lwm2m client.

Regarding dynamic channels, this should be possible by using the ThingBuilder class. You can add channels initially in the ThingHandlerFactory.createThing() method or later at any time within the BaseThingHandler by calling editThing().

If you want to group channels of a sub-device into channel groups (which might be helpful for structuring them), you would have to also maintain a ThingTypeProvider and keep this in sync with the constructed Things; this is necessary since the the channel group information is only meta-data that is not part of the Thing itself. This seems a bit awkward though, maybe we should think about adding a "group" property to the Channel interface to make this simpler.

Does this help?
Re: LightweightM2M / Leshan / IPSO [message #1713788 is a reply to message #1713785] Fri, 06 November 2015 16:12 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
Quote:
So I think the right granularity would be to have one Thing for one lwm2m client.


Hm, having read the ipso specs a bit, this was probably a bad suggestion. Assuming that the number of devices from an lwm2m client can also change at any time, the right mapping would be to have Thing = device after all - but then having the sub-devices grouped into channel groups (assuming there is no deeper hierarchy possible?).
Re: LightweightM2M / Leshan / IPSO [message #1715017 is a reply to message #1713788] Wed, 18 November 2015 14:09 Go to previous messageGo to next message
Mattias Tornblad is currently offline Mattias TornbladFriend
Messages: 6
Registered: October 2015
Junior Member
I am still on to this! Just ran out of time right now! Will probably pick it up again in the end of next week and think over your suggestions!
Re: LightweightM2M / Leshan / IPSO [message #1716014 is a reply to message #1715017] Mon, 30 November 2015 15:20 Go to previous messageGo to next message
Michael Tetteh is currently offline Michael TettehFriend
Messages: 32
Registered: September 2015
Member
@Mattias Tornblad
I could use your help. Is the way I can communicate with you
Re: LightweightM2M / Leshan / IPSO [message #1716582 is a reply to message #1716014] Sat, 05 December 2015 12:27 Go to previous messageGo to next message
Mattias Tornblad is currently offline Mattias TornbladFriend
Messages: 6
Registered: October 2015
Junior Member
Yes,

I've added a subscription to the topic so i won't miss any conversions! Pretty new to this also so not sure how much I can assist you, but if we have the same target it would be good to cooperate!

//Mattias
Re: LightweightM2M / Leshan / IPSO [message #1729549 is a reply to message #1713086] Fri, 15 April 2016 11:32 Go to previous messageGo to next message
David Graeff is currently offline David GraeffFriend
Messages: 17
Registered: April 2016
Junior Member
Could you share what you have so far?
Would be great if the development can happen in an open repository for this plugin, there seem to be enough interest.

How did you archive integrating leshan? I did quick and dirty experiments by copying the source code. A better way is to use the leshan OSGi bundle, I guess.

I've worked on the other side (lwm2m clients in c/c++) and my next step is the lwm2m server part for OH2.

Re: LightweightM2M / Leshan / IPSO [message #1741603 is a reply to message #1729549] Fri, 26 August 2016 09:01 Go to previous message
Abin Mathew Abraham is currently offline Abin Mathew AbrahamFriend
Messages: 11
Registered: August 2016
Junior Member
@DavidGraeff, have you tried Leshan OSGi bundle with openHAB?? Can you share a dummy implementation?? Thank You.
Previous Topic:Device configuration system
Next Topic:Combination of Eclipse Kura & Smarthome
Goto Forum:
  


Current Time: Fri Dec 27 01:09:51 GMT 2024

Powered by FUDForum. Page generated in 0.03724 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top