Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: This and that #5

Merged
merged 3 commits into from
Apr 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,11 @@ https://community.hiveeyes.org/t/laborprotokoll-4x5-temp-matrix-mit-ds18b20/5102


## What's Inside
* README.md - this file
* LICENSE

* `temp-matrix_5x6.py`

Sensor reading and data logging to Kotori DAQ / Hiveeyes.

* `temp-matrix_5x6-grafana_desktop.json`

JSON representation for corresponding [Grafana Dashboard].
- The `ds18b20-datalogger` program, reading DS18B20 sensors and
publishing readings to MQTT.
- JSON representation for a corresponding [Grafana Dashboard],
when acquired through [Kotori DAQ].


## Setup
Expand Down Expand Up @@ -76,9 +71,8 @@ https://community.hiveeyes.org/t/ds18b20-temperatur-sensoren-am-one-wire-bus-ano
```shell
ssh youruser@yourpi
screen
cd ds18b20-datalogger
source paho-mqtt/bin/activate
python temp-matrix_5x6.py
source /path/to/ds18b20-datalogger/.venv/bin/activate
ds18b20-datalogger
```

### MQTT data upload to Hiveeyes
Expand All @@ -94,12 +88,18 @@ matrix = [[temp_ir_1_1, temp_ir_1_2, temp_ir_1_3, temp_ir_1_4, temp_ir_1_5, temp
[temp_ir_5_1, temp_ir_5_2, temp_ir_5_3, temp_ir_5_4, temp_ir_5_5, temp_ir_5_6]]
```

## Data visualization in Grafana
### Data visualization in Grafana
https://swarm.hiveeyes.org/grafana/d/Y9PcgE4Sz/mois-ex-wtf-test-ir-sensor-svg-pixmap-copy

## Bonus: Sensor offsets
### Bonus: Sensor offsets
https://community.hiveeyes.org/t/temperatursensoren-justieren-kalibrieren/1744/2

### Cron Configuration
```
*/5 * * * * cd /path/to/data-directory && /path/to/ds18b20-datalogger/.venv/bin/ds18b20-datalogger
```


## Contributing

In order to learn how to start hacking on this program, please have a look at the
Expand All @@ -110,6 +110,7 @@ Contributions of any kind are always welcome and appreciated. Thank you.


[Grafana Dashboard]: https://swarm.hiveeyes.org/grafana/d/T49wHSaIk/mois-ex-wtf-test-ds18b20-5x6-temp-matrix-svg-pixmap?orgId=2&from=1712771622514&to=1712807415379
[Kotori DAQ]: https://kotori.readthedocs.io

[Changelog]: https://github.com/hiveeyes/ds18b20-datalogger/blob/main/CHANGES.md
[development documentation]: https://ds18b20-datalogger.readthedocs.io/en/latest/sandbox.html
Expand Down
8 changes: 8 additions & 0 deletions docs/backlog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Backlog for ds18b20-datalogger

## Iteration +1
- Better software tests
- Break out sensor mapping configuration from code
to make it re-usable across different setups
- Improve documentation
- Publish to PyPI
12 changes: 4 additions & 8 deletions ds18b20_datalogger/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@
```
ssh to your pi
screen
cd /path/to/ds18b20-datalogger
source .venv/bin/activate
python temp-matrix_5x6.py
source /path/to/ds18b20-datalogger/.venv/bin/activate
ds18b20-datalogger
```

Nice:
crontab -e
```
*/5 * * * * cd /path/to/ds18b20-datalogger && /path/to/ds18b20-datalogger/.venv/bin/python /path/to/ds18b20-datalogger/temp-matrix_5x6.py
```
Ursprünglicher code zur Datenverarbeitung auf dem Pi:
https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/multiple-ds18b20-temp-sensors-interfacing-with-raspberry-pi?CommentId=9470e4e9-b054-4dd3-9a3f-ac9d1fe38087
""" # noqa: E501

import glob
Expand Down
2 changes: 1 addition & 1 deletion ds18b20_datalogger/grafana-dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -1968,7 +1968,7 @@
"id": 17,
"panels": [
{
"content": "die idee: wenn ich im winter eh dämmmaterial auf die bienenkiste packe, dann kann ich per in die dämmung gearbeiteter temperatursensoren auch gleich die wanderschaft der heiztraube aufzeichnen.\n\nso sieht die filzmatte mit den sensoren aus:\n![Image](https://www.euse.de/wp/wp-content/uploads/2023/11/20231107_013850.jpg)\n\nund so, wenn sie im einsatz ist:\n\n![Image](https://community.hiveeyes.org/uploads/default/optimized/2X/4/4592049b22f880c3af2bad7f3ea623fa85c93595_2_690x461.jpeg)\n\nblaue **verbinder** wie hier von poesel entdeckt:\nhttps://community.hiveeyes.org/t/open-hive-temperature-array/524/34\n\npi für **1wire** klarmachen:\nhttps://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/multiple-ds18b20-temp-sensors-interfacing-with-raspberry-pi\n\nsensordaten **gemapped und geordnet** wie hier von clemens vorgemacht:\nhttps://community.hiveeyes.org/t/ds18b20-temperatur-sensoren-am-one-wire-bus-anordnen/1399\n\n\n> /sys/bus/w1/devices/28-00000735a982 temp-ir-4-1\n> /sys/bus/w1/devices/28-000007359dde temp-ir-4-2\n> /sys/bus/w1/devices/28-000007364e78 temp-ir-4-3\n> /sys/bus/w1/devices/28-6a39eb086461 temp-ir-4-4\n> /sys/bus/w1/devices/28-0939ee086461 temp-ir-4-5\n> /sys/bus/w1/devices/28-00000735b04d temp-ir-3-5\n> /sys/bus/w1/devices/28-8a3fee086461 temp-ir-3-4\n> /sys/bus/w1/devices/28-1843f4086461 temp-ir-3-3\n> /sys/bus/w1/devices/28-faf8eb086461 temp-ir-3-2\n> /sys/bus/w1/devices/28-000007351a12 temp-ir-3-1\n> /sys/bus/w1/devices/28-00000743bda0 temp-ir-2-1\n> /sys/bus/w1/devices/28-000007351f7f temp-ir-2-2\n> /sys/bus/w1/devices/28-129fd7086461 temp-ir-2-3\n> /sys/bus/w1/devices/28-69e3eb086461 temp-ir-2-4\n> /sys/bus/w1/devices/28-00000735b39e temp-ir-2-5\n> /sys/bus/w1/devices/28-a825eb086461 temp-ir-1-5\n> /sys/bus/w1/devices/28-000007350e77 temp-ir-1-4\n> /sys/bus/w1/devices/28-000007359c4f temp-ir-1-3\n> /sys/bus/w1/devices/28-00000735c6d1 temp-ir-1-2\n> /sys/bus/w1/devices/28-000007359257 temp-ir-1-1\n\nursprünglicher code zur datenverarbeitung auf dem pi:\nhttps://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/multiple-ds18b20-temp-sensors-interfacing-with-raspberry-pi?CommentId=9470e4e9-b054-4dd3-9a3f-ac9d1fe38087\n\n### pi zum datenversand vorbereiten\n\npaho-mqtt in einer virtualenv war nötig: https://pypi.org/project/paho-mqtt/#installation\n\nssh zum pi, dort derzeit in einem\n\nscreen\n\nsource paho-mqtt/bin/activate\n\ncd ~/ds18b20-datalogger\n\npython test.py\n\n\n\nmqtt-**daten-upload** nach hiveeyes wie im beispiel von mde:\nhttps://community.hiveeyes.org/t/daten-per-mqtt-und-python-ans-backend-auf-swarm-hiveeyes-org-ubertragen/94/6\n\nformat des arrays wie bei clemens:\nhttps://community.hiveeyes.org/t/how-to-visualize-2-dimensional-temperature-data-in-grafana/974/9\n\n> matrix = [[temp_ir_1_1, temp_ir_1_2, temp_ir_1_3, temp_ir_1_4, temp_ir_1_5], \\\n> [temp_ir_2_1, temp_ir_2_2, temp_ir_2_3, temp_ir_2_4, temp_ir_2_5], \\\n> [temp_ir_3_1, temp_ir_3_2, temp_ir_3_3, temp_ir_3_4, temp_ir_3_5], \\\n> [temp_ir_4_1, temp_ir_4_2, temp_ir_4_3, temp_ir_4_4, temp_ir_4_5]]\n\n**grafana**-experiment von wtf kopiert:\nhttps://swarm.hiveeyes.org/grafana/d/Y9PcgE4Sz/mois-ex-wtf-test-ir-sensor-svg-pixmap-copy\n\ndie panels (svg, js) angepasst auf mein 4x5-format (prozentzahlen, adressierung der array-variablen).\n\ndaten laufen rein in die datenbank.\ndie panels sehen ungefähr so aus, wie sie aussehen sollen.\nsoweit wunderbar.\n\nskript von sleep(900) auf cron umgestellt, beachte virtualenv: https://stackoverflow.com/questions/3287038/cron-and-virtualenv\n\n\n### todo\n* offset der sensoren ermitteln, https://community.hiveeyes.org/t/temperatursensoren-justieren-kalibrieren/1744/2\n\n\n### appendix: how to delete sensor failure entries from db\n\n root@elbanco:~# influx\n Connected to http://localhost:8086 version 1.7.10\n InfluxDB shell version: 1.7.10\n > use hiveeyes_....\n\n Using database hiveeyes_....\n > show series\n\n key\n ---\n mois_noho_sensors\n ...\n > SHOW FIELD KEYS FROM mois_noho_sensors\n\n name: mois_noho_sensors\n fieldKey fieldType\n -------- ---------\n temp-ir-1-1 float\n temp-ir-1-2 float\n temp-ir-1-3 float\n ...\n temp-ir-4-5 float\n > select \"temp-ir-1-2\" from mois_noho_sensors where \"temp-ir-1-2\" < -50\n\n name: mois_noho_sensors\n time temp-ir-1-2\n ---- -----------\n 1699396254643410035 -99\n > delete from mois_noho_sensors where time = 1699396254643410035\n\n > exit\n root@elbanco:~# exit\n logout\n Connection to elbanco.hiveeyes.org closed.\n\n\n\n\n",
"content": "die idee: wenn ich im winter eh dämmmaterial auf die bienenkiste packe, dann kann ich per in die dämmung gearbeiteter temperatursensoren auch gleich die wanderschaft der heiztraube aufzeichnen.\n\nso sieht die filzmatte mit den sensoren aus:\n![Image](https://www.euse.de/wp/wp-content/uploads/2023/11/20231107_013850.jpg)\n\nund so, wenn sie im einsatz ist:\n\n![Image](https://community.hiveeyes.org/uploads/default/optimized/2X/4/4592049b22f880c3af2bad7f3ea623fa85c93595_2_690x461.jpeg)\n\nblaue **verbinder** wie hier von poesel entdeckt:\nhttps://community.hiveeyes.org/t/open-hive-temperature-array/524/34\n\npi für **1wire** klarmachen:\nhttps://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/multiple-ds18b20-temp-sensors-interfacing-with-raspberry-pi\n\nsensordaten **gemapped und geordnet** wie hier von clemens vorgemacht:\nhttps://community.hiveeyes.org/t/ds18b20-temperatur-sensoren-am-one-wire-bus-anordnen/1399\n\n\n> /sys/bus/w1/devices/28-00000735a982 temp-ir-4-1\n> /sys/bus/w1/devices/28-000007359dde temp-ir-4-2\n> /sys/bus/w1/devices/28-000007364e78 temp-ir-4-3\n> /sys/bus/w1/devices/28-6a39eb086461 temp-ir-4-4\n> /sys/bus/w1/devices/28-0939ee086461 temp-ir-4-5\n> /sys/bus/w1/devices/28-00000735b04d temp-ir-3-5\n> /sys/bus/w1/devices/28-8a3fee086461 temp-ir-3-4\n> /sys/bus/w1/devices/28-1843f4086461 temp-ir-3-3\n> /sys/bus/w1/devices/28-faf8eb086461 temp-ir-3-2\n> /sys/bus/w1/devices/28-000007351a12 temp-ir-3-1\n> /sys/bus/w1/devices/28-00000743bda0 temp-ir-2-1\n> /sys/bus/w1/devices/28-000007351f7f temp-ir-2-2\n> /sys/bus/w1/devices/28-129fd7086461 temp-ir-2-3\n> /sys/bus/w1/devices/28-69e3eb086461 temp-ir-2-4\n> /sys/bus/w1/devices/28-00000735b39e temp-ir-2-5\n> /sys/bus/w1/devices/28-a825eb086461 temp-ir-1-5\n> /sys/bus/w1/devices/28-000007350e77 temp-ir-1-4\n> /sys/bus/w1/devices/28-000007359c4f temp-ir-1-3\n> /sys/bus/w1/devices/28-00000735c6d1 temp-ir-1-2\n> /sys/bus/w1/devices/28-000007359257 temp-ir-1-1\n\n### Projekt und Dokumentation:\n\nhttps://github.com/hiveeyes/ds18b20-datalogger\n\ndie panels (svg, js) angepasst auf mein 4x5-format (prozentzahlen, adressierung der array-variablen).\n\ndaten laufen rein in die datenbank.\ndie panels sehen ungefähr so aus, wie sie aussehen sollen.\nsoweit wunderbar.\n\nskript von sleep(900) auf cron umgestellt, beachte virtualenv: https://stackoverflow.com/questions/3287038/cron-and-virtualenv\n\n\n### todo\n* offset der sensoren ermitteln, https://community.hiveeyes.org/t/temperatursensoren-justieren-kalibrieren/1744/2\n\n\n### appendix: how to delete sensor failure entries from db\n\n root@elbanco:~# influx\n Connected to http://localhost:8086 version 1.7.10\n InfluxDB shell version: 1.7.10\n > use hiveeyes_....\n\n Using database hiveeyes_....\n > show series\n\n key\n ---\n mois_noho_sensors\n ...\n > SHOW FIELD KEYS FROM mois_noho_sensors\n\n name: mois_noho_sensors\n fieldKey fieldType\n -------- ---------\n temp-ir-1-1 float\n temp-ir-1-2 float\n temp-ir-1-3 float\n ...\n temp-ir-4-5 float\n > select \"temp-ir-1-2\" from mois_noho_sensors where \"temp-ir-1-2\" < -50\n\n name: mois_noho_sensors\n time temp-ir-1-2\n ---- -----------\n 1699396254643410035 -99\n > delete from mois_noho_sensors where time = 1699396254643410035\n\n > exit\n root@elbanco:~# exit\n logout\n Connection to elbanco.hiveeyes.org closed.\n\n\n\n\n",
"datasource": null,
"description": "",
"gridPos": {
Expand Down