HPR2353: RoboThermometer

Written on:August 13, 2017
Comments
Add One

I’m still recording stuff: here’s proof!
Yes, I know, it’s been far too long. Never mind my excuses, but I’m trying to ramp up and do this more often. It’ll probably help if I stop trying to make every episode a “full and complete” work on its particular topic, because that seems to always end up taking me far too long to research, write up, research some more, discover something has changed since I last researched, write up again, etc. That’s why this episode is only about 12 minutes long instead of being an hour-long documentary on the concept of “temperature” and the inner workings of the DS18B20 integrated circuit and probably at least one allegedly-humorous comment about “caloric fluid”. If you just want to know how to plug a temperature sensor into a RaspberryPi board and use it to log temperatures, this episode should give you what you need, though.

I’m amenable to being repeatedly harassed online until I get something recorded, so if you want to hear me talk about anything, please post in the comments, either here or at the official Hacker Public Radio page.

As usual, you can find the original posting of this episode in traditional deprecated ogg-vorbis format, obsolete .spx format, and really obsolete legacy .mp3 at the official Hacker Public Radio posting for it.

However, of course, if you’re really cool, you came here for the modern, awesome .opus version of the episode, complete with fully-populated metadata including embedded show notes.

This time around I encoded it at a mere 28kbps. The intro/outro music sounds a bit tinny but not too bad, but the voice still sounds great, and the file is actually even smaller than the official .spx encoding – you should even be able to actually listen to this file in “real time” over nearly any dial-up modem or GPRS link, if you are in a position where that’s your only connection to the internet.

As always, if you want to listen to this audio in a more full-featured media player, you can right-click-and-download the file directly right here. Of course, you can also just listen to it right here on this webpage:

The Show Notes:
Sorry this is such a short episode. I don’t know what came over me, I was just listening to Mr.X talking about doing something with Python in Hacker Public Radio episode 2340, and for some reason I just felt a compulsion to record _some_ kind of episode myself. It was so strange. I’m way behind on my Hacker Public Radio contribution duties anyway, so here’s a quick, geeky tutorial about a thing I did with a Raspberry Pi just to try it.

The temperature sensor I’m using is one of the many “1-wire” protocol devices supported by established kernel drivers, hence the reference to loading the modules for it:

sudo modprobe w1-gpio
sudo modprobe w1-therm

The part about adding “dtoverlay=w1-gpio” to /boot/config.txt and then rebooting is also necessary, otherwise the modules load but no devices show up in /sys/bus/w1/devices/ .

Part of the fun was coming up with a way of extracting the temperature reading in useful form without having to write a bunch of unnecessary python code. Not that there’s anything wrong with python, but I get the impression that some people think everything “RaspberryPi” has to be written in python. An example of this that amused me is the piFM project, which cleverl abuses the first-generation Raspberry Pi spread-spectrum circuitry to turn it into a surprisingly powerful FM radio transmitter. This project had two ways to run it – the actual compiled C program that takes input audio and makes FM radio come out…and a python “module” that was literally just a system call that…ran the C program that takes the audio and makes FM radio come out.

Examples of reading the temperature data that I ran into tended to also be short python scripts, so I took it as a challenge to do without, resulting in the fun-to-recite command in the episode, which on my system is:

echo "scale=3; (`grep -o "[[:digit:]]\{5\}" /sys/bus/w1/devices/28-05167380f6ff/w1_slave`/(5000/9))+32" | bc

As an example of what you get with a correctly connected and configured DS18B20 module on a Raspberry Pi, in my case the device shows up as:

/sys/bus/w1/devices/28-05167380f6ff/

Your device’s number after the “28-” will be different, so just replace my example with your own device’s number.

If you read the “w1_slave” virtual-file in that directory, you get something that looks similar to this:

67 01 4b 46 7f ff 0c 10 c4 : crc=c4 YES
67 01 4b 46 7f ff 0c 10 c4 t=22437

To be _completely_ proper, one probably _should_ validate that output to make sure the CRC matches so you know for sure that the read of the temperature data was correct, but I’ve had Zabbix checking my living-room temperature once every minute for a couple of days now and seen no odd readings or failures, so I’m not going to bother making anything more complicated than my hypnotic one-liner. I probably will, though, if I ever try to use the same kind of setup to monitor something more important, like a tank of expensive fish or a bioreactor full of beer.

If you want some more detailed connection instructions for the DS18B20 temperature sensor and the Raspberry Pi, here is one of the many online pages with the whole process:

https://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing/hardware

