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?

Answer inline,

Le 13/10/2018 à 22:05, Andrew Chiw a écrit :
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.
It sounds reasonable. Hoping that POC will not be promoted in prototype and then go in production :D.
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, 
The README says :

"Leshan provides libraries which help people to develop their own Lightweight M2M server and client.
The project also provides a client, a server and a bootstrap server demonstration as an example of the Leshan API and for testing purpose."

And the first page of the wiki say :

"Eclipse Leshan™ is an OMA Lightweight M2M server and client Java implementation.
This is a not standalone server and client but a set of java libraries which help people to develop their own Lightweight M2M server and client. The project also provides a client, a server and a bootstrap server demonstration as an example of the Leshan API and for testing purpose."

And we have a Getting started which show how to start to use the API.

To be honest, I don't know what we could do more :/

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.
What do you mean exactly ?
 For example, I still don't understand the idea of leshan-client,
 because what IoT device runs Java? But maybe the whole ofleshan-client
 is just for demoing leshan-server...

Leshan-client is just a library to help someone to implement a LWM2M client in Java. Is it relevant to use Java for IoT device, I don't know...  some people think it's ok especially for Gateway.

but there is other real use cases where using java could be useful :
- to implements simulators.
- to implements Junit tests.
- to create a command line tool.
- To use it on android[1].

[1] https://github.com/eclipse/leshan/issues/573

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

Back to the top