Skip to content

Orion Context Broker Configuration to Cloudino

Jordana Villegas Sosa edited this page Nov 17, 2015 · 13 revisions

Configurations the server Orion Context Broker - FIWARE. Enter to the configuration Cloudino "Context Broker Orion", define the next fields.

Active: True

DNS: Orion.lab.fi-ware.org

Port: 1026

User Token: (generate token fiware site, for example kvx0QWD8CEMd3Yl4B1Ugefnr6WcThI. That more information https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Publish/Subscribe_Broker_-_Orion_Context_Broker_-_Quick_Start_for_Programmers )

Entity ID: (Instance name, for example “MyHouse”)



OrionContextBrokerConfiguration

##Example

Curl https://orion.lab.fi-ware.org:1026/ngsi10/contextEntities/MyHouse -X GET -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' --header "X-Auth-Token: kvx0QWD8CEMd3Yl4B1Ugefnr6WcThI" | python -mjson.tool



####The example MyHouse send results

#include <Cloudino.h>
#include <dht11.h>

#define DHT11PIN 8

Cloudino cdino;
dht11 DHT11;

void getSensor()
{
  int chk = DHT11.read(DHT11PIN);
  cdino.post("temperature",String((float)DHT11.temperature,2));
  cdino.post("humidity",String((float)DHT11.humidity,2));
  cdino.print("Timer done!");
}

void setup()
{
  cdino.setInterval(10000,getSensor);
  cdino.begin();
}

void loop()
{
  cdino.loop();
}

##References https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Publish/Subscribe_Broker_-_Orion_Context_Broker_-_User_and_Programmers_Guide#Introduction_to_Programmers_Guide