Skip to content

Commit acba93e

Browse files
committed
[Mois Labs] Improve README for Mois Labs Beescale Yún
1 parent e384c4f commit acba93e

File tree

1 file changed

+144
-13
lines changed

1 file changed

+144
-13
lines changed

moislabs/beescale-yun/README.rst

Lines changed: 144 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@
99
Mois Labs Beescale Yún
1010
######################
1111

12+
`Documentation`_
13+
| `Source code`_
14+
| `Licenses`_
15+
| `Issues`_
16+
| `Hiveeyes Project`_
17+
| `Hiveeyes Community Forum`_
18+
19+
.. _Documentation: https://hiveeyes.org/docs/arduino/firmware/moislabs/beescale-yun/README.html
20+
.. _Hiveeyes Community Forum: https://community.hiveeyes.org/
21+
.. _Hiveeyes Project: https://hiveeyes.org/
22+
.. _Issues: https://github.com/hiveeyes/arduino/issues
23+
.. _Licenses: https://hiveeyes.org/docs/arduino/project/licenses.html
24+
.. _Source code: https://github.com/hiveeyes/arduino/tree/main/moislabs/beescale-yun
25+
1226
.. tip::
1327

1428
Please `continue reading this document on our documentation space
@@ -23,7 +37,16 @@ About
2337
*****
2438

2539
The second generation `Mois Box`_ is a beehive monitoring system based on the
26-
`Arduino Yún Shield`_-compatible `Dragino Yun Shield v2.4`_.
40+
`Arduino Yún Shield`_-compatible `Dragino Yun Shield v2.4`_, running `OpenWrt`_.
41+
42+
Project repository
43+
==================
44+
45+
`@bee-mois`_ is maintaining the full sources, including all auxiliary helper programs,
46+
within the `beescale repository`_.
47+
48+
Pictures
49+
========
2750

2851
.. figure:: https://ptrace.hiveeyes.org/2017-03-21_mois-node-yun-http.jpg
2952
:alt: Mois Box with electronics
@@ -42,11 +65,6 @@ The second generation `Mois Box`_ is a beehive monitoring system based on the
4265

4366
|clearfix|
4467

45-
Project repository
46-
==================
47-
48-
`@bee-mois`_ is maintaining the full sources, including all auxiliary helper programs,
49-
within the `beescale repository`_.
5068

5169

5270
********
@@ -138,10 +156,51 @@ Upload to MCU
138156
Telemetry and backend
139157
*********************
140158

141-
The `Bridge Library for Yún devices`_ enables communication between the `ATmega328P`_ MCU
142-
on the `Arduino Uno`_, and the `AR9331`_, in order to submit data from the sensor domain
143-
to the Linux machine. It will enable transparent HTTP communication using the venerable
144-
Arduino `HttpClient`_ library.
159+
160+
Overview
161+
========
162+
163+
This flowchart will give you an idea how measurement data is acquired and processed
164+
within the sensor domain, and how it will be converged to the network and submitted
165+
to the backend systems.
166+
167+
.. Mermaid Flowcharts documentation: https://mermaid.js.org/syntax/flowchart.html
168+
169+
.. mermaid::
170+
171+
%%{init: {"flowchart": {"defaultRenderer": "dagre", "htmlLabels": false}} }%%
172+
173+
flowchart LR
174+
175+
subgraph sensors [sensor domain]
176+
direction LR
177+
ATmega328P --> AR9331
178+
end
179+
180+
subgraph network
181+
direction TB
182+
HTTP{HTTP}
183+
MQTT{MQTT}
184+
end
185+
186+
subgraph backend
187+
direction LR
188+
PHP --> CSV --> dygraphs
189+
Kotori --> InfluxDB --> Grafana
190+
PHP --> Kotori
191+
end
192+
193+
sensors --> network
194+
network --> backend
195+
196+
197+
Transport
198+
=========
199+
200+
To get the measurement data from the *sensor domain* to the *network*, the `Bridge Library
201+
for Yún devices`_ enables communication between the `ATmega328P`_ MCU on the `Arduino Uno`_,
202+
and the `AR9331`_, running `Linux`_. The library will enable transparent HTTP communication
203+
through the venerable Arduino `HttpClient`_.
145204

146205
.. code-block:: c++
147206

@@ -151,13 +210,85 @@ Arduino `HttpClient`_ library.
151210
HttpClient client;
152211
client.post(url);
153212

154-
Using this HTTP client (example implementation at `Yún HTTP Client`_), telemetry data is
155-
transmitted to a `custom PHP receiver program`_, and is also stored on the SD card attached
156-
to the device.
213+
Using this HTTP client (example program at `Yún HTTP Client`_), telemetry data is transmitted
214+
to a `custom PHP receiver program`_, and is also stored on the SD card attached to the device.
215+
216+
Reception and relay
217+
===================
218+
219+
On the backend, the PHP program receives the telemetry data record, and stores it into two
220+
different databases. First, it adds the record to a CSV file stored on the server's file
221+
system, and second, it emits another HTTP request to the data acquisition server of our
222+
beekeepers collective at https://swarm.hiveeyes.org/.
223+
224+
To learn more about how this works, please visit the documentation about `Daten zu Hiveeyes
225+
übertragen`_, and the `Kotori message router and data historian`_.
226+
227+
Other than this, for publishing the webcam image, a cron job on the web server acquires the
228+
latest image from the Yun's SD card every 15 minutes, and stores it on its own filesystem,
229+
where HTTP clients are able to consume it without further ado.
230+
231+
Visualization
232+
=============
233+
234+
The data in the CSV file is visualized using the `graph.php`_ program. It uses `dygraphs`_,
235+
a JavaScript charts framework, and that's it.
236+
237+
On the other hand, when submitting data to `Kotori`_ on the collaborative data collection
238+
server at https://swarm.hiveeyes.org/, it will store the data into `InfluxDB`_, and will
239+
populate a `Grafana`_ dashboard correspondingly.
240+
241+
242+
*********
243+
Live data
244+
*********
245+
246+
- https://www.euse.de/honig/beescale/graph.php
247+
- https://www.euse.de/honig/beescale/graph_pure.php
248+
- https://swarm.hiveeyes.org/grafana/d/5NpVD1qiz/mois-2-1-hives-overview-and-bee-weather
249+
- https://www.euse.de/honig/beescale/latest.jpg
250+
251+
252+
253+
*********************
254+
Contributions welcome
255+
*********************
256+
257+
You can run parts of this, or the whole system, on your own hardware, for yourselves, or
258+
as a service for your local beekeepers collective. If you want to report or fix a bug or
259+
documentation flaw, or if you would like to suggest an improvement, feel free to `create
260+
an issue`_, or `submit a patch`_. Thank you.
261+
262+
----
263+
264+
.. note::
265+
266+
::
267+
268+
echo "Viel Spaß am Gerät"
269+
cat <<ZUSE
270+
271+
Es hat viele Erfinder außer mir gebraucht, um den Computer, so wie wir ihn heute kennen, zu entwickeln.
272+
Ich wünsche der nachfolgenden Generation Alles Gute im Umgang mit dem Computer. Möge dieses Instrument
273+
Ihnen helfen, die Probleme dieser Welt zu beseitigen, die wir Alten Euch hinterlassen haben.
274+
275+
-- Konrad Zuse
276+
277+
ZUSE
157278

158279

159280
.. _AR9331: http://en.techinfodepot.shoutwiki.com/wiki/Atheros_AR9331
160281
.. _@bee-mois: https://github.com/bee-mois
161282
.. _beescale repository: https://github.com/bee-mois/beescale
283+
.. _create an issue: https://github.com/hiveeyes/arduino/issues
162284
.. _custom PHP receiver program: https://github.com/bee-mois/beescale/blob/master/add_line2.php
285+
.. _Daten zu Hiveeyes übertragen: https://community.hiveeyes.org/t/daten-per-http-und-php-ans-backend-auf-swarm-hiveeyes-org-ubertragen/162
286+
.. _dygraphs: https://dygraphs.com/
287+
.. _Grafana: https://en.wikipedia.org/wiki/Grafana
288+
.. _graph.php: https://github.com/bee-mois/beescale/blob/master/graph.php
163289
.. _HttpClient: https://www.arduino.cc/reference/en/libraries/httpclient/
290+
.. _InfluxDB: https://en.wikipedia.org/wiki/InfluxDB
291+
.. _Kotori message router and data historian: https://getkotori.org/
292+
.. _Linux: https://en.wikipedia.org/wiki/Linux
293+
.. _OpenWrt: https://en.wikipedia.org/wiki/OpenWrt
294+
.. _submit a patch: https://github.com/hiveeyes/arduino/pulls

0 commit comments

Comments
 (0)