RPi GPIO: Adding switches and lights


Create a pair of LED’s and push buttons on my RPi which can run scripts. ?One will shut down the Pi (updated here), the other will rsync a directory to a USB. Also I will read the status of a UPS. This may/will become more complicated since the UPS doesn’t have any useful interface (requiring an Arduino to:

  • Watch the UPS battery voltage and tell the RPi to power down.
  • Monitor whether mains power is applied.
  • Once mains is re-powered, restart the RPi after a UPS shut down using the hardware reset pins on the Pi.)
  1. As in these RPi ubuntu instructions I installed python.. I removed sudo from the last command to make the command output happy
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-pip
pip install RPi.GPIO
  1. Initially I set up a breadboard as in this youtube video (using the linked files)
    from time import sleep
    import RPi.GPIO as GPIO
    GPIO.setup(12, GPIO.OUT)
    while 1:
     GPIO.output(12, False)
     GPIO.output(12, True)

    Continue reading “RPi GPIO: Adding switches and lights”

VPN Server on RPi Ubuntu

I installed OpenVPN on my RPi 2 running ubuntu 14.04 using these instructions. Initially it failed, the problem being that I hadn’t allowed UDP port forwarding on my WAN router…

running scripts on Ubuntu 101

These instructions show a simple script that returns “Hello world”.

I moved my script to /usr/local/bin/ (as recommended here) so it can run without the full path.. pretty cool.


I can create aliases:

alias l='ls -l'

as well as functions:

today() {
    echo -n "Today's date is: "
    date +"%A, %B %-d, %Y"

I added a bin directory to my home directory, and added it to .bashrc to allow execution from there:

export PATH=$PATH:directory

Rooting my Galaxy S4 GT-i9505 running Lollipop

This process has so far hit a few hurdles – initially I tried to use the CyanogenMod instructions although these just lead me to a bunch of problems… (not updated for lollipop ((also this wouldn’t have necessarily rooted the phone)) etc), but it looks like I’ve got it successfully working. Here’s how:

  1. I used the latest ‘Odin’ which can set the device to load a recovery file.
  2. I moved the stable .zip release of SuperSU from here onto the phones SD card.
  3. Shut down the Galaxy, then boot to ‘download’ mode by holding the volume down + home key+ power key at the same time.
  4. I loaded philz touch recovery GT-I9505, from these instructions. I should really spin up a VM if I’m going to download random software from… dropbox :/
    • basically once the phone is connected to odin in download mode, click the AP button and select the philz touch file – probably should have found a better source for this file :/ . Also under options auto reboot was selected. This just means as soon as the file is loaded it will reboot. At this time you need to hold volume up+ home key+ power key at the same time to boot into the philz touch recovery
    • I accidentally read method 3 and applied step 7 from Method 3. Seems ok..
    • I loaded the SuperSU .zip from the SD card, noting that I downloaded SuperSU from here.. which doesn’t seem totally un-reputable
    • Rebooted the phone using the reboot option and installed SuperSU from google play (I also installed f.lux to help my sleeping pattern).

EDIT: looks like I broke wifi so I then installed cyanogen using the recovery boot with Odin (after a factory reset in recovery mode)
After Wifi broke I needed to perform a factory reset using recovery mode in order to get Cyanogen to work. Which I’m kinda stoked it did. Now I’m installing the google play store.

So that didn’t work.. Trying the latest cyogenmod (release version). Now for the corresponding Open Gapps.. keyboard doesn’t work (maybe could try a different Gapps version, or the latest nightly cyogen (more stable lol?))..
Now for Google Play Edition 5.1 | Untouched.. wipe system in recovery mode, install from .zip on SD card.. again.. reboot system.. and… ooh new loading screen. take that Telstra.

So far so good, although I’m assuming the phone will want to restart every-time the sim card is disconnected, which is usually a couple times per day.. Something that cyogenmod would allow me to ignore. New Sim in the mail, so we’ll see. I won’t be installing another SIM reader any time soon.

Grass is always greener, I kinda want cyogenmod now :/ hmm we’ll see.

Fixing what isn’t broken: Y-connector

Tl;Dr: I took apart a custom cable I’d soldered only to find I’d already made the modification I wanted to make. I remade the cable, and now it’s not as durable as it was previously :/ But the plus is I remade the cable with possibly better specs.


Adding heat-shrink to prevent the spring strain relief from shorting to the input..

The cable is a Y-connector, which is very commonly available. But rarely wired correctly –  I made a ‘Stereo-to-Mono Summing Box’. The reason for all this effort is connecting my stereo computer speaker output to a mono party speaker. The end result is nice sound. Importantly I’m not stressing my computer audio output with correct wiring.

This problem relates to this issue. Basically connecting consumer gear (line level stereo) to PA gear which is individual balanced/unbalanced channels.

When I opened the cables up they had resistors in them already, albeit different values and missing a 20k ground tie-down which I added.