9

(Elliott) #1

Upgrade your humble letterbox with push notifications


FORGE

you will see ‘Letterbox has been opened!’ and
‘Letterbox is closed’ printed to the Terminal window,
along with the date and time of each action. If you
watch your Google Sheet whilst you do it, you’ll also
see a new row being added and then populated.
Due to the IFTTT applet you made, within about
a minute a push notification from the IFTTT app
should pop up on your phone. You can even press
the notification to open up the spreadsheet and see
the full details, including when the letterbox was
closed again.

Finally, set the script to auto-run each time the
Pi loads, so that it’ll work once installed on your
letterbox without needing to hook up a display
and keyboard. To do this, edit the Pi’s autostart
configuration file:
sudo nano ~/.config/lxsession/LXDE-pi/autostart

Add this line at the end of the file:
@python /home/pi/Letterbox-Push-Notification/
letterbox.py

Now that everything’s working, it’s time to install
the system on your letterbox. Depending on the exact
design of your letterbox, you may need to adjust how
you fit yours, and experiment a bit with the placement
of the magnet to ensure that the system correctly

registers as open/closed when the letterbox is
in either of these states. A nice long length
of bell wire, as well as a long USB power
lead, should ensure that you can locate the
Pi Zero nicely out of the way and keep
the whole installation neat and tidy.
Now you know how to hack your
letterbox, what are you going to set to
happen when your post arrives? We’d
love to see what this inspires you to
make – get in touch via Twitter to show
off your creations!

You can even press the
notification to open up
the spreadsheet and see
the full details, including
when the letterbox was
closed again



REMOTE ACCESS


WinSCP and PuTTY are two very useful utilities
for connecting to your Raspberry Pi (or any Linux
machine). WinSCP for Windows gives you an easy tool
for transferring files between your Windows machine
and the Pi, and PuTTY allows you to run commands on
it remotely, as if you were connected to the machine
directly with a screen and keyboard. You can install
the latest version of each from ninite.com – look
under Developer Tools.

Above
The Raspberry Pi
Zero can be mounted
out of the way,
using an adhesive
Velcro pad
Below
This project is
proof that you don’t
need complicated
wiring to make a
useful device
Free download pdf