Giter VIP home page Giter VIP logo

co2monitor's Introduction

Build Status

This project reads CO2 concentration and temperatures from a TFA Dostmann CO2 Monitor (these devices are sold under different names, i.e. "Aircontrol CO2 Monitor Mini TFA 31.5006") and writes the values to InfluxDB for creating nice dashboards.

There are similiar projects for different devices - I got the idea from the Freakshow Podcast. Here's a nice blogpost from InnoQ about a similar setup with a different device: https://www.innoq.com/en/blog/carbon-dioxide-monitoring/

Installing

This uses libusb and the hidapi to discover the sensor and read data from it. On Linux you will need to install these libraries in order to compile the program:

  • libudev-devel
  • hidapi-devel

These are for Fedora/CentOS - they might be called slightly different in other distros.

On MacOS you can do brew install hidapi

Building

You will rust and cargo installed: https://www.rust-lang.org/en-US/

Then just run cargo build --release in the project folder and the full binary will be in target/release. All you need from there is the co2monitor binary.

Running

You can execute the binary without any parameter. It will then print out the readings to your terminal:

$ ./target/release/co2monitor
Found device at address USB_04d9_a052_14120000
Temperature(22.850006)
CO2(869)
Temperature(22.912506)
CO2(868)
Temperature(22.912506)
CO2(868)
Temperature(22.850006)
CO2(868)
Temperature(22.850006)

Press Ctrl-C to quit.

InfluxDB

The program sends the measurements to a time-series database called InfluxDB.

I use UDP since it's the easiest way to do it. Please keep in mind that there is no security whatsoever, so this is only a sane thing to do if you are running influxdb on the same host or a trusted network.

UDP is disabled by default, so you need to enable it. Here is the relevant section from influxdb.conf:

[[udp]]
  enabled = true
  bind-address = ":8089"
  database = "climate"

Values are writtem to a "climate" database. InfluxDB will automatically create it on start if it does not exist.

Chronograf

You can create a nice dashboard visualizing the date using Chronograf. Mine looks like this:

Dashboard

Here's the json config for it: Dashboard-Config

co2monitor's People

Contributors

gtudan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

co2monitor's Issues

"Found device", then no output

Hello,

when i start the binary, the only output i get is "Found device", then nothing happens.
Any idea why it doesn't work?

Thanks!

Best regards,
Kevin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.