Site Map - skip to main content - dyslexic font - mobile - text - print

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.



Host Image
Host ID: 201

episodes: 25

hpr2340 :: Tracking the HPR queue in Python

Released on 2017-07-21 under a CC-BY-SA license.

In this episode I explain how I use python to track the number of shows in the HPR queue and then turn on a blinkstick to indicate the size of the queue.

Python code included below

#!/usr/bin/env python3

### This is a scratchpad file I've created to try out snippets of code in python

# The script below is for use with Python 3
# This script should work out of the box on most systems running a version of Python 3 
# If you happen to have a blinkstick lying about then your can uncomment the blinkstick module
# and uncomment the references at the bottom of the program that call the blinkstick functions
# Regards, Mr X

# Imported modules
from time import sleep          # used to pause program
#from blinkstick import blinkstick  # used to control blinkstick nano attached to usb port of raspberry pi
import urllib.request           # used to capture hpr webpage content to get the number of HPR shows in the que
import re               # regular expressions, used to find sting in HPR webpage (get_hpr_que)

# These functions control a blink stick nano attached to my raspberry pi USB port #################
# They can be ignored or deleted if you don't have one

def bstick_off():
# Search for all attached blinksticks and turn them all off
    for bstick in blinkstick.find_all():
        bstick.turn_off()   # Turn front blinkstick LED off
        bstick.set_color(channel=0, index=1, name="black")  # Turn rear blinkstick led off
        print("Blinkstick: " + bstick.get_serial() + " turned off")

def bstick_on(colour):
# Turn blinkstick on and set led colour to string value stored in var colour
# valid colours are, black, silver, gray, white, maroon, red, purple, fuchsia, green, lime, olive, yellow, navy, blue, teal, aqua
    for bstick in blinkstick.find_all():
        bstick.set_max_rgb_value(30)        # Sets max blinkstick RGB value to 15, makes LED dimm
        bstick.set_color(name=colour)       # Turn blinkstick on, var colour determines colour
        print ("Blinkstick: " + bstick.get_serial() + " | Colour: " + bstick.get_color(color_format="hex") + " [" + colour + "]")

def bstick_on_random():
# Turn blinkstick on colour random
    for bstick in blinkstick.find_all():
        print ("Blinkstick: " + bstick.get_serial() + " | Colour: " + bstick.get_color(color_format="hex"))

def bstick_blink_red():
# Flash blinkstick colour red
    for bstick in blinkstick.find_all():
        print ("Blinkstick: " + bstick.get_serial() + " | Colour: " + bstick.get_color(color_format="hex"))


def get_hpr_que():
# Goto hacker public radio calendar page and extract the number of shows in the queue
# then return the number of shows as an integer
# also turns on blinkstick LED and sends number of HPR shows in the que to the display

    url = ''   # HPR url for calendar page
        html_content = urllib.request.urlopen(url).read()   # Try to read hpr calendar page
        print("ERROR: Problem acessing url " + url)     # if error accessing url then return -1
        hpr_shows = -1
        return hpr_shows
    html_page = str(html_content)   # convert to string
    line_begin = html_page.find('There are only <strong>') # find position of string in html page
    line_end = line_begin + 70 # Store line end position (start position + 70)
    line = html_page[line_begin:line_end]  # Capture string line
    #print(line) # DEBUG Print line string
    digit = re.findall(r'\d+',line)         # Find digits in line
    #print(digit[0])    # print the 1st digit
        hpr_shows = int(digit[0])   # convert digit list to integer days
    except:                         # If show numbers not found then return -1
        print("ERROR: Problem getting number of HPR shows in que.")
        hpr_shows = -1
        return hpr_shows
    #print(hpr_shows) # DEBUG
    #return hpr_shows
    if hpr_shows > 9:       # If hpr show que > 9 turn on green LED
        print("Turn on green blinkstick LED")
    elif hpr_shows > 5:     # Else if hpr show que > 5 turn on blue LED
        print("Turn on blue blinkstick LED")
    elif hpr_shows > -1:    # Else if hpr show que > -1 turn on ref LED
        print("Turn on red blinkstick LED")     
        print("Flash red blinkstick LED")
        #bstick_blink_red() # Else blink LED to show error
    print("The are " + str(hpr_shows) + " shows in the HPR que...")
    print("Turn off all blinkstick LED's")
    #bstick_off()           # Turn blinkstick off

