The data source is a sensor node consisting of an Arduino Uno with a Dragino Yun Shield 2.4 ontop running OpenWrt. OpenWrt's mjpg_streamer collects the beecam image every 15 minutes and saves it to the Yun's SD card. The Arduino firmware is periodically collecting the data from all the sensors, writes it to the Yun Shield's SD card for backup purposes and passes it via HTTP Push over an USB connected GSM dongle (no Wlan nor Freifunk nearby!) through OpenVPN to a php-script at in-berlin.de. A OpenWrt watchdog is reconnecting all network interfaces if GSM or VPN fail to connect. The script at in-berlin.de writes the data to two different databases: First a flatfile database (csv) right on the server and second via HTTP GET to Kotori at swarm.hiveeyes.org. A cron job at the webserver sucks the latest image from the Yun's SD card every 15 minutes. The flatfile is visualized by graph.php, which is relying on dygraphs, a js charts framework. This graph is cleaned, completed and repaired manually every once in a while. A Raw data graph is also available. This is the historical and stabel approach. Kotori however is administrating a source gateway and routes the data into the time series database influxDB. Grafana is getting the data from there and displays them. Hiveeyes is the experimental and trendsetting approach.
Content of the beescale Repository
- Folder OpenWrt: config and other custom beescale files of dragino yun shield's linux component running openwrt.
- beescale-yun-ds18b20-two_load_cells-dht22-switch-sd-lux-lite: arduino yun firmware/"sketch". Better get it from the hiveeyes repo: node-yun-http.ino
- add_line2.php: collects data and writes to databases.
- graph.php: creates visible representations (charts) based on dygraphs js-framework.
- graph_pure.php: creates visible representation (charts) with the raw data, no spikes eliminated, based on dygraphs js-framework.
- latest.sh: shell script that downloads beecam-image from arduino yun's sd-card, processes it with a timestamp of creation date (imagemagick) and saves it on web-server as latest.jpg for display on web page.
- sensorik.csv: example flat file database file.
- sensorik_pure.csv: example flat file database file with uncorrected raw data.