Revisiting the Relay Panel and a Raspberry Pi Tech Tip for WebIOPi fans

As one of my earlier projects, I set up a Raspberry Pi with some relays to control my systems remotely. This allows me to warm things up from the couch before I head to the shack, or if COVID ever goes away, to fire up the radio remotely.

2016 photo of the relay panel.


So it’s been several years since I made any updates to the Raspberry Pi that makes all that work. I remember rolling back from a Raspbian update because it broke some functionality and I wasn’t in a place to spend time on it. I finally found the time this week, 3 YEARS later.

As I write this it is January 15, 2021


So I decided to start from the ground up with the latest version of Raspbian and reinstall WebIOPi, which is the software I am using. WebIOPi allows me to use the GPIO pins to control the relays using a web interface. I had spent a little time customizing it for my shack so I wanted to keep using it. Unfortunately it hasn’t been updated in 4 years.

My quick GUI for controlling lights and radios.


After struggling with the latest version of WebIOPi (0.7) and dealing with “invalid syntax in thread.py” and “Attribute error” issues related to my Pi 2B, I found my savior on GitHub. https://github.com/doublebind/raspi

Follow the instructions theree and you are good to go. I’ll be pleased if it will run another 3 years with no need for updates.

My Raspberry Pi version of the Big Ben Clock

Last winter, early post retirement, I was tinkering around with one of my many clocks one day and added the chimes of Big Ben to it. Whenever I would visit my grandparents growing up, I would hear their clock that struck the Windsor Chimes and I always thought that would be a fun project.

This was fairly straightforward, I grabbed some sound files from the UK Parliament website and one other source for the 45 minute chime, and did a little editing. Work done implemented via CRON in a couple of hours, fast forward on to other things.

A few months later and I am on the phone with my mother and she hears the chimes in the background. She starts reminiscing about the sounds and her parents clock and I agree to make something for her.

This video documents the major elements of the build but here’s the parts list:

– Raspberry Pi Model 3 B with Raspberry Pi Touch Screen – I have had good luck with Canakit and Adafruit if you are looking for sources.
Basic USB Powered Speakers
Micro USB Power Cable with switch
16 GB SanDisk Class 10 Micro SD Card
– 1/4 inch Birch Veneer Plywood
– Gloss White Spray Paint

The Software Build

I had all the sound files to go on from my build into my exciting digital clock, so no additional work done there. One tricky bit was to get the hourly chime to trigger at about 59:40 after the hour so the big ben bell would start striking the hour right at the top of the minute. Since CRON works on minutes, I solved that by making a 59 second file. So the file starts at 59 after but plays a silent section for the first 40 seconds before the chime.

How the hourly Big Ben bell plays: CRON is programmed at xx:59 to trigger a shell script that first plays the chimes, this is the file mentioned above. It then triggers the Big Ben bell sound, and loops the appropriate number of times for each hour. Here’s an example of the code for 9 o’clock. There are 12 files, 1 for each hour.

#!/bin/bash
#export XDG_RUNTIME_DIR="/run/user/1000"
mplayer -really-quiet "/home/pi/chime/h59.mp3" -volume 100
mplayer -really-quiet "/home/pi/chime/bong.mp3" -loop 9 -volume 100

A couple of new skills for me were achieved on this project. The first was working with JavaScript clock elements for an analog clock. This came together by adding the face of the Great Clock as a background image, editing the photo for size and removing the hands from the face. I then found some similar looking clock hands and did a JavaScript analog clock overlay via HTML. Adjusting the pivot points for the hands took some time, they would drift around the clock face until set just right.

The other element to this was hardening it so it was hands off for mom. With her being 1,000 miles away, I couldn’t do a local install so it had to be right. I had her send me her WiFi info so I could pre-program it on the card. I chose USB powered speakers with an on-cord volume control so she could just lift the touch screen off the case to adjust. Also added a “kill switch” to the back for easy shut down. Finally I included a backup USB card in the case incase the current one is corrupted and I keep an image on my NAS as well if needed.

I did not put a RTC in the Pi. Partially because some of the GPIO ports I wanted we used by the Touch Screen and partly because I had the clock programmed to get NTP time via WiFi so there would be no updating needed.

The Hardware Build

I started with the standard elements I knew the Raspberry Pi 3B+. I chose the B+ because I didn’t need the horsepower of a Pi 4 for a basic display and I had one I had recently swapped out for a Pi 4 on another project. I used the 16 GB Class 10 MicroSD cards in all my Pi projects. They rarely corrupt for me when powered correctly, they offer enough space to power most projects I do, and the are small enough to back up on my NAS without completely killing storage.

I’ve used the Pi Touch Screen in a couple of other projects and it’s very easy to set up and control the display natively. In most cases I also use a commercial Pi Touch Screen stand however in this case I wanted to hide the electronics and let the clock be the focal point.

I tried to build a simple box that would hold the Pi, Screen and Speakers and I accomplished it, but I might do it differently in the future. I assembled the 4 structural elements first, the 2 sides, back and the bottom. Small birch strips held the front out from the back of the box to provide a little extra room.

On the first attempt, I made the face frame from a single piece of plywood cut in 2, so I could notch out the hole to mount the touch screen. I wasn’t really happy with the fit or the structural integrity of that, so I started with another single piece, made a small slat through which I could cut a hole for the screen with my band saw and then used putty to seal the small gap, which worked much better.

Several other holes in the box to allow for air flow, speaker audio to escape and power. I was going to put some grommets on the rough wooden holes I cut in the back but I had to give that up for time so I could get it to Mom by Christmas.

Great news is that it arrived on time and worked perfectly. We plugged it in about 10 minutes to one and by 12:59 it had synced up with the NTP server for a real time update and was playing it’s chimes.

Before it comes up

I intentionally have not packaged this all up as a GitHub project or some other repository. I don’t own the rights to all the photos or sound files. Hopefully your build will use all the open source stuff!

Other questions on my build? Contact me on Social Media…

– Facebook: facebook.com/N4BFRVision
– Twitter: @N4BFRVision
– Reddit: u/N4BFR

I was not paid in any way for this build or post. Some of the links in this post lead to shopping sites, however I make no commission. If this post helped or inspired you, consider dropping something in my tip jar.

The N4BFR Response to a “Show Us Your Ham Shack” Request

N4BFR “Tech Center” Ham Shack on December 2, 2020

For their next Zoom meeting, the Atlanta Radio Club is having a “show us your shack” session so I thought I would use this time to share mine along with some detail on what’s there. For ease I have numbered many items and linked to more information where I can.


Let’s start from the top left:
(1) Photo & Certificate: The photo is the cover of QST Magazine from August 2011 and a copy below of the short article and a photo from the Coca-Cola 125th Special Event Station the Atlanta Radio Club put on. The certificate is my Volunteer Examiner certification, it lets me be part of a testing team for new ham radio licenses issued by the FCC.

(2) Part of my microphone collection, along with a couple of other odds and ends. (2a) is the Heil Sound Classic Microphone which I added the call letters to in this YouTube video. (2b) is the Shure 55SH which inspired my N4BFR Vision logo.

(3) is the brass and wooden Watch Stand I made back in July. Next to it is an old Western Union sounder that would summon someone to your shop to pick up a telegram.

(4a & b) are JBL Control 2P speakers. I’ve had these 2 years now and I really recommend them, they sound great. Not shown, but for PC audio I use the Schiit Modi 3 DAC and I can really tell the difference a better Digital to Audio converter makes.

(5) is my lighted call-sign sign I bought to celebrate 10+ years in Amateur Radio. It’s made by Gifts4Hams.com which does a lot of very nice laser engraving. I have a QSL card chest from them as well. Under the sign is the Heath GC-1000 “Most Accurate Clock” which was part of my 24 Hours of Clocks YouTube experiment. Between that and the speaker is a Ducati desk mic I found at an estate sale.

(6) is more of a memory wall than anything else. The panels are by Wall Control and I liked them so much I ended up redoing my workbench with them as well.

(7) is one of Ham Radio stations I have in the room. When I designed this 8+ years ago this was set up to be a contest shack that we could run Morse and Voice in at the same time and we even worked a third station in for digital. This station is named “Edison”. The radio is an Elecraft K3 with a Panadapter. This station uses a Raspberry Pi 4 4GB for logging, digital modes, and just about anything I need.

Showing on the Edison monitors is my dashboard for all the Raspberry Pi clocks (like this one powered by a Pi Zero W and GPS board similar to this one. ) – it also shows some international clocks I did via HTML. On the right monitor is the control window for my DV Access Point Dongle for a home DSTAR Hotspot and the control window for my APRS IGate powered by a Yaesu FTM-100, A Rigblaster Plug & Play and a Raspberry Pi 3.

