talkypi
Do you need to be notified when Something Interesting™ happens on your headless Raspberry Pi? You've come to the right place. talkypi
is a tiny ruby script that leverages the power of Prowl to send notifications to iOS (and other) devices.
Prerequisites
You'll need a copy of Ruby on your Raspberry Pi and the Prowl app installed on your iOS device. Make sure you register your device with Prowl correctly in order to receive notifications on it.
Installation
Installing talkypi
is easy:
$ gem install talkypi
Configuration
Configure talkypi
like so:
- Login to your Prowl account account, click the API Keys tab at the top right of the page, then click Generate Key under the Generate a new API key section (you may wish to give the new key a memorable name for future reference)
- Copy the new API key
- Create a
.talkypi
file in your home directory and paste the API key into it
Usage
Use talkypi
from the command-line:
$ talkypi "event title" "longer description"
The notification will be delivered to any devices you've registered with Prowl.
You can call talkypi
from shell scripts or cron jobs. Let your imagination run wild!
Fun Stuff
Startup notifications
Using a simple cron job you can generate a notification whenever your Raspberry Pi starts up (after a power loss or manual/automatic reboot):
Find out where talkypi
was installed:
$ which talkypi
/usr/local/opt/ruby/bin/talkypi
Open your crontab file for editing:
$ crontab -e
Enter the following line, replacing the path to talkypi
with the output from the which
command above:
@reboot sleep 10; /usr/local/opt/ruby/bin/talkypi "system event" "the system powered up successfully"
The sleep
command isn't strictly necessary, but you may find that without it notifications don't work — it gives your system time to bring up the network interfaces before attempting to send the notification.
Acknowledgements
talkypi
makes use of the following libraries:
- Prowl Ruby wrapper by August Lilleaas
License
talkypi
is provided under the terms of the MIT License.
Contact
Email me at marc.ransome@fidgetbox.co.uk or create an issue.