Better HN
topnewbestaskshowjobs
Log inSign up

stackmad

96 karma · joined Aug 22, 2018 (8y ago) · 29 submissions

An author of the Boden cross-platform framework. Find us at GitHub: https://github.com/ashampoosystems/boden
Submissions

comment 7y ago · link · parent

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

2.

Conan package for googles skia library(github.com ↗)

2 points · by stackmad · 7y ago · discuss

comment 7y ago · link · parent

Actually its 9 plants ;)

comment 7y ago · link · parent

Yeah, you have to use IOKit, which hidapi wraps.

comment 7y ago · link · parent

LOL

comment 7y ago · link · parent

:) But the CO2 measurement part honestly came first.

comment 7y ago · link · parent

Sure, but I wanted to see the data over time. And I was bored :)

comment 7y ago · link · parent

Yeah, its quite ok.

comment 7y ago · link · parent

Totally true, but my soldering iron is in the basement, so ... ;)

comment 7y ago · link · parent

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

comment 7y ago · link · parent

Yes, I agree. But this was way more fun :)

comment 7y ago · link · parent

I guess it should match the outside air as close as possible. So around 400ppm

comment 7y ago · link · parent

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 )

comment 7y ago · link · parent

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

comment 7y ago · link · parent

That looks great as well! But for some reason the library they use (pyhidapi) would always crash on my Mac.

comment 7y ago · link · parent

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.

comment 7y ago · link · parent

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

comment 7y ago · link · parent

Yeah, I've finally managed to tweak the thermostat on the radiators and the main thermostat for the heater to where I like it :)

comment 7y ago · link · parent

Yeah, that was pretty quickly hacked together :)

comment 7y ago · link · parent

The device on its onscreen display shows the same steps, so I think its due to how the sensor works.

comment 7y ago · link · parent

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.

comment 7y ago · link · parent

Yes, I agree. I've already ordered a bunch of plants :) Sadly my building is quite old and ventilation is poor.

comment 7y ago · link · parent

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.

comment 7y ago · link · parent

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 :)

25.

Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App(github.com ↗)

146 points · by stackmad · 7y ago · 120 comments

comment 7y ago · link · parent

Is there a TL;DR version of their "theory of patches" ?

comment 8y ago · link · parent

I'd recommend having a look at sphinx together with exhale https://exhale.readthedocs.io/en/latest/

comment 8y ago · link · parent

More people should see this!