# Main program

hpr2335 :: Baofeng UV5R VHF/UHF Handset part 9

Released on 2017-07-14 under a CC-BY-SA license.

In this episode I cover the menus 25 to 40 of the Baofeng UV5R VHF / UHF Hand Held Transceiver

  • Menu 25, SFT-D - Frequency Shift Direction [ - / + / 0 ] (Duplex shift)

  • Menu 26, OFFSET - Frequency shift amount - Values (MHz) [ 00.000 - 69.990 ]

  • Menu 27, MEM-CH - Store a Memory Channel [ 000 -- 127 ]

  • Menu 28, DEL-CH - Delete a memory channel [ 000 -- 127 ]

  • Menu 29, WT-LED - Display back-light colour (Standby) [ BLUE, ORANGE, PURPLE, OFF ]

  • Menu 30, RX-LED - Display back-light colour (Receive) [ BLUE, ORANGE, PURPLE, OFF ]

  • Menu 31, TX-LED - Display back-light colour (Transmitt) [ BLUE, ORANGE, PURPLE, OFF ]

  • Menu 32, AL-MOD - Alarm Mode, Activated when Orange button Held [ SITE, TONE, CODE ]

  • Menu 33, BAND - Band Selection [VHF/UHF]

  • Menu 34, TDR-AB - Transmit selection in Dual Watch mode [ A / B / OFF ]

  • Menu 35, STE (Squelch Tail Elimination) [ ON / OFF ]

  • Menu 36, RP-STE - Squelch Tail Elimination through a repeater [ 1-10 OFF]

  • Menu 37, RPT-RL - Delay the squelch tail of re-peater [ 1 - 10 OFF ]

  • Menu 38, 38 PONMGS - Power On Message [ Full / MSG ]

  • Menu 39, Roger Beep, Wikipedia [ ON / OFF ]

  • Menu 40 RESET - Restore defaults [ VFO / ALL ]

hpr2328 :: Baofeng UV5R VHF/UHF Handset part 8

Released on 2017-07-05 under a CC-BY-SA license.

In this episode I cover the menus 12 to 24 of the Baofeng UV5R VHF / UHF Hand Held Transceiver

  • Menu 12, T-DCS - Transmitter DCS: [ D023N -- D754I , OFF ], DCS Wikpedia

  • Menu 13, 13 T-CTCS - Transmitter CTCSS [ 67.0 -- 254.1, OFF ], CTCSS Wikipedia

  • Menu 14, VOICE - Voice Prompt [ ENG / CHI / OFF ]

  • Menu 15, ANI-ID - Automatic Number ID Baofeng UV-5R

  • Menu 16, DTMFST - DTMF tone of transmit [1, 2, 3, 0]

  • Menu 17, S-CODE - Signal Code [ 1-15 ]

  • Menu 18, SC-REV - Scanner Resume Method (Time, Carrier, Search) [ TO / CO / SE ]

  • Menu 19, PTT-ID - When to send the PTT-ID (Beginning, End Both) [ BOT / EOT BOTH ]

  • Menu 20, PTT-LT - Signal code sending delay. [ 0 -- 30 ]

  • Menu 21, MDF-A - Channel Mode A Display [ NAME / FREQ ]

  • Menu 22, MDF-B - Channel Mode B Display [ NAME / FREQ ]

  • Menu 23, BCL - Busy Channel Lock-out [ OFF / ON ]

  • Menu 24, 24 AUTOLK - Automatic Keypad Lock [ ON/ OFF ]

  • DTMF, Wikipedia

hpr2321 :: Baofeng UV5R VHF/UHF Handset part 7

Released on 2017-06-26 under a CC-BY-SA license.

In this episode I cover the menus 6 to 11 of the Baofeng UV5R VHF / UHF Hand Held Transceiver

Link to the Free, open-source tool for programming your amateur radio. It supports a large number of manufacturers and models, as well as provides a way to interface with multiple data sources and formats.

hpr2316 :: Baofeng UV5R VHF/UHF Handset part 6

Released on 2017-06-19 under a CC-BY-SA license.

