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

Add a file for device status to datadir #28

Open
alex3kov opened this issue Feb 4, 2016 · 2 comments
Open

Add a file for device status to datadir #28

alex3kov opened this issue Feb 4, 2016 · 2 comments

Comments

@alex3kov
Copy link

alex3kov commented Feb 4, 2016

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

@dmage
Copy link
Owner

dmage commented Feb 4, 2016

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.

@alex3kov
Copy link
Author

alex3kov commented Feb 5, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants