News for hackers. Stuff that matters.

stackmad

Re:Boden – Native mobile cross-platform applications on Thursday May 30, 2019 @01:40PM (#20053866)
Author of boden here: We have since moved away from a self written smart pointer and replaced as much as possible with standard C++ classes ( shared_ptr, weak_ptr, std::string etc. )
Actually its 9 plants ;)
Yeah, you have to use IOKit, which hidapi wraps.
:) But the CO2 measurement part honestly came first.
Sure, but I wanted to see the data over time. And I was bored :)
Yeah, its quite ok.
Totally true, but my soldering iron is in the basement, so ... ;)
Yes, absolutely. I only have one device at the moment, but it sure would be interesting to see how fast the levels equalize between rooms
Yes, I agree. But this was way more fun :)
I guess it should match the outside air as close as possible. So around 400ppm
Its not that I'm afraid to die here :) Its more about improving the quality of the air. And the body is pretty bad at recognizing higher than norm CO2 level unless it gets to life threatening levels. ( https://youtu.be/1Nh_vxpycEA?t=45 )
Though with your steps it at least starts, but the webserver fails, and CTRL+C doesn't work ^^

   * Serving Flask app "co2meter.server" (lazy loading)
   * Environment: production
     WARNING: Do not use the development server in a production environment.
     Use a production WSGI server instead.
   * Debug mode: off
  INFO:werkzeug: * Running on http://127.0.0.1:1201/ (Press CTRL+C to quit)
  ERROR:flask.app:Exception on / [GET]
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 2292, in wsgi_app
      response = self.full_dispatch_request()
    File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
      rv = self.handle_user_exception(e)
    File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1718, in handle_user_exception
      reraise(exc_type, exc_value, tb)
    File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
      rv = self.dispatch_request()
    File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1799, in dispatch_request
      return self.view_functions[rule.endpoint](**req.view_args)
    File "/usr/local/lib/python2.7/site-packages/co2meter/server.py", line 64, in home
      data = read_logs()
    File "/usr/local/lib/python2.7/site-packages/co2meter/server.py", line 236, in read_logs
      with open(os.path.join('logs', name + '.csv'), 'r') as f:
  IOError: [Errno 2] No such file or directory: 'logs/co2.csv'
  INFO:werkzeug:127.0.0.1 - - [25/Jan/2019 14:18:23] "GET / HTTP/1.1" 500 -
  INFO:werkzeug:127.0.0.1 - - [25/Jan/2019 14:18:23] "GET /favicon.ico HTTP/1.1" 404 -
  ^C^C^C^C
  ^C^C
That looks great as well! But for some reason the library they use (pyhidapi) would always crash on my Mac.
I saw some study that suggests that higher CO2 levels decrease cognitive abilities. You wont die, but I do tend to get headaches when the air gets worse.
It definitely shows that this is one of the cheapest meters on the market. But the values seem to be realistic, when having all windows open it shows 450-460 ppm which is at least close to the global 400ppm ( and I live next to a road in a bigger city ).
Yeah, I've finally managed to tweak the thermostat on the radiators and the main thermostat for the heater to where I like it :)
Yeah, that was pretty quickly hacked together :)
The device on its onscreen display shows the same steps, so I think its due to how the sensor works.
Depends, this was a question I tried to answer for myself with this project. I did not easily find a good library for Python that would work on my Mac for reading the HID messages, so writing the device part in C++ was easier for me ( and an interesting excercise in c++17'ifying C code ). I thought about just having the c++ app be called from python, but wanted to try and see how hard it would be in c++ and found it extremely easy with the cpprestsdk.
Yes, I agree. I've already ordered a bunch of plants :) Sadly my building is quite old and ventilation is poor.
That looks good as well! I actually didn't know about that project. It wouldn't have worked on my specific case though since I wanted it connected to my Mac, that tool only works on Linux.
You can only put link + title on here. And the story is rather boring :) I wanted to measure it, I got a device from amazon, found a python script to read the data, the dependencies (pyhidapi) always sigfaulted, so I wrote my own :)
Is there a TL;DR version of their "theory of patches" ?
I'd recommend having a look at sphinx together with exhale https://exhale.readthedocs.io/en/latest/
More people should see this!