In this episode I cover the menus 0 to 5 of the Baofeng UV5R VHF / UHF Hand Held Transceiver

hpr2311 :: Baofeng UV5R VHF/UHF Handset part 5

Released on 2017-06-12 under a CC-BY-SA license.

In this episode I cover the rear and front panel features & controls of the Baofeng UV5R VHF / UHF Hand Held Transceiver

hpr2307 :: Baofeng UV5R VHF/UHF Handset part 4

Released on 2017-06-06 under a CC-BY-SA license.

In this episode I cover the controls and connectors around the outside edge of the Baofeng UV5R VHF / UHF Hand Held Transceiver

I couldn't find a link to the supposed problem with the headphone socket on the Baofeng UV5R and despite regularly plugging and unplugging the covert earpiece so far mine seems to be working OK as long as I don't push the plug too far in. Perhaps on this radio it is less of a problem than I first thought.

hpr2301 :: Baofeng UV5R VHF/UHF Handset part 3

Released on 2017-05-29 under a CC-BY-SA license.

This episode will be right up your street if you like rambling podcasts.

I planned to cover the supplied accessories of the Baofeng UV5R VHF / UHF Hand Held Transceiver however somewhere along the line I rambled off topic and started blathering on about a whole range of topics.

I cover the VHF / UHF spectrum, radio frequency, wavelength Omni-directional antennas, mains hum time stamp fingerprinting among other things.

Sit back and enjoy.

hpr2296 :: Baofeng UV5R VHF/UHF Handset part 2

Released on 2017-05-22 under a CC-BY-SA license.

In this episode I go through the general specification of the Baofeng UV5R VHF / UHF Hand Held Transceiver

hpr2292 :: Baofeng UV5R VHF/UHF Handset part 1

Released on 2017-05-16 under a CC-BY-SA license.

In this episode I give a brief introduction and demonstration of the Baofeng UV5R VHF / UHF Hand Held Transceiver

hpr2112 :: My old home server

Released on 2016-09-06 under a CC-BY-SA license.

hpr2106 :: My Podcast Client

Released on 2016-08-29 under a CC-BY-SA license.

This is a show about my podcast client. Apologies for any rough edges as I did it in a hurry to answer the call for more shows

hpr2089 :: Solving a blinkstick python problem

Released on 2016-08-04 under a CC-BY-SA license.

This is a show describing how I solved a problem of using my new Blinkstick Nano in Python, the problem occurred because I inadvertently installed the blinkstick module to the wrong version of Python as I have multiple versions of python installed on my raspberry pi.

A blinkstick is a USB powered device with attached RGB led’s, it can be controlled using a wide range of languages, and supports the Raspberry Pi, Linux, Microsoft Windows & Apple

As a side note I forgot to mention that the blinkstick hardware and software is Open Source

Initially I blindly followed the advice given at which recommended the following commands

sudo apt-get install -y python-pip python2.7-dev
sudo pip install blinkstick
sudo blinkstick --info
blnkstick --add-udev-rule

I discovered that the blinkstick module was not being found when I ran my python script, this turned out to be because I was invoking a different version of python in my script from that which I installed the blinkstick module. I installed the blinkstick module to Python 2.7, my script was running python 3.2

I ran the following commands to rectify the problem

sudo apt-get install -y python3-pip
sudo pip-3.2 install blinkstick
sudo blinkstick --info (Run in my script)
blinkstick --add-udev-rule (Not required 2nd time round)

Here are some links I looked at to get some understanding of what was going on

You can get a list of your installed python modules by first going to the python interpreter by typing python at the command prompt and issuing the following command

>>> help('modules')

You can list your python search path by first going to the interpreter by typing python at the command prompt and issuing the following commands, the search path is the list of system directories that python will search to run things like commands and modules

>>> import sys
>>> sys.path

hpr2071 :: Undocumented features of Baofeng UV-5R Radio

Released on 2016-07-11 under a CC-BY-SA license.

This is a short follow on show listing undocumented features I came across while playing with my new Baofeng UV-5R radio

hpr2062 :: Now The Chips Are Definitely Down

Released on 2016-06-28 under a CC-BY-SA license.

I’d like to start by apologising for the rather fast and excited speaking style of this show particularly towards the end, hope it doesn’t spoil the content too much, it was all done in rather a hurry.