(8) is a Tivo Mini, I can repurpose one of the Edison monitors for TV and run the audio through the JBL speakers for watching news and weather.

(9) are antenna controllers. On top is the SteppIR SDA2000 Controller for my SteppIR Urban Beam antenna, and below it is a Yaesu G450A rotor controller that I put an add-on board in for control from my PC.

(10) Are the Wright and Sputnik monitors where I monitor things of interest. Wright is on the top and I think of these two as a dashboard, it shows Local and UTC time, temperature inside and at KPDK, my ADSB receiver so I can track planes in the neighborhood and I manually keep antenna configuration displayed. On the bottom is Sputnik which tracks the International Space Station via a program called GPredict. Since my 70 Amp Astron 12 Volt power supply is not where I can see it, I use a Raspberry Pi Zero W as a Web Cam to see the status dynamically. I also keep a text log of states I need to complete my ARRL Worked All States awards and the web interface for my PiStar hotspot which gives me DMR access. Wright and Sputnik are powered by separate Raspberry Pi 3’s in Kiosk mode.

(11) My handhelds for DStar and DMR. Currently using a Kenwood D74A for DStar and APRS, and a used Motorola XPR6550 for DMR.

(12) starts the big “Tesla” work station where I spend a lot of my time. I have gone through different monitors but I expect these LG 27UD68P 4K HDR monitors to last me a while. Not shown but they are powered by an ASUS ROG Gaming PC I picked up a few years ago.

(13) is my Flex Radio 6500 HF Radio. This is a terrific radio, a big step up over the Elecraft K3 (which is a wonderful radio in it’s own right). 4 tuners, covers DC through 6 meters, plenty of expandability and integration. I also have the (13a) Flex Radio Maestro for listening and operating around the house or the neighborhood via Wifi. I am really glad I got on this system early on. I am thinking of upgrading to a 6700 for even a few more features, but I haven’t pulled the trigger yet.

(14) For VHF / UHF and D-Star I have the ICOM ID-5100 radio, which I liked so much I bought 2. One for the shack and one for the car so I don’t have to learn 2 different radios and I can share programming in-between them with SD Memory cards.

(15) Mixes 6 different audio sources including the radios and PC plus and Alexa and the TV. It’s the Behringer Eurorack Pro and it’s just what I need. I tried a fancier PC controlled mixer for about 6 months and for simplicity of being able to reach up and turn the knobs or mute something quickly, it can’t be beat. By the way, the Flex and Mixer are mounted in 2 wooden stands I custom made. Just below the mixer is a 7-Segment clock I made with a Raspberry Pi (are you getting a theme here?). Under that is an eInk display I use to track when future SpaceX launches are. Yes that is powered by a Pi as well.

I think that wraps it up. I would love to get questions on any of this or have discussions or even give support. Check me out on Social Media at https://www.facebook.com/N4BFRVision or https://twitter.com/N4BFR_vision.


Disclosure: All of the items above were chosen by me and comments are my personal opinion, I received no special discounts or materials. Some of the links above go to Amazon.com. If you purchase through those links I may receive a commission.

Google is my Tech Support

Had one of those weird things that occurs where one of my Pi’s had a corrupted password. Ugh! So, a quick Google Search for “Forgot Password on a Pi” popped the answer right to the top!

http://mapledyne.com/ideas/2015/8/4/reset-lost-admin-password-for-raspberry-pi

I’m back in and ready to code!

LCDClock – My First Github Project

I’ve used Github quite a bit to source either partial or complete code for many of my Raspberry Pi projects. Github is a code sharing platform that makes it easy to get and keep software updated on devices like Raspberry Pi’s.

When I first created my Pi-clocks I made one with an LCD display that showed local and UTC time. You can see it in this leap second video from 2015.

Five years later that clock has been long out of commission as I do upgrades and other clock projects, but I missed having the LCD clock. So as I worked on the Chrony project I decided to rebuild one as an LCD clock. This has taken me deep into the world of Python and I am sure when someone looks at it there will be comments like “it’s clunky” or “why didn’t you do it this way.” All valid I am sure, but I made it work and even built in some error handling so I feel pretty good for a start.

Starting with the basic Chrony build, the LCD screen gets added from Adafruit. In the last 5 years they have evolved to a version of python called “Circuit Python” to drive many of their devices, so I went with this as the base code to drive the display.

sudo pip3 install adafruit-circuitpython-charlcd

As part of the new design, instead of using this to be a UTC clock (i have plenty of those), I wanted the clock to display variables. The first one I chose was to display the Stratum of the clock. This assures me if I see “Stratum: 1” that I am getting the time from the satellite data. I get that by running a CRON job to output that data to a text file, then I read that from the text file with the Python program. The CRON line that runs every 2 minutes is:

/2 * * * * chronyc tracking > /home/pi/lcdclock/tracking.txt

The second variable is the current IP address of the clock. Always helpful if you want to do some quick editing. That’s a standard python variable, so no additional libraries were needed.

The third variable is the current GPS position. To grab that data I use the gps3 python client to pick up the location of the clock. While this generally won’t change, I might take this on the road in the future to a ham fest or Field Day. There are a bunch of variables I could have pulled, but Lat/Long is just what I needed.

sudo pip3 install gps3

The last variable is a vanity card. I created a file called “msg4.txt” that can be used to display any message in the last 14 second window. Maybe in the future I might make it a YouTube follower counter.

You can grab the code from GitHub here:

https://github.com/n4bfr/lcdclock.git

Here’s how it all comes together:

I’m eager for feedback! Here’s where you can give me notes:
– The N4BFR Vision YouTube Channel
– My Facebook Page: https://www.facebook.com/N4BFRVision
– My Twitter: https://twitter.com/N4BFR_Vision

Follow Friday – YouTube Edition – April 24

Time to share what I am watching, hope it inspires you to watch something new.

Simone Giertz
The queen of shitty robots is awesome. In her most recent video she makes a “proud parent” machine and uses a bunch of dirty words. Which is awesome in so many ways.



Fran Lab
Fran has a very similar taste in projects to me. I found a Heathkit GC1005 clock to refurbish at the Orlando Hamcation, back before we had to social distance. Come to find out Fran had recently refurbished one which really helped me. Mine is still in progress but check out Fran’s here.



Mythbusters Jr.
I didn’t really jump into this because I was put off by the non-Adam version that they tried to reboot through a reality show. Lots of fun builds here. I was really hyped to find a Breaking Bad episode.


Whose Line Is It Anyway Cocktail Hour
Every Monday the cast from Whose Line gets together to preview the show and basically talk s#!t. It’s fun to watch with your feet up. Here’s the video from Monday 4/20.


I have a YouTube Channel too
I talk about clocks, ham radio and other nerdy stuff. I just added a video of the Chronometer Raspberry Pi clock I built this week. As they say, please Like, Comment and Subscribe!

Chronometer – Quick Pi Project

I came across a Reddit post by u/rothman857 that made a Raspberry Pi Clock he calls Chronometer with a really unique view of time. They bring in a bunch of different formats like Solar Time and Metric Time. Since I like time and I’m interested in those views, I thought this would be a fun build.

As a net time to make this, it only took me a few hours to get going. I recommend using the screen he specified which is a quick Amazon order. I tried this with another screen I had and it just didn’t work out. Most of that time was learning two functions I haven’t explored before, changing the video settings and console fonts. A few notes on those items if you are building.

Setting Pi Screen Resolution
The display uses a unique setting of 480×320 which I couldn’t seem to drive with a default setup. So using the Raspberry Pi Documentation, I made a custom configuration.

sudo nano /boot/config.txt

I commented out all the existing video settings and added these to the end, which worked for me:

#custom for Chronometer
hdmi_force_mode=1
hdmi_group=2
hdmi_mode=87
hdmi_cvt=480 320 60 1 0 0 0
hdmi_drive=2

Setting a fixed console font
My first try was to use this article at stevencombs.com which in hindsight may have worked if I had specified the Latin and VGA font I wanted, but when I went with the instructions as written it didn’t take the way I wanted. As a follow-up I experimented with several of the suggestions in this StackExchange thread. The “.profile” change didn’t work for me, so I tried Eric Woodward’s suggestion of changing in console-setup.

sudo nano /etc/default/console-setup

#custom for Chronometer
CODESET="Lat15"
FONTFACE="VGA"
FONTSIZE="8x14"

That’s it. Install and run the chronometer.py program and run it. You’re good to go.

Final thoughts. I like this kind of project because I learn more about the inner workings of Pi and I feel like it’s something I can go in and tweak later. For instance, I would like to make one of the time displays be similar to the Union Square Metronome. I will share progress if I get there on my project list. Obligatory video below.

Raspberry Pi with Chrony

