ivernus.it

Pi display dashboard

Background

I was lucky enough to get a Raspberry Pi 2b with the 7” display for Christmas and I already had a plan for it.

I wanted to make a home dashboard to show some useful information that was readable from around the living room. Here is some of the information I wanted to show:

Writing the dashboard in python3 and using the flask framework seemed like the obvious choice. I wanted to build up my python3 skills, and it allowed me to do everything I wanted with the dashboard.

I also wanted to be able to play with NFC tags and see what they could do :].

NFC tag concept

The concept behind the use of NFC tags was to allow me to place tags in various locations, touch my phone on them and the NFC reader app would in turn update my dashboard at home. Of course you need a phone which has NFC enabled to allow you to play with the tags, but I luckily had a Nexus4 that did just that. I programmed the tags to launch a HTTP GET request to the endpoint running on my OpenShift application. This GET request has a few uses, the first, to send a signal for my fuzzed location or to feedback information e.g. how many coffees I’ve had from Pret that day.

Ya but how does it work? Show me!

Here’s a little diagram which is hopefully of more use than a giant wall of text.

diagram

Notes

Components

Hardware

Here are the pieces of hardware I needed for my project

Software and services

The APIs and data services that I chose for my information sources are all free of charge to use (as long as you abide by the limits and rules of course :])

Reading and writing the NFC tags:

For the weather forecast:

For my status information:

For the travel information:

For the news headlines:

OpenShift

The OpenShift service is a bit like a container service that can run up to three simple apps ( plus DB etc ) using a free account. This free service isn’t really suitable for production type applications of course as the instance goes to sleep after a period of disuse.

To get your application up and running create an OpenShift account and basically follow the simple instructions which will tell you how to configure keys, app name etc. You then need to install the SDK on your local machine, write your code and push it up to the OpenShift server on the internet, it will then take the code dependencies e.g. mongodb and start it all up. Of course if you want it to be accessible via http you have to define a web server e.g. a flask web app. It was pretty pain free to develop on the platform once I got over the initial issue of debugging, my code of course worked locally but not in OpenShift, the debugging solution solved this though

My OpenShift application

My application running in OpenShift is quite simple, it’s a python3 app using flask and mongodb, and by now you’ve seen how most of it works. It’s an authenticated endpoint that receives the GET requests from my phone and increments values/alters values based on the target endpoint.

Results and the future

Here is a screenshot of the result, as you can see it’s pretty low resolution as the Pi screen is 800 x 480. It’s not very pretty, but I like it :]

display

Next I would like to make a little space in my drywall and fit the pi display right in there. Water, electricity, drills and pain, maybe some day :].

As always if you have any comments, questions or feedback please don’t hesitate to get in touch