In this show I describe a thought provoking documentary I stumbled upon from 1977, the documentary is about the the silicon chip and explores the far reaching implications it will have on society.

The title for the original documentary was “Now the chips are down”.

I came up with the altered title “Now the chips are definitely down” to signify that not only have the changes already happened but that it’s also had a massive cost reduction impact as my newly purchased piece of equipment demonstrates.

The new piece of equipment that I bought only became so affordable because of the great advances and massive reductions in cost over time. A similar piece of equipment cost me around £120 maybe ten years ago and due to inflation you can probably double the cost again. The price of my new piece of equipment was astonishingly cheap I thought though on reflection its cheap price may also be down to it being a more mass produced item than normal amateur radio equipment.

Links to Horizon documentary

Standard C510A /C510E links

Baofeng UV-5R links

Chirp links

hpr1980 :: Fixing An Audio Problem while having a rant

Released on 2016-03-04 under a CC-BY-SA license.

This podcast details how I solved an audio problem I discovered while trying to record another episode for HPR. I'll hopefully get around to recording my original idea at a later date.

The recording was done in a bit of a hurry and I was a bit flustered so please excuse the fast talking and ranting.

Link to article that solved my problem

Command I used to install the app that solved my audio problem. App is from the standard Ubuntu 14.04 repo

sudo apt-get install alsa-tools-gui

Command to run from terminal to launch gui tool that solved the problem


hpr1709 :: Hacking Your Teeth

Released on 2015-02-19 under a CC-BY-SA license.

This podcast details my experiences with dentists along with a smattering of free advice.

Link to the commonly known sunscreen song

Wikipedia article about gum disease

Wikipedia page on Interdental tooth brushes

Teeth with gum disease, notice that the gum doesn't form a sharp point between the teeth

Healthy gums, gum forms a sharp point between teeth.

hpr1563 :: Starting Programs at boot on the Raspberry Pi

Released on 2014-07-30 under a CC-BY-SA license.

How I start programs at boot on my Raspberry Pi. Below is a copy of the /etc/rc.local file I use on my raspberry pi.

#!/bin/sh -e
# rc.local
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# bits.
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"

################## Added by MrX 28/12/12, ############################################################
#  V1, 21/03/14, titied up script, added explination, run didiwiki and got detached screen working at boot

# items are run in a subshell enclosing command in ( and )
# the commands are terminted with a & to run as background task
# by default programs are run as root if this is not required "su" is used to switch user to pi
# becuse each program is run as a subsheel they all run in parallel this is why the sleep
# command is needed, each sleep command must be longer than the sum of the sleeps before
# which ensures the commands are run in sequence and not together
# exit 0 was from the original file to ensure the file exited with status 0
# if the script doesn't exit with status 0 then the pi will not fully boot

# At boot fources audio aoutput to headphones socket (Analogue output)
# from magpie magazine pdf, issue 3 page 4
(sleep 1; /usr/bin/amixer cset numid=3 1) &

# At boot run the command didiwiki as user pi, listening on IP port 8000
(sleep 3; su pi -c "/usr/bin/didiwiki -l -p 8000") &

# run a detached screen session at boot
(sleep 6; su pi -c "cd /home/pi ; /usr/bin/screen -dmS pi-debian -c /home/pi/.screenrc.multiwin") &

exit 0

hpr1496 :: wiki on the raspberry pi

Released on 2014-04-28 under a CC-BY-SA license.

My experience of playing with wiki software on the raspberry pi, I forgot to mention I run the standard rasbian distribution on my pi if you run something else your mileage may vary.

When I listened to the show I noticed a few mistakes, there may be others as the show was pulled together rather hastily

1. The raspberry pi has either 256 or 512 MB of memory Not KB's oops

2. You can automatically create pages using camel-case words they don't need to start with the word wiki so in my example the page WikiNotes could just as easily be called GuffNotes. This is because at first I didnt appreciate the meaning of the word camelcase, you learn something new every day!

3. Wikidot still provides a free account, oops again!




sed man page

some sed tutorial and examples

hpr1478 :: Batteries Part 2

Released on 2014-04-02 under a CC-BY-SA license.

A show about batteries - Part 2

