Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.

README.md

Hive Monitor

Monitoring beehives with lots of technologies.

Sensors => Node (Arduino) => Air => MQTT => Storage (InfluxDB, CouchDB) => Monitor

  1. Arduino node reads sensor data and writes to serial port
  2. Raspberry or $something_else publishes data to MQTT
  3. Retrieve data from MQTT and write to storage
  4. InfluxDB (for monitoring and real-time joy)
  5. CouchDB (for doing long term sciency things)
  6. Grafana shows dashboard with data from InfluxDB

Arduino node

The sensors are attached to the Arduino. A ino-script retrieves the data and sends them to the serial port.

Find *.ino files in ./arduino

General

Hardware

Setup

  • install arduino IDE
  • download library (in IDE): Adafruit_Sensors

Humidity & Temperature

  • Hardware: DHT22
  • download library (in IDE): Adafruit_DHT

Serial to MQTT

The data from the sensors are written to the serial port, they noe need to be published to a message broker. MQTT is the best way to let interested parties know that something interesting has happened.

Note:

This part will be replaced by "WiFi Module - ESP8266" and the data can be send directly from the Sensor Node (Arduino) to the Message Broker (MQTT).

Setup

> cat  /etc/supervisor/conf.d/read_serial_write_mqtt.conf 
[program:read_serial_write_mqtt]
command=/home/user/read_serial_write_mqtt.py
autostart=true
autorestart=true
user=alarm
directory=/home/user

Config

Edit config values in script

serial_device="/dev/ttyUSB0"
serial_baudrate=115200
mqtt_hostname="192.168.33.56"
mqtt_port=1883

Run

If option with supervisor supervisorctl reread or supervisorctl restart read_serial_write_mqtt

If not, just run the script by calling it /home/user/read_serial_write_mqtt.py

MQTT to InfluxDB

This script needs to run on a server which is always running and connected to the internet. Best is to let it be managed by supervisord.

Setup

  • apt-get install pip
  • pip install -r requirements.txt

Installs:

Config

mqtt_subscribe = "/#"
mqtt_host = "192.168.33.56"
mqtt_port=1883

influxdb_host="192.168.33.56"
influxdb_port=8086
influxdb_user="root"
influxdb_password=""
influxdb_database="test"
influxdb_ssl=True
influxdb_verify_ssl=True

Run ./script/read_mqtt_write_influx.py

About

Monitoring beehives with lots of technologies.

Resources

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.