I’ve been a fan of having a Stratum 1 time server on my LAN ever since I first read GM8ARV’s page. One of my first ones can be seen in the background on my YouTube video about Leap Second tracking.

I found an article last week where Facebook has been doing analysis on time server software and has come to the recommendation that the Chrony software is better than NTP for performance. I’ve actually been using NTPSEC for a couple of years now, but I am open to change so I’m setting up a Chrony server.

Follow Friday

I have been heavily into the YouTube thing over the last few months, and I have some old and new favorites. Enjoy this week’s nerd-heavy list of things to watch.

SpaceX

Want to watch cool rocket stuff regularly? SpaceX is about to become the first American company to send american Astronauts to the ISS in over 10 years. Plus their launching an internet satellite constellation and working on this little “trip to Mars” thing.

The Modern Rogue

This has a “Mythbusters meets Magic and other Scams” vibe as two “Professional Idiots” do things like making homemade thermite to cook steaks, play with RFID, discuss everyday carry items and even a little ham radio.

The Lockpicking Lawyer

The Lockpicking Lawyer has an artists touch. His videos are super basic, pretty much a camera and a lock, but he gives you a lot of different insights on build quality and how some things are safer than others (avoid TSA locks). Great way to get under the mechanics of how these things work in our daily lives.

Techmoan

I think he’s most well known for his camera reviews, but I really get into all the retro-tech items that he covers. This particular video shows a German 8-track style record player, but he’s covered old computers, hi-fi and phones as well.

TWIT

I feel like Leo Laporte is my older “brother from another mother.” He’s successfully put together a podcast network, TWIT, that covers tech news, photography, internet security, Apple, Android and more every week. I greatly enjoy his Tech Guy radio show podcasts every Saturday and Sunday.

And a plug for me

Part photography, part ham radio and Raspberry Pi tech, part cat videos, Space stuff, just what interests me that day. I’m having fun sharing and making new stuff, so please subscribe just to see what the hell I am going to do next.

More next week!

Polishing on the FrankenPi

FrankenPi Version 1.1

Two weeks ago I published a blog post detailing the creation of a Raspberry Pi based APRS tracker and Pi-Star hot spot. I’ve made a couple of enhancements since then and I thought I would share an update.

Going with a dedicated 4G connection

I had planned on using my mobile phone as my WiFi connection for getting packets into and out of the unit. During my testing, getting in and out of the car and having the Pi reconnect to the Wifi hotspot was not as seamless as I would like. So I added a 4G connection with a Netgear LB2120 4G Modem.

“Jim, why didn’t you get a Wifi modem?”

– Me to myself.

Why didn’t I? Well, I did want something I could directly connect to, and I though the device I purchased had wifi. But it didn’t so I made the most of it. I knew I wanted something with Ethernet so in the future this could go on my LAN so all is not lost.

Pi as a Wifi Hotspot

Another part of having a 4G connection was to have diversity of networks as I travel. I had a breakdown on the Blue Ridge Parkway last year and my Verizon phone had marginal coverage when I really needed it. I put this on the TMobile network, so I could make a quick Wifi call if I had to in a pinch.

Since the Netgear does not have Wifi, I added Wifi Hotspot functionality to the Raspberry Pi. It’s not what I would use every day for a Wireless Router, but it will work to do some configuration or make a quick call. I bounced around to different instructions as I customized this, so I don’t have one clear place to point to for a “how to” but you can start at RaspberryPi.org.

Which Digital? Why not D-Star and DMR?

I did a lot of programming of my radios to get the ready with the latest D-Star reflectors, and believe me http://www.dstarinfo.com/ is my go-to site. While that is ready to rock, I thought I might want some DMR along as well. Instead of turning them both on at the same time, I configured 2 SD cards. One will boot up with D-Star configured on the Pi-Star, the other with DMR.

I am hopeful that this will make it easy to switch on the fly at the next stop I make without too many hassles.

And a Big Battery

While I was wandering around the half-empty shelves of my local Fry’s Electronics I found a nice deal on a 20K mAh battery. I also dug in to Amazon to find a 5V to 12V upconverter for the Netgear device.

Big battery!

The two devices combined draw less than 1 amp, so I’ve had this running for >12 hours with battery to spare. I intentionally did not mount the battery on the board to make it hot -ish- swap-able if needed.

I don’t expect to polish much more on this before I depart in 10 days but always open to suggestions on changes. Connect with me at the links via the site.