My Slow Battery Charger Hahnel Powerstation TC Max, provides gentle overnight trickle charging

Powerbase battery electric drill, had difficult finding a good link to an example of the drill. It came with a selection of drill bits, sockets and two double ended screwdriver bits.

Cannon A80 digital Camera

A picture of my trusty Philips 5890 Shaver

Garmin Streetpilot i3 GPS Navigation System

Sansa Clip+

hpr1398 :: Batteries Part 1

Released on 2013-12-11 under a CC-BY-SA license.

A show about batteries - Part 1

I can't take the credit for all this detailed information in my podcast, I found this fantastic website many years ago while investigating why the battery in my expensive razor prematurely failed. I tried to hunt for the site but couldn't find it. I wrote up all my notes from memory and recorded the show. It wasn't until I started working on part 2 of my batteries show that I stumbled across this long forgotten site - at least I think it's the same one as it talks about the memory effect on satellites and doctor's pagers so I guess it must be the same one. I'm indeed delighted to find it still exists, and I may very well read it again from top to bottom. It looks like it's been updated a little too. Well done ka7oei a fantastic resource right enough.

Site title: "About NiMH and NiCd cells and batteries (And a little about LiIons, too...)"

A picture of my trusty Philips 5890 Shaver

Memory effect

Doctor's pager

Sansa Clip

Two Possible Chargers (For use in the UK)

I found it very difficult to find a slow trickle charger, here are two possibilities, you may need to settle for a fast charger as the slow ones now seem to be like hen's teeth, (VERY HARD TO GET).

This is perhaps a little slow with a charge current of only 150ma, would take about 17Hrs to charge 2100 mAh batteries.

The charger I use is made by the same company as this although mine is a different model. My model charges at 200ma, and takes about 13 Hrs to charge a 2100 mAh battery. I can't tell what charge current this charger deliveries, but suspect it's a simple slow charger, probably old stock, as I said slow chargers are getting like hen's teeth.

hpr1348 :: Fuse

Released on 2013-10-02 under a CC-BY-SA license.

A show about a 2nd world war fuse that had been in the family for many years, it originally belonged to my grandfather

Here is a link to the British Ordnance Collectors Network forums, which has a picture of a collection of German bomb fuses, the one my grandfather had looked identical to the one on the extreme left hand side of the picture entitled "25A".

hpr1047 :: Soldering Part 2: An audio demonstration of soldering

Released on 2012-08-07 under a CC-BY-SA license.

Here is a list of useful links to go along with my 2nd episode in soldering

A very detailed page on the art of soldering, lots of good tips hear if you want further reading

Bottle of flux like the type I used at work

Tin of flux like the one used at work

Perf board or strip board, I accidentally called it bread board which is something completely different

Wikipedia entry for Perf Board or Strip Board

Bread board is used for quick lash ups where soldering is not required as you just push the components into the holes on the board

hpr1037 :: Soldering Part 1

Released on 2012-07-24 under a CC-BY-SA license.

A show about the tools needed for soldering

Example of a battery powered soldering iron (similar to the on I had)

Weller soldering gun kit similar to the one I owned

Portalsol Iron (My gas powered soldering Iron)

Antex iron, with soldering stand and sponge (The one I fitted I diode to)

Weller magnostatic work station (Similar to the one I used in the early part of my career)

A modern Weller magnostatic work station

An example of my Weller temperature controlled iron, mine is almost as scabby as this one!

An example of a soldering sponge

An example of a dry joint

Wiki entry on Heatshrink sleeving

small jewelers screwdrivers I own

hpr0911 :: Hobbies

Released on 2012-01-27 under a CC-BY-SA license.

A show about the hobbies I've had over the years

The Secret Life of machines videos by Tim Hunkin, originally broadcasted in the UK in around 1980

Ohms Law

Information about the thermionic valve

Calculating Wavelength

Small Yaseu FT 817, Multi Mode Hf, VHF and UHF transceiver 19:00

Base Station Kenwood TS 940S, Multi Mode Hf Transceiver 19:00

Amiga 500 Computer

Beginning Ubuntu Linux from novice to professional

Linux Pocket guide

Wicked cool shell scripts

Raspberry PI, micro Computer for $35

Become a Correspondent