Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » OM2M » How to connect a sensor node to om2m using http?
How to connect a sensor node to om2m using http? [message #1776281] Tue, 14 November 2017 23:26 Go to next message
Umar Farooq is currently offline Umar FarooqFriend
Messages: 11
Registered: October 2017
Junior Member
Hi,

I have om2m installed on my laptop and the IN and MN are setup on it as well.
What i have been struggling for the past weeks is how to connect sensor node (weather it be a pi or arduino) to my MN and IN using http? I have one sensor (ultrasonic sensor) setup on my raspberry pi but i dont know how to send http communication to om2m?

Can anyone guide me on it?

Best Regards,
Umar Farooq
Re: How to connect a sensor node to om2m using http? [message #1776318 is a reply to message #1776281] Wed, 15 November 2017 09:46 Go to previous messageGo to next message
Dorian Kurzaj is currently offline Dorian KurzajFriend
Messages: 16
Registered: May 2016
Junior Member
Hello,

I don't how the data of the sensor is retrieved on the raspberry pi, but once you have it you can send it to OM2M using its REST API : https://wiki.eclipse.org/OM2M/one/REST_API. To use the REST API you can, for example, perform the HTTP requests using a little Python program with this HTTP library : http://python-requests.org.
Hope it might help you.

Best regards,
Dorian Kurzaj

[Updated on: Wed, 15 November 2017 09:49]

Report message to a moderator

Re: How to connect a sensor node to om2m using http? [message #1776651 is a reply to message #1776318] Mon, 20 November 2017 02:36 Go to previous messageGo to next message
Umar Farooq is currently offline Umar FarooqFriend
Messages: 11
Registered: October 2017
Junior Member
Thanks a lot Dorian!! that link was really helpful!

One more question: I think the max content instances is a 1000 if the default config files are used. Is there a way to delete them once the data is sent to the server?

Regards,
Umar Farooq
Re: How to connect a sensor node to om2m using http? [message #1776682 is a reply to message #1776651] Mon, 20 November 2017 10:49 Go to previous message
Dorian Kurzaj is currently offline Dorian KurzajFriend
Messages: 16
Registered: May 2016
Junior Member
Glad to hear it helped you! :)

Well, as far as I know, I think when you have reached this limit, the oldest data is automatically deleted and the new data can be registered in OM2M. Otherwise, you can delete the data you don't want anymore by yourself. You just have to execute a DELETE HTTP request on this resource.

e.g.:
URL 	http://127.0.0.1:8080/~/mn-cse/mn-name/MY_SENSOR/DATA/cin_12345
Method 	DELETE
Header 	X-M2M-Origin : admin:admin


This request should delete the Content Instance : cin_12345 of the device MY_SENSOR registered on mn-cse. So you can run this kind of request when you need to.

Regards,
Dorian Kurzaj

[Updated on: Mon, 20 November 2017 10:55]

Report message to a moderator

Previous Topic:Is streaming camera video possible in OM2M?
Next Topic:Device Management with LwM2M
Goto Forum:
  


Current Time: Mon Oct 07 02:20:43 GMT 2024

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

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

Back to the top