6 ms·
Rethinking temperature, sensors, and Raspberry Pi
- tdicola 11y agoCool project, and great write up of the experience!
- dlau1 11y agoI recently set up a raspi to monitor my wine cellar temperatures. If you're looking for a 3rd party solution, check out librato [1]. We use them at work and they're really great. I hooked temperature readings up to librato and set up threshold alerts within a few min without ever having used their python api before. [1] http://librato.com http://librato.com hardware guide I used: https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging?view=all https://learn.adafruit.com/dht-humidity-sensing-on-raspberry...
- jbuzbee 11y agoI went overboard with my Raspberry PI and temperature sensors a couple of years ago. I hooked a bunch of sensors up to old wiring in the house that a previous owner had used for a security system. And while I was at it, I hooked up an old crank-telephone so I could remotely ring the bells, play "The Raspberries" on the handset, etc. It's not all operational anymore, but the DS1820b temperature sensors are. It's surprising how sensitive they are. By watching a graph, you can see when the heater or AC runs, when someone takes a shower, when the garage door opens, when a car is in the garage, etc. http://buzbee.asuscomm.com:8100/ http://buzbee.asuscomm.com:8100/
- rhinoceraptor 11y agoThis brings up one annoying aspect of the Raspberry Pi, it's pretty difficult to get GPIO access without root. I built a temperature sensor for a server rack [1], and went with an ATMega328 and an ENC28J60 ethernet module, and it just serves JSON of the four DHT11 sensors connected to it. [1] https://jacklew.is/arduino-temp-sensor/ https://jacklew.is/arduino-temp-sensor/
- BufordTJustice 11y agoI feel like using RethinkDB, instead of something like SQLite (or if you absolutely insist on NoSQL, maybe LevelDB or BerkeleyDB) kind of seems like using a supertanker for a tugboat's job. Especially if you're going to write your temperature sensor logger in Python, and it's just being used as an embedded application, SQLite really seems like one of the smarter choices you could make there. Maybe the point is to demo RethinkDB features, but wouldn't it make sense for the Python script to also emit the status data and send notifications as well, without needing all those extra Node dependencies? Also, maybe I'm just crazy, but man I can't believe people are encouraging others to curl stuff from the internet right into a shell. Especially on Raspian where the default Pi user has NOPASSWD in sudoers, this seems like a bad practice that we shouldn't encourage.
- detaro 11y ago> Maybe the point is to demo RethinkDB features, given that this is the RethinkDB blog, I'm pretty sure that is the point: a nice little toy example to show what it can do. That said, the node parts probably could have been done in Python as well and made the entire thing a bit easier.
- BufordTJustice 11y agoStill, it kind of seems like a blog for Kenworth demoing someone using a giant truck to race around a track, I mean I guess you can do it, but it doesn't seem like the intended application.
- dalanmiller 11y agoHowdy! Author here. I definitely wanted to do all parts in Python but am somewhat allergic to the `while True:` pattern necessary in Python for changfeeds. I haven't brought myself up-to-date on the more recent asyncio library to write the more Pythonic `yield from` for a changefeeds example. Would you know how to do this in Python elegantly? Because I would love to rip out the Node/Javascript parts.
- rebootthesystem 11y agoWell, I get that this is a RethinkDB blog but I can't help to see this as another example of this "virus" that has gotten hold of some segments of the software development world making for utterly bloated and pointlessly complex solutions to simple problems. I call it the "OOP+Framework 'Hello World'" syndrome. It seems nobody can write code without adding layers of classes, loading-up the call stack and megabytes of libraries. In this particular case a simple C program logging to a comma-delimited text file, or, if you want to splurge, JSON-formatted text file would have done the job. But, I get it, proposing not everything requires OOP is heresy. What was I thinking?
- Daneel_ 11y agoI have to say, I accomplished all this with a simple bash script in about 60 minutes or less. Using a sledgehammer like Rethink for something that can be easily handled with a text file and logrotate is just...overkill. I understand that it's a rethink blog, but I completely finished the project in less time that it took him to compile the database.