If you have your BeagleBone Black or Raspberry Pi running a process and you would like it to send updates to your phone, you can easily accomplish that using a new API and service from Pushover.

This morning I was considering different methods for getting messages from my BeagleBone Black sent to my iPhone. At first I considered setting it up to send emails, but that is a little bit of work and isn’t extremely reliable. I also considered setting it up to send tweets, but that involves creating a separate twitter account and dealing with OAuth to interface with Twitter.

As it happened I ended up stumbling across Pushover while I was looking at possible channels in IFTTT. I spent a few minutes looking around the Pushover website and looked over their API and what do you know, this is the perfect service for pushing updates to your phone. So how can we do that?

Step 1: Download Pushover and Create Account

You first need to install the device side application on your phone. This is the only part of the process that you are charged for. At the time of writing, the app cost me a cool $4.99, I generally don’t like paying more than $1.99 for an app but this one seemed worth it.

After you download the app, open it up and create an account. This will assign you a unique user token that you will need to use to communicate with the Pushover server. I recommend copying this key into a text file so you can easily use it later.

Step 2: Create Your Pushover Application

After you have an account with Pushover you will need to create an application so you can receive an application token. This process is free and you are allowed to send up to 7,500 messages a month.

Once you have created an application you will see an application key, I also recommend copying this into a text file because you will need it later.

Step 3: Set It Up On Your System

Since the Pushover API is composed of simple HTTP transfers it is a simple matter to interact with their service from many different environments. For this example I have chosen to use Python because it is so simple to use and highly portable. For more examples on how to interact with Pushover visit the FAQ page on their website.

I have adapted the Python example from the FAQ page to be more descriptive and dynamic, take a look:

import httplib, urllib

# Application specific variables
application_token = "YOUR APPLICATION TOKEN"
user_token = "YOUR USER TOKEN"

# Message specific variables
title = "A Simple Test"
message = "Saying hello from BeagleBone Black"
url = "http://michaelhleonard.com/blog"
# To remove any of these fields you will need to remove them
# from the conn.request() below

# Start your connection with the Pushover API server
conn = httplib.HTTPSConnection("api.pushover.net:443")

# Send a POST request in urlencoded json
conn.request("POST", "/1/messages.json",
"token": application_token,
"user": user_token,
"title": title,
"message": message,
"url": url,
}), { "Content-type": "application/x-www-form-urlencoded" })

# Listen for any error messages or other responses

Try copying this code onto your BeagleBone Black or Raspberry Pi and running it using Python, remember to change the variables for your user and application keys. I have included some images below of this working on my own BeagleBone Black and iPhone 5.

Networked BeagleBone Black

Networked BeagleBone Black. As you can see it is just connected to a power source that I made from a modified mini-usb cable and a LAN connection.

Just a few seconds after running the script through Python on my BeagleBone Black I received the following push message to my phone.

  • Pushover from iPhone Lock Screen

    Pushover from iPhone Lock Screen

  • Pushover from iPhone Application

    Pushover from iPhone Application

And that’s it for this introduction to Pushover, if you would like to learn more check out their API Reference and the Pushover FAQ page. If you have questions or suggestions for me, post them in the comments below. If you liked this article be sure to subscribe.

Loading Disqus Comments ...
Loading Facebook Comments ...