The CO2 traffic lights by Watterott signs co2 concentration of the air with colored leds and since firmware versionn v7 from here serial commands and data output is enabled.
See entries at the publications at my site.
The serial interface of the co2 traffic lights at linux
At my computer the seriel interface is /dev/ttyACM0. You can use it e. g. with Minicom or Screen, but you can also use cat at the commandline to display it. The latter is what we will use for our script.
Conky’s shell-script interface
Aside Conky’s internal commands there are some calling shell-scripts periodically that you can use to get co2 traffic lights state and show it at the conky window.
Objective: Show co2 values at the Conky window
There are two shell-scripts needed, one to gain the state and the other to tell it. The first scipt will be waiting for change of state, so it can’t be used to inform conky constantly. That’s why it has to write new states to a file, the other script reads and tells conky.
Collecting data from the serial interface of the co2 traffic lights
The co2 traffics light must be connected to the computer of course - which might not be the case. So we use a watcher script again, if the device is connected data will be filtered and put to a file. If it is not, then there is a NIL as output.
The bash-script co2ampel.watcher.sh
|
|
The shell-Script co2ampel.conky.sh
|
|
The Conky entry
|
|
Example of the co2ampel.txt file
|
|