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?

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