Simplepush Blog

Sending (end-to-end encrypted) push notifications from your Raspberry Pi Zero W

The Raspberry Pi Zero W is an impressively small device with a single core 1GHz CPU and 512MB of RAM. You can do all kind of great stuff with it. For me the most interesting use cases happen in a headless setup where you do not connect your Raspberry to any peripherals. See this great explanation on how to set up your Raspberry Pi Zero W without any monitor or keyboard.

When running your Raspberry Pi headlessly, you probably find yourself in the position where you want to get information from your Pi to yourself. This is where Simplepush comes into play.

With Simplepush a few lines of bash will make it possible to send push notifications to your Android device. The following example will send the amount of available memory on your Pi as a push notification to the user with the Simplepush key HuxgBB (replace this key with your own. You get your key by installing the Simplepush app - no registration required).

msg=$(cat /proc/meminfo | grep "MemAvailable:") && curl "https://api.simplepush.io/send/HuxgBB/Available memory on your Pi/$msg" &> /dev/null

With Simplepush this also works with end-to-end encryption:

sudo apt-get install git
git clone https://github.com/simplepush/send-encrypted.git
sudo cp send-encrypted/simplepush.sh /usr/local/bin/
sudo chmod +x /usr/local/bin/simplepush.sh
msg=$(cat /proc/meminfo | grep "MemAvailable:") && simplepush.sh -k HuxgBB -t "Available memory on your Pi" -m "$msg" -p yourpassword -s yoursalt

You can set your password in the encryption section of the app. This is also where you find your salt.

We also provide libraries for sending push notifications (normal and end-to-end encrypted) from within programming languages.

Share on:
Imprint