co2mon
co2mon copied to clipboard
Add a file for device status to datadir
Can you add a file that shows current status of the device - is it connected to usb or not, and maybe some other statuses that this device supports (mode? calibration period? malfunctioning?).
There is a heartbeat
file to check if everything works fine. To check the connection status for now you can use the lsusb
command. Is there any reason to duplicate it by file (which will remain after kill -9
)?
Unfortunately there is no documentation about data and statuses from the device. But you can try to investigate it, to see unfiltered data run co2mond with -u flag.
@dmage
There is a heartbeat file to check if everything works fine.
Just checked - it is not created if daemon was started with disconnected device. I have 2 boards for development, with this daemon running constantly and connecting MT8057 to one at a time. Can you create this file on startup even if MT8057 is disconnected?
To check the connection status for now you can use the lsusb command. Is there any reason to duplicate it by file (which will remain after kill -9)?
I would have to grep
lsusb
with HWID, so it will be hardcoded with magic value in 2 places - your program and my script.
Good point about leftover file. It can be worked around by checking modification time though.