Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [leshan-dev] Should Leshan just be used for management or data collection?

Hi Andrew,

answers inline,

On 13 Oct 2018, at 23:05, Andrew Chiw <andrew.work0@xxxxxxxxx> wrote:

Yes, it's clearer, thanks Simon!

So basically, the REST API in leshan-server-demo can change anytime
and does not expose the full functionality of Leshan, therefore I
should not rely on it for any production code. I'm just making a proof
of concept, so I think I'll use it for the time being.

Since I'm very new to this IoT area, it isn't immediately obvious how
all these plug together. The README and Wiki say Leshan is a OMA LWM2M
implementation - but nginx, firefox and squid are all HTTP
implementations too, it doesn't tell me how to use them. An example
setup, how you expect the server and client to be used in real life,
would be the single most useful thing in Leshan's documentation for
many newbies like me.

For example, I still don't understand the idea of leshan-client,
because what IoT device runs Java? But maybe the whole of
leshan-client is just for demoing leshan-server…

that’s correct, it’s a demo application that utilises the Java library from Leshan to connect to any LWM2M server. It can be Leshan or some other, such as Wakaama [1]. In fact Wakaama, similar to Leshan, provides a library written in C to connect to a LWM2M server.

That said, you can have a look at the two popular embedded operating systems Zephyr [2] and Contiki-ng [3] where they provide LWM2M support and can be installed in a variety of embedded hardware devices. Check here [4] for Zephyr and here [5] for contiki-ng regarding LWM2M support. Have used them both and they work perfectly fine with a Leshan server.

Hope that helps,
Christos

[1] https://github.com/eclipse/wakaama



Kind Regards,
The Chiwbaka
https://chiwbaka.com

On Thu, Oct 11, 2018 at 12:12 PM Simon Bernard <contact@xxxxxxxxxxxxxxx> wrote:

I will try to be clearer !
(I need to change the F.A.Q. too because it seems this is really not
clear for a lot of people ... :/)

leshan-server-demo is a demo ! If you are just playing with LWM2M or
experiment some stuffs, it's ok to call REST API.

If you plan to develop a real piece of software (like a production ready
server or a test framework), I really doubt that's a good idea. You
should rather use the leshan-server-cf library and use it to code your
own server.
You could look at
https://github.com/eclipse/leshan/wiki/Getting-Started-:-Server.
You could also look at the code of leshan-server-demo to see how to use
Leshan API but you should not  use it directly.

Lots of libraries do that. E.g. openssl or gnutls provide command line
tools, there are just toy which expose some feature of the real library.

I hope this is clearer.

Simon

Le 10/10/2018 à 19:22, Andrew Chiw a écrit :
Do you mean the Leshan REST API provided at
http://localhost:8080/client/api/? That seems perfect for pulling data
from Leshan, but the Wiki FAQ says you're not supposed to use it. But
it also doesn't say what else one is supposed to do. Is one supposed
to write their own Java class that provides such an API?
https://github.com/eclipse/leshan/wiki/F.A.Q.

The REST API seems like the only option to get data out from Leshan,
though. Meanwhile, it seems other people playing with Leshan are also
basing their work on it:
http://robertsrhapsody.blogspot.com/2018/01/eclipse-leshan-rest-apis.html


Kind Regards,
The Chiwbaka
https://chiwbaka.com
On Wed, Oct 10, 2018 at 4:17 PM Simon Bernard <contact@xxxxxxxxxxxxxxx> wrote:
Registration is a kind of session object, I suppose you don't want to
store you data in this session object.

About persisting device data, you should just use the send API of
LeshanServer, get the response and then store it as you want.
You will probably store the data by "device endpoint" and you will
probably don't want to delete data when device deregister. This would be
like if you delete all user data of web app when user logout.

Le 10/10/2018 à 15:19, Andrew Chiw a écrit :
Thanks a lot Simon.
If Leshan only handles device registration, should I write something
external to actually get the data from the devices? But then
connecting the data received from the registrations that Leshan
received would be a pain.
If Leshan is a library, can it forward the responses from the devices
into a flat file/DB/some interprocess API, or do I have to write that
too?

Kind Regards,
The Chiwbaka
https://chiwbaka.com

On Wed, Oct 10, 2018 at 2:51 PM Simon Bernard <contact@xxxxxxxxxxxxxxx> wrote:
Hi,

     Leshan server does not store data read on devices.

     It stores data like registration but not responses of requests.

     You could see it like and http library which will store the session,
allow you to send request and receive response. Up to you do to what you
want with this data like storing it in a file or DB.

Simon

Le 10/10/2018 à 00:29, Andrew Chiw a écrit :
Hi everybody,
I'm looking at Leshan as a solution to manage data collection from IoT
devices. It's great because I can see it subscribing to data from a
device.

But is Leshan meant to be used like that? To collect, manage the data
within Leshan would mean modifying it a lot. Isn't it perhaps better
design to simply use Leshan to collect the data, dump it out into a
SQL DB or a flat file for some other backend to process?

How did you intend Leshan to be used in this case?

Kind Regards,
Andrew Chiw
https://chiwbaka.com
_______________________________________________
leshan-dev mailing list
leshan-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/leshan-dev
_______________________________________________
leshan-dev mailing list
leshan-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/leshan-dev


Back to the top