co2mon icon indicating copy to clipboard operation
co2mon copied to clipboard

Add a file for device status to datadir

Open alex3kov opened this issue 9 years ago • 2 comments

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?).

alex3kov avatar Feb 04 '16 18:02 alex3kov

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 avatar Feb 04 '16 22:02 dmage

@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.

alex3kov avatar Feb 05 '16 08:02 alex3kov