https://github.com/lnicola/co2mon
Rust crate for USB CO₂ monitors
https://github.com/lnicola/co2mon
hacktoberfest rust
Last synced: 10 months ago
JSON representation
Rust crate for USB CO₂ monitors
- Host: GitHub
- URL: https://github.com/lnicola/co2mon
- Owner: lnicola
- License: apache-2.0
- Created: 2019-02-01T17:34:56.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-21T12:13:36.000Z (over 3 years ago)
- Last Synced: 2025-01-11T13:33:37.058Z (over 1 year ago)
- Topics: hacktoberfest, rust
- Language: Rust
- Homepage:
- Size: 80.1 KB
- Stars: 31
- Watchers: 4
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# `co2mon`
[![Actions Status]][github actions] [![Latest Version]][crates.io] [![API docs]][docs.rs]
[Actions Status]: https://github.com/lnicola/co2mon/workflows/ci/badge.svg
[github actions]: https://github.com/lnicola/co2mon/actions
[Latest Version]: https://img.shields.io/crates/v/co2mon.svg
[crates.io]: https://crates.io/crates/co2mon
[API docs]: https://docs.rs/co2mon/badge.svg
[docs.rs]: https://docs.rs/co2mon/
A driver for the Holtek CO₂ USB monitors, tested using a
[TFA-Dostmann AIRCO2NTROL MINI][AIRCO2NTROL MINI] sensor.
[AIRCO2NTROL MINI]: https://www.tfa-dostmann.de/en/produkt/co2-monitor-airco2ntrol-mini/
## Permissions
On Linux, you need to be able to access the USB HID device. For that, you
can save the following `udev` rule to `/etc/udev/rules.d/60-co2mon.rules`:
```text
ACTION=="add|change", SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d9", ATTRS{idProduct}=="a052", MODE:="0666"
```
Then reload the rules and trigger them:
```shell
udevadm control --reload
udevadm trigger
```
Note that the `udev` rule above makes the device accessible to every local user.
## Quick start
```shell
cargo run --example watch
```
## Releases
Release notes are available in [CHANGELOG.md](co2mon/CHANGELOG.md).
## Protocol
The USB HID protocol is not documented, but is a superset of [this one][co2meters] and was [reverse-engineered][had] [before][revspace].
The implementation was inspired by [this one][co2mon].
[co2meters]: https://co2meters.com/Documentation/Other/AN_RAD_0301_USB_Communications_Revised8.pdf
[co2mon]: https://github.com/dmage/co2mon/
[had]: https://hackaday.io/project/5301/
[revspace]: https://revspace.nl/CO2MeterHacking
## License
This project is licensed under either of
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
[http://www.apache.org/licenses/LICENSE-2.0][LICENSE-APACHE])
* MIT license ([LICENSE-MIT](LICENSE-MIT) or
[http://opensource.org/licenses/MIT][LICENSE-MIT])
at your option.
[LICENSE-APACHE]: http://www.apache.org/licenses/LICENSE-2.0
[LICENSE-MIT]: http://opensource.org/licenses/MIT