

Rethinking temperature, sensors, and Raspberry Pi - mglukhovsky
http://rethinkdb.com/blog/temperature-sensors-and-a-side-of-pi/

======
BufordTJustice
I 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
> _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.

~~~
dalanmiller
Howdy! 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.

------
jbuzbee
I 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/)

------
Daneel_
I 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.

------
dlau1
I 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...](https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-
with-gdocs-logging?view=all)

------
rhinoceraptor
This 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/)

------
tdicola
Cool project, and great write up of the experience!

