Skip to content

Raspberry

AdrianFarmadin edited this page Jan 12, 2018 · 7 revisions

Raspberry takes care of sending data to the Cloud. The connection has following parts:

  • RaspberryPi with sensor: Reads data from the real world.
  • Client: Transforms input from Raspberry pins to Hogajama accepted format.
  • MQTT Broker: MQTT is used as a transport protocol between the Client and Hogajama.
  • Hogajama: Stores data und displays it to the users.

Hogajama message format

{
  "sensorName": <sensorName>,
  "type": <sensorType>,
  "value": <value>,
  "location": <location>,
  "version": <version>
}

Client

Located in $project-repository/Habarama/client/python/plant.py.

Requirements

Configuration

The client reads configuration form habarama.json located in current working directory.

habarama.json format

{
  "brokerUrls": ["broker1", "broker2"],
  "sensors": [
    {
      "name": "<sensor.name>",
      "type": "<sensor.type>",
      "location": "<sensor.location>",
      "channel": <sensor.channel>,
      "pin": <sensor.pin>
    }
  ]
}
  • brokerUrls : array of MQTT broker URLs
  • sensor.name: Unique name for sensor for given location and type. Type: String
  • sensor.type: Describes which kind of values the sensor reads. Type: String
  • sensor.location: Where is sensor located. Type: String
  • channel: Type: Number
  • pin: To which pin is the sensor connected. Type: Number

MQTT Broker connection