Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remotely Updating Raspberry Pi Software 'over the air' [closed]

We use a Raspberry Pi embedded computer to connect IP cameras on a customers network to our cloud based recording service. We are using Raspbian and about 50% are Wheezy and 50% are Jessie.

The challenge we have is how to remotely update the software running on these IFUs.

Our current method involves using SSH and Ansible. We have a complex Ansible script that makes all the changes to the Raspberry Pi and we have automated this to an extent so we can updates lots of Raspberry Pi's at a time.

However, the problem is is that this is a non-atomic update. The Raspberry Pi's do not necessarily always have exactly the same package versions on them depending on when they were updated. Its also possible for an upgrade to fail half way through etc.

I am aware that there are a couple of ways of doing an atomic upgrade by downloading a new 'software image' and swapping over to using it instead using a bootloader. I think OpenWRT can do this as well as swupdate: https://github.com/sbabic/swupdate

Has anyone ever done something like this on a Raspberry Pi before?

Thanks

like image 438
dopey Avatar asked Nov 16 '16 11:11

dopey


People also ask

How do I update my Raspberry Pi remotely?

To update the packages on your Raspberry Pi, open a terminal window or connect to your Pi remotely using an SSH client. You'll first need to update the list of packages from the software repository package lists. To do this type sudo apt update, then hit enter to run it.

Can you control Raspberry Pi remotely?

Method 1: Remotely access the Raspberry Pi through VNC The VNC is easy to use as no training is required. You just need the IP address of the machine to which you want to connect and then it will ask for the username and password, once provided all this, you can access the machine.

How do I force a Raspberry Pi to update?

You can do this by opening a new terminal window and entering the command sudo rpi-eeprom-update . If it flags that an update is available, as we mentioned earlier, one option is to run sudo apt update followed by sudo apt full-upgrade to fully update your Pi's software, firmware included.


1 Answers

As a bit of an update to this question, I found a couple of ways of doing this.

The first thing to consider is that you do not have to stick with the RPI's default bootloader as @user3145836 pointed out. Uboot allows you to flip the boot partition.

The best option at the moment appears to be https://mender.io and this is the option that we have gone with.

If you can dockerize your app, https://resin.io/ is a nice hosted way of doing it.

like image 127
dopey Avatar answered Oct 20 '22 19:10

dopey