Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » OM2M » reel sensor discovery on the beagleboard/raspberry pi(How to push the date from the sensor to the gateway)
reel sensor discovery on the beagleboard/raspberry pi [message #1749207] Sat, 03 December 2016 05:09 Go to next message
Cyril FOTSO is currently offline Cyril FOTSOFriend
Messages: 8
Registered: December 2016
Junior Member
Hi,
I have install the gateway on my raspberry pi, and on this raspberry pi, i have many sensor working, i have some python code that display sensor values, but i'm not able to retreive they data to my OM2M gateway, please can you show step by step a quick sample. on how to establish communication betwwen the sensor and my gateway, or recommand me a good framework to do that ?

Thks in advance
@Cyril
Re: reel sensor discovery on the beagleboard/raspberry pi [message #1749788 is a reply to message #1749207] Mon, 12 December 2016 10:13 Go to previous messageGo to next message
Guillaume Garzone is currently offline Guillaume GarzoneFriend
Messages: 54
Registered: April 2015
Member
Hi Cyril,

I think there are different ways to make this communication between the gateway and your existing python client.
One way is to integrate an HTTP / CoAP client in your python app to push the data through the REST API of OM2M (usin oneM2M standard). This way can ensure you the portability of your client and you could change easily where you want to store your data (gateway or server for instance).
You can get inspiration from these tutos to understand how to push data through the REST API:
REST API
Develop oneM2M app

Another way would be to add a new plugin to OM2M and interact directly in Java with the platform but you would have to make the communication between the Java (OSGi bundle) process and your python app.

Hope this helps,
Guillaume
Re: reel sensor discovery on the beagleboard/raspberry pi [message #1750071 is a reply to message #1749788] Thu, 15 December 2016 17:35 Go to previous messageGo to next message
Cyril FOTSO is currently offline Cyril FOTSOFriend
Messages: 8
Registered: December 2016
Junior Member
Thank you Guillaume,
i've been able to create a TEMPERATURE sensor APP on my server (not possible on the gateway) and the main problem is that, when i try to update the sensor value using a POST request, it's not working, i think i'm not wel retargeting the good container or the sensor has been not well created,
Find attached my screen capture of the temperature sensor,
then i use POSTMAN to try to update/retrive the sensor value , (not working)
When i copy the same datacreation code, it jus create another container instance and store the value inside it, but me i jus want to be able the update the sensor value, and also get it directly, using the GetValue buton.

So please, if you could send me a tutorial on how to POST data to update a sensor value
and how to retrieve a sensor value also, using GET request, with clear URL, Clear Body,

Please,
Re: reel sensor discovery on the beagleboard/raspberry pi [message #1750072 is a reply to message #1750071] Thu, 15 December 2016 17:39 Go to previous messageGo to next message
Cyril FOTSO is currently offline Cyril FOTSOFriend
Messages: 8
Registered: December 2016
Junior Member
In addition,
i will like to say that i have already set up my Python code, on the Raspberry Pi, that will send the sensor value using POST or CoAP client,
i jus need this last part to finish the full test of OM2M framework and do a tutorial on it.

Thank's in advance.
Re: reel sensor discovery on the beagleboard/raspberry pi [message #1750143 is a reply to message #1749788] Fri, 16 December 2016 11:07 Go to previous messageGo to next message
Cyril FOTSO is currently offline Cyril FOTSOFriend
Messages: 8
Registered: December 2016
Junior Member
Hello,
i've been able to find and understant how to post data, but façing some issue when trying to update / container instance of my sensor applacation,
when i POST the XML data, i get this message : " 409 Conflict Name already present in the parent collection. " ,


Here is my XML content :


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onem2m.org/xml/protocols CDT-cin-v1_0_0.xsd" rn="cin">
<cnf>text/plain:0</cnf>
<con>24.437</con>
</m2m:cin>



If some one can give me the good xml query content to update a container instance
Re: reel sensor discovery on the beagleboard/raspberry pi [message #1750243 is a reply to message #1750143] Mon, 19 December 2016 09:29 Go to previous message
Guillaume Garzone is currently offline Guillaume GarzoneFriend
Messages: 54
Registered: April 2015
Member
Hi Cyril,
BE careful when you post your new instance of data you specify a resource name (rn) in the payload. However this name should be unique regarding to all the content instances in the same container. This is why you get this error because you try to create multiple content instances with the same name. You can just not specify any name and the platform will generate a unique one.
Link to this topic also regarding the update of content instance: https://www.eclipse.org/forums/index.php/t/1083202/
Previous Topic:how to run OM2M Application from tutorial & what is the difference between application and plugi
Next Topic:Security in OM2M release1
Goto Forum:
  


Current Time: Sat Oct 12 09:56:11 GMT 2024

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

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

Back to the top