- So first the USB is plugged in.
- It is
automounted using a GPIO button press. Flash red if this fails.
- Blue light will
flashlight during rsynccp (copy). If an error occurs show red LED and turn off blue LED.
- Send email with results on completion.
- Unmount USB and
show steady blue LED indicationturn off blue LED.
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.)
- 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
- 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.setmode(GPIO.BOARD) GPIO.setup(12, GPIO.OUT) while 1: GPIO.output(12, False) sleep(1) GPIO.output(12, True) sleep(1)
With these settings I can plug my RPi into a router and it will configure a web URL to it’s routers IP address (although I haven’t set and UPNP stuff).
I tested with
sudo ddclient -daemon=0 -debug -verbose -noquiet
Returns this at the bottom
SUCCESS: rpi: skipped: IP address was already set to 'My WAN IP'.
Also I edited my SSH config since apparently my home NAT router didn’t like keeping the connections alive. These settings went at the bottom of sshd_config – initially I used ServerAlive, which stopped SSH from working :/
ClientAliveInterval 300 ClientAliveCountMax 24
- Install Samba:
sudo apt-get update sudo apt-get upgrade sudo apt-get install samba
- Duplicate original samba settings:
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.old