HPR1989: WDTV Makes Me Itch (Enhanced Edition)

Written on:March 16, 2016
HPR1989: WDTV Makes Me Itch (Enhanced Edition)

This is the “enhanced” podcast for HPR1989 – in addition to being in the high-quality yet lower-bandwidth .opus format, the file linked herein contains proper Chapter markings in the proper metadata format along with a full complement of additional metadata, including an embedded copy of the show-notes. Therefore, if you download this file, you’ll have high-quality audio and all of the useful supplementary material all gathered together without having to…

Read more...

You’re going to want to be sitting down for this…

Written on:March 7, 2016
You’re going to want to be sitting down for this…

I did it. It’s too late. Nobody can stop me now. I recorded a thing. No, really, and not only that, but I uploaded it to Hacker Public Radio! I’m pretty sure everyone assumed I’d been abducted by ravenous space-alien humanitarians (i.e. like “vegetarians”, but for humans instead of vegetables) but that’s not what’s kept me from getting recordings done at all. Now that the ordinary audio is uploaded into…

Read more...

*3* HPR episodes in progress…

Written on:February 8, 2015
*3* HPR episodes in progress…

I started up a “grab-bag” episode covering three sets of topics and realized each one had plenty of material to be its own episode, so now I’m working on 3 episodes… An episode on “Things to do with discarded/obsolete Android phones” (part 1: stuff that you can do by just installing and running free apps without root access or custom firmware) has plenty of fun in it, and will end…

Read more...

HPR1513: “Stir-Fried Stochasticity: Bio-Boogers”

Written on:May 15, 2014
HPR1513: “Stir-Fried Stochasticity: Bio-Boogers”

This is actually a show-concept I started playing with intermittently half a decade ago (before I became a Hacker Public Radio contributor), where I would find a scientific paper that was either over-hyped in the news OR (preferably) was about such an ordinary piece of useful scientific work that nobody’s University PR Department bothered to turn it into a breathless press release, and then record a “science news” show episode…

Read more...

“Audio Metadata in Ogg, MP3, and others”

Written on:December 6, 2013
“Audio Metadata in Ogg, MP3, and others”

(Now that it’s come out in the official Hacker Public Radio feed, here’s the even-more-awesome opus version. If you want the Ogg Vorbis, Speex, or crappy-old-mp3 versions, check out the official Hacker Public Radio page instead) “Today’s episode discusses (and encourages) the use of metadata tags in audio files. Most of the episode is spent on id3v2.3 metadata for mp3 files) and vorbiscomments (metadata for opus, ogg vorbis, flac, and…

Read more...

Next HPR episode finished!

Written on:November 26, 2013
Next HPR episode finished!

Finally, after taking too long again (but still maintaining the trend of reducing the time between episodes…), just a few minutes ago I finished tweaking and uploading my most recent topic: “Audio Metadata in Ogg, MP3, and others“. It’s about 45 minutes long, covering mostly id3v2.3 (MP3 metadata) and vorbiscomments (virtually-everyone-else-that-matters metadata), but I also talk a little about matroska/webm metadata, mp4 metadata, wav, and “windows media”. This one took…

Read more...

Next episodes…

Written on:July 8, 2013
Next episodes…

Still working on things – version 1.1 of the Opus codec reference software is due any day now, so I’m waiting to see the final word on what’s new in it besides the general “even better quality”. Busy season is upon us here at the Asylum for the Sufficiently Nerdy, so it’s gotten somewhat more difficult to find large chunks of time to carefully research, assemble information, and record it…

Read more...

New episodes coming up Real Soon Now!

Written on:June 13, 2013
New episodes coming up Real Soon Now!

I’m going to cover the Opus codec and posting legally-free audio on the web as the next episode. Ingress is just now starting to get some changes that should make it substantially more interesting (and it was pretty interesting to begin with, I think!), but not only do I want some time to actually try out the changes, I think the subject of the Opus codec is getting relatively more…

Read more...

HPR1233 – Playing Ingress

Written on:April 24, 2013
HPR1233 – Playing Ingress

My third HPR contribution is now up at Hacker Public Radio. Now, if you’re interested in Google’s new location-based game, Ingress, this should hopefully be a reasonable, minimally-lame and hopefully unstupid introduction to the topic. Let me know what you think – I’ve got a followup episode to do, so now’s your chance to throw in suggestions to make it better. Thanks! Meanwhile, assuming you’re using modern web software, you…

Read more...

Bad Behavior has blocked 106 access attempts in the last 7 days.