We're Sorry, Please Can You Update?

Normally we can update automatically for you in the background at night.

Unfortunately in this instance we can't and need your help.

Like most people we've upgraded to Python 3, due to Python 2 reaching it's end of life support.

This means you will need to re-install the program dependencies and switch over to Python 3 to be able to use the new program. Don't worry, we'll explain step by step the process involved. You won't need to start from scratch, the whole process should take only 10min, if you need any help feel free to send me an email or comment below.

Okay, so lets begin...

Don't worry, we've made this quicker and easier than before!

Step 1

To start with, you'll need to remote into your Pi, to do this launch up Putty on your computer and connect using the device hostname you set previously, this might just be "raspberrypi". If your unsure what it is, you can go into your router settings and find the IP address for the connected device and connect that way instead. Port number should still be 22.

First were going to check and install any software updates to the device it self. Simply Copy and Paste. 📋

Simply copy, paste and execute the command below, you may be asked to enter in your password, please note that this may take a while to complete depending on how long ago you last updated your device.

sudo apt update -y && sudo apt dist-upgrade -y

Next we're going to install Python 3 and a few dependencies

sudo apt install -y python3 python3-pip python3-dev python3-lxml python3-pygame python3-pil build-essential

Some more dependencies...

sudo apt install -y libsdl-dev libportmidi-dev libsdl-ttf2.0-dev libsdl-mixer1.2-dev libsdl-image1.2-dev

And finally even more dependencies.

sudo apt install -y libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev libopenjp2-7 libtiff5

Now we're going to install the required Python packages

sudo -H pip3 install -U setuptools luma.oled luma.emulator inflect nre-darwin-py

Lets double check you do have our latest software

We're assuming here you installed the program in it's default recommended location, if you've moved it please do a Git Pull in that directory.

cd ~ && git -C ./Bus-Departure-Board/ pull

Step 2

Awesome, if that all worked you should now have all the software required to run the new Python 3 version of the program. We're now going to double check it's all working before we continue.

First we're going to stop the currently running program on the display.

We're assuming here you didn't change the name of the program service when you set it up.

sudo systemctl stop startupDisplay.service

Now we're going to test the demo program

python3 ./Bus-Departure-Board/DemoPy3.py

You will probably see a message appearer saying that "this channel is already in use". This is okay, simply ignore that. Hopefully you now see the display running the demo program. If you don't double check you've done all of the commands in full. If this still doesn't work please go-to the main website and go through the full-set of instructions or send me an email and I'll see if I can help :)

Step 3

One final we now need to change your start-up service to run the new program, instead of the old python 2 program.

First open up service file.

nano startupDisplay.sh

Things can now get a little complicated...

Where ever you see "python" you need to replace it with "python3", then for the name of the file, you need to add "Py3" onto the name of it. For example:

sudo python ~/Bus-Departure-Board/ReadingBuses.py -k 12345 -s RDG123

Then becomes:

sudo python3 ~/Bus-Departure-Board/ReadingBusesPy3.py -k 12345 -s RDG123

Make sure to save your changes!

Press 'Ctrl + x', then 'y' and 'Enter' to save the file. You should now be returned back to the main terminal screen.

Finally turn it off and on again!

Now we just need to restart your device and it should all work!

sudo reboot

Please give your device 2min to fully restart, once restarted it should now be running the new version of the program, Version 2.0.X, with the update message removed. If your display is not showing anything, then please repeat Step 3 or go here for more help.

And that's it! Thank you very much for taking the time to upgrade your departure board.

All future updates from now should continue updating automatically in the background without you even knowing.

Hope you all have a great 2021!

Frequently Asked Questions

Why are you upgrading to Python 3?

We're upgrading to Python 3 because Python 2 has reached it's end of life support, this means all of the program dependencies we use are also dropping their support. Going forwards it would be difficult to continue developing new features when using Python 2 and it is inherently less secure. To future proof upgrading to Python 3 is the best option.

So what's actually new?

Currently I'm in my third year of university, so there are no big feature releases, this update only provides bug fixes. For more information you can see the releases post here. But by updating now it will give you the ability to continue receiving automatic updates in the future when new features are released. If you remain on Python 2 you will not get any new updates.

Why couldn't this be done automatically?

To many things could possibly fail if I were to push out an automated update, plus quite a significant amount of new installations are required so I felt it was important for you to know what was happening.

I don't want to update!

If you don't want to update, then you won't be able to receive any new-updates and the websites will soon be updated to only include Python3, so all support shall be dropped. However, if you REALLY want to stick on this version of the program, you can simply add "--Acknowledge-Deprecated" start-up argument to the program. Doing this will remove the update notification message and will stop the update checking service. Please note that eventually the Python2 files will be removed from the Git Repository in a future commit.