Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
This is the StuStaNet Temperature Monitoring System.
# Hardware Setup and Protocol
The temperature sensors are ds18x20 sensors connected via the onewire protocol
to an esp32. The esp is connected via usb-serial to the host computer.
This sends roughly every second a measurement value from one of the sensors.
After a complete round it sends an empty line.
# Dependencies
pyserial-asyncio. And >=python3.5.
# Architecture
The communications is done within the temperature_daemon.py file as well as
error handling for the sensor measurements.
It will then call functions in plugins to do the majority of the work.
The plugins are located in the `plugins` folder.
A plugin has to include a `def init(temperaturemonitor):` initializer which
returns the plugin-class. See `plugins/warnings.py` for reference.
To see which plugin functions are called with what arguments search for
`call_plugin` in the whole tree.
A plugin function can either be either async or not, both versions will be
executed properly.
Plugins can also call other plugins.
# Configuration
The system is configured via the `tempermon.ini` file, but the path can be changed
by supplying a single argument to the main executable.
It includes a bunch of default sections:
* **serial**: settings for the serial connection
* **\<pluginname>**: plugin specific settings
* **\<one-wire-id>**: every other section is interpreted as a sensor configuration
section. The configured sensor name is used for the collectd graphs, so if a
sensor is replaced, also change its name.
If a sensor is missing from this list, it will generate warning mails, as well
as for extra sensors. Only leave the sensors commented in, that are actually
used.
# Testing
In `/tests` the testing architecture is set up.
`run_tests.sh` creates a testing socket as well as a emulated collectd socket.
Now testing can be started using the default configfile.
# Existing Plugins
If you create another plugin please add it to this list.
## Collectd
Store values into collectd when new sensor values are available as well as expose
a generic graph-storing for other plugins
## Mail
Contains the emailing system as well as all email templates.
Reacts to most `err_*` and `warn_` plugin calls and sends emails for them to the
configured clients
## Warnings
Analyse all available sensors, create statistics and analsye them and create
warnings, if required.
Here we can adopt new warning strategies.