This is the place to collect my scripts for the beescale, that are not (yet) incorporatet into hiveeyes. See more (sorry, in German language only):
PHP Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

beescale

This is the place to collect my scripts for the beescale, that are not (yet) incorporatet into hiveeyes. For more prose about the beescale see the blog (only in German language).

Data Stream

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.
    • latest.sh: shell script that produces latest.jpg from most recent date-stamp-named-snapshot of usb webcam driven by mjpg_streamer.
    • wan-watchdog.sh: shell script that checks connection from yun to web server and restarts connections if necessary. run by yun's cron.
  • 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.