Skip to main content



      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 18:26 Go to next message
Eclipse UserFriend
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 04:46 Go to previous messageGo to next message
Eclipse UserFriend
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 04:49] by Moderator

Re: How to connect a sensor node to om2m using http? [message #1776651 is a reply to message #1776318] Sun, 19 November 2017 21:36 Go to previous messageGo to next message
Eclipse UserFriend
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 05:49 Go to previous message
Eclipse UserFriend
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 05:55] by Moderator

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


Current Time: Sun Jul 13 23:35:08 EDT 2025

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

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

Back to the top