Friday, January 2, 2015

Scrolling LED Licensing Sign

Part of the responsibilities taken on by my team at the U of A include maintaining the software licenses for dozens of different software pieces installed in the smart classrooms and instructional computing labs throughout campus. It's necessary for us to know when software is expiring so that we have to opportunity to update those licenses before too many students and professors start to complain. In discussion with my team lead, we identified that our current system alone (inputting license expiration dates into a Google spreadsheet) was not enough. I set up a script to email out to our team 10 days in advance when a specific license would expire, hoping that could help solve the issue, but with the many hundreds of emails the team receives each day from various reports and incident tickets and logs, the license emails easily became lost in the mix. We needed something more visual, something more "in your face", and then I stumbled upon a blog post by Pavel Shved.

Pavel's post details a project he took on to create a transit timetable sign for his home. The signs which in many big cities hang at bus stops, display information about the upcoming routes and the time until their next departure. This project itself it something I'd love to do, however, Edmonton Transit busses are not currently equipped with real-time GPS devices and/or the GPS data is not available publicly. Alas, Pavel's project was a great inspiration for mine, but instead of using a sign to display bus times, I'd use it to display software license expiration dates and I'd hang it in the office!

Pavel's project was written in Ruby; a language which I have limited experience working with. Thankfully though, Mike Metral seems to have also been inspired by Pavel's project and made a Homemade Sports Tracker by first porting Pavel's code to Python. Thanks Mike!

I had a spare Raspberry Pi device sitting in my desk and I now had Mike's code as a basis to work from, so all that was needed now was an LED sign. After proposing the project to my team lead and getting approval to go ahead, I ordered the same sign that Pavel and Mike both used and was ready to go.

After configuring the Pi and the LED Sign, I ran the test script which enabled me to hard code messages into the script and then display those message on the sign. Cool!
The next step was to write a script that would allow me to send multiple messages, and then scroll between them. In order to do this, I did eventually need to delve into the Perl portion of the script and play around with the MiniLED perl module. But, after some modifications to the existing scripts and learning a thing or two about perl, I managed it.
The last step was to pull the data from the Google spreadsheet we were using, and interpret it to display information to the sign. I wrote a script to pull all of the license info and then compare the expiration date for each software piece to the current date. If the software is due to expire within the next 30 days, it gets added to the list which will be displayed on the sign. After many hours of debugging and testing, I was finally finished.

The sign is hanging on the wall of the office now where everybody can see it. It updates every 10 minutes to pull the latest license information and now scrolls through any licenses that are set to expire soon so that we can go and update them in a timely manner and prevent any outages.


Overall I would say this was a great project for me to work on. I enjoy projects where I get to be innovative and "create" things. Though I did gain some valuable experience with perl from this project, I think the most value I got was from learning how to use python to interact with Google docs. We are Google-heavy at the U of A and I'm sure the knowledge I gained from this will come in handy again in the future.