{"id":26893563,"url":"https://github.com/dazz/hivemonitor","last_synced_at":"2025-03-31T23:58:23.115Z","repository":{"id":145833781,"uuid":"48932262","full_name":"dazz/hivemonitor","owner":"dazz","description":"Monitoring beehives with lots of technologies.","archived":false,"fork":false,"pushed_at":"2016-01-03T03:21:52.000Z","size":1552,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-24T16:01:47.277Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Arduino","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dazz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-03T03:16:11.000Z","updated_at":"2021-10-21T18:31:40.000Z","dependencies_parsed_at":"2023-04-17T12:46:12.810Z","dependency_job_id":null,"html_url":"https://github.com/dazz/hivemonitor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dazz%2Fhivemonitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dazz%2Fhivemonitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dazz%2Fhivemonitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dazz%2Fhivemonitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dazz","download_url":"https://codeload.github.com/dazz/hivemonitor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246558113,"owners_count":20796696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-31T23:58:22.679Z","updated_at":"2025-03-31T23:58:23.109Z","avatar_url":"https://github.com/dazz.png","language":"Arduino","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hive Monitor\n\nMonitoring beehives with lots of technologies.\n\nSensors =\u003e Node (Arduino) =\u003e Air =\u003e MQTT =\u003e Storage (InfluxDB, CouchDB) =\u003e Monitor\n\n1. Arduino node reads sensor data and writes to serial port\n1. Raspberry or $something_else publishes data to MQTT\n1. Retrieve data from MQTT and write to storage\n  1. InfluxDB (for monitoring and real-time joy)\n  1. CouchDB (for doing long term sciency things)\n1. Grafana shows dashboard with data from InfluxDB\n\n## Arduino node\n\nThe sensors are attached to the Arduino. A ino-script retrieves the data and sends them to the serial port.\n\nFind *.ino files in ./arduino\n\n### General\n#### Hardware\n* Arduino\n* SainSmart Sensor Shield http://www.sainsmart.com/sainsmart-sensor-shield-v5-4-arduino-apc220-bluetooth-analog-module-servo-motor-1.html\n\n#### Setup\n* install arduino IDE\n* download library (in IDE): Adafruit_Sensors\n\n### Humidity \u0026 Temperature\n* Hardware: DHT22\n* download library (in IDE): Adafruit_DHT\n\n\n## Serial to MQTT\n\nThe data from the sensors are written to the serial port, they noe need to be published to a message broker.\nMQTT is the best way to let interested parties know that something interesting has happened.\n\n* http://iotf-beta.readthedocs.org/en/latest/reference/mqtt/index.html\n\n\u003e Note:\n\u003e\n\u003e 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).\n\n### Setup\n\n* copy `script/read_serial_write_mqtt.py` on Raspberry Pi and edit config values\n* optional: install supervisor to always run the script with `apt-get install supervisor` (http://supervisord.org/installing.html)\n* add conf file to [supervisord](https://www.digitalocean.com/community/tutorials/how-to-install-and-manage-supervisor-on-ubuntu-and-debian-vps)\n\n```\n\u003e cat  /etc/supervisor/conf.d/read_serial_write_mqtt.conf \n[program:read_serial_write_mqtt]\ncommand=/home/user/read_serial_write_mqtt.py\nautostart=true\nautorestart=true\nuser=alarm\ndirectory=/home/user\n```\n\n### Config\n\nEdit config values in script\n\n```\nserial_device=\"/dev/ttyUSB0\"\nserial_baudrate=115200\nmqtt_hostname=\"192.168.33.56\"\nmqtt_port=1883\n```\n\n### Run\n\nIf option with supervisor `supervisorctl reread` or `supervisorctl restart read_serial_write_mqtt`\n\nIf not, just run the script by calling it `/home/user/read_serial_write_mqtt.py`\n\n\n## MQTT to InfluxDB\n\n\n\nThis script needs to run on a server which is always running and connected to the internet.\nBest is to let it be managed by supervisord.\n\n### Setup\n\n* `apt-get install pip`\n* `pip install -r requirements.txt`\n\nInstalls: \n* https://pypi.python.org/pypi/paho-mqtt/1.1\n* https://pypi.python.org/pypi/influxdb\n\n### Config\n\n```\nmqtt_subscribe = \"/#\"\nmqtt_host = \"192.168.33.56\"\nmqtt_port=1883\n\ninfluxdb_host=\"192.168.33.56\"\ninfluxdb_port=8086\ninfluxdb_user=\"root\"\ninfluxdb_password=\"\"\ninfluxdb_database=\"test\"\ninfluxdb_ssl=True\ninfluxdb_verify_ssl=True\n```\n\n### Run `./script/read_mqtt_write_influx.py`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdazz%2Fhivemonitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdazz%2Fhivemonitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdazz%2Fhivemonitor/lists"}