We use proprietary and third party´s cookies to improve your experience and our services, identifying your Internet Browsing preferences on our website; develop analytic activities and display advertising based on your preferences. If you keep browsing, you accept its use. You can get more information on our Cookie Policy
Cookies Policy
Ask Your Question
0

Raspberry Pi and Fiware

asked 2017-04-03 18:30:15 +0100

Edison gravatar image

Hi

I am a student and right now I am working in a researching project at my college. I am using a Raspberry Pi but I can't find information about how to connect Fiware and Raspberry, maybe I am not looking the right information.

Could you help me with that? Where can I find the right tool for my project?

Thanks in advance!

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2017-04-08 13:53:20 +0100

jmcantera gravatar image

updated 2017-04-08 13:57:05 +0100

hi,

As the Raspberry Pi is a device that can speak FIWARE NGSI directly, the easiest way would be to use a Python script to obtain the data coming from the Raspberry Pi Sensors and then use the NGSIv2 API to publish the data offered by the sensors connected to the Raspberry on a Orion Context Broker.

You can deploy your own Orion Context Broker instance, on your laptop, for instance using Docker

docker run fiware/orion

You can pre-create the entity you are going to use to store the sensor data, for instance:

POST /v2/entities

{ "id": "MyObservation-RaspberryPi-890", "type": "Observation" }

Then every time a new sensor measurement is obtained from the Raspberry Pi you can

POST /v2/entities/MyObservation-RaspberryPi-890/attrs

{ "temperature": { "value": 23.5 } }

You can get the temperature value by getting your entity data as follows:

GET /v2/entities/MyObservation-RaspberryPi-890?options=keyValues and you will get something like

{ "id": "MyObservation-RaspberryPi-890", "type": "Observation", "temperature": 23.5 }

Of course, your laptop and the Raspberry Pi have to be on the same network.

Other architectures more complicated could make use of IoT Agents but in this case it is not even needed.

I hope this helps

best

edit flag offensive delete link more

Comments

Note that "docker run fiware/orion" will not be enough. Please refer to https://fiware-orion.readthedocs.io/en/master/user/docker/index.html

Martel gravatar imageMartel ( 2017-04-10 09:14:14 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-04-03 18:30:15 +0100

Seen: 3,504 times

Last updated: Apr 08 '17