Some pi hacking

For my birthday recently I got myself a raspberry pi to play with. I’ve wanted to check one out for a while, and I finally decided to pull the trigger. I got a basic Canakit model with power supply and case, and for the past couple of weeks I’ve been playing with it on and off.

For my first project I’ve decided to try implementing a Magic Mirror. This is a screen mounted behind some one-way mirror glass so that the text of the screen appears to float on it. Before I even start to think of the logistics of how to build the mirror I first needed to get a handle on the software. I downloaded the package and done some basic configuration. I’ve decided that I want the weather, news, and calendar modules for sure, and I might keep the random compliments one around as well. The news one was easy to set up with a couple feeds, however it doesn’t like the generic feeds (but the blogs are OK) from the Washington Post, which bugs me, so that’s on my list to dig into.

My first real change was to alter the weather module to use Weather Underground instead of Open Weather Map. I use Weather Underground on my devices, and wanted to keep things consistent. I started putzing with this a week ago, and then the other day was able to really dig in to create my own version of their currentconditions module. I did run into a few snags that I’ll share in case anyone else runs into them. And, yes other people have done their own ports, but I wanted to try this myself.

First, all modules have to be in the root of the modules directory. Copying and pasting modules in the default/ directory won’t work. You can change them once you move them up a level, but you can’t address them directly inside the default/ directory. Second, you have to name your modules something unique from the defaults. I simply tried adding a couple characters to a default mod I copied and it didn’t work. I had to substantially change the name.

Screen Shot 2017-03-24 at 1.57.08 PMOnce I got that figured out it was a matter of re-learning how javascript works, and parsing JSON. Thankfully, that wasn’t too hard, and before long I had a working replacement module that uses Weather Underground. It’s been fun diving into this all again. I’ve discovered that my Unix chops are as strong as ever, and navigating the pi has been second nature to me. However, all of these programming frameworks have continued to evolve, leaving me in their dust. I had to rely on my general knowledge of programming, and then work backwards through example code to figure out what stuff was. In the end it worked fine, but it was certainly a bit of a challenge.

Now, my brain is tired so I should probably go fill it with some beer…


Beer, running, and geeky things.

2 thoughts on “Some pi hacking

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s