We have a prototype device that has inside a Raspberry Pi 3, Wi-Fi and our code is on the SD card. What is best option? Is there a library, where it can an act like a firmware update?

Ideal use case: User navigates to our website, downloads the new program. On completion of download there is an option to reboot the device. Device reboots, stub application updates the replaced code and then reboots with the new software.

We prefer not to have the user use USB or remove the SD.

  • This is a good question but needs proof reading. Please proof read. Question is hard to understand. I first skipped the title, hopping that the question would explain, but then the 1st paragraph just refers to the title. I think that the 2nd paragraph sort of tells what you are trying to do, but by then I am growing impatient. – ctrl-alt-delor Jul 4 '18 at 10:58
  • Are you trying to upgrade the OS or just an application? – ctrl-alt-delor Jul 4 '18 at 14:30
  • My interest is only to update the application and not the OS. – phoenixAZ Jul 4 '18 at 23:01
  • I would consider both, you may want security updates for the OS. – ctrl-alt-delor Jul 5 '18 at 9:48

You shouldn't even need a full screen (something a windows manager can run in) to do this, just a simple LCD display (perhaps 2 lines of 16 characters, like this) to give some directions, and a couple of buttons, one of which is larger than the others and serves as a "return" or "do it" button. Think of the display on an older printer.

As long as the pi is connected to the internet, you can use programming language, curl, or wget, to get a file from the web.

Think of devices like routers which let you know when they need to be updated, and the only option you have is either to download the update or not to do so.

I imagine that on your website you have a directory with one file, which has a specific naming scheme, like "update-<version>-<date>.gz".

For example, the 2nd update, updating minor things that was uploaded to the site today might be named update-00.02-2018-07-03.gz

A program would run weekly to check for updates and to see if this update is later than the last update they have. If so, it would download the update, run it, and restart the machine, if given permission by the user.

At least, that's how I would do this. I might also bring out a USB port to the exterior of your machine (they make special cable for this) that could be used in the case that the machine has no internet access.

And frankly, I'm not sure I'd want an expensive machine to have access to the internet. I believe in firewalls for a reason. Just a quick story. I worked for Penn State, and one of our maintenance people was putting the software on a new machine. He forgot to do this inside of a firewall. He was ten minutes into the process when the security people came knocking on the door to tell us that one of our windows boxes was sending viruses out. Sure enough, it was the new machine.

  • Can you explain the distinction you are making between screen and display? – ctrl-alt-delor Jul 4 '18 at 11:02
  • I consider a screen something you can run a window manager on, and a display to be an LCD display of perhaps 2 lines of 20 characters. Just enough to give somebody the information they need. I'll edit my answer. – NomadMaker Jul 4 '18 at 11:39
  • You should see the X11 definitions: A display is a keyboard, pointing device, and at least one screen; A screen is something that you can display stuff on, and is independently addressable, that is you can tell a window which screen to display on. A screen can be made of multiple monitors; A monitor is a physical device that a screen is stretched across, you can drag a window from one monitor to another. – ctrl-alt-delor Jul 4 '18 at 14:28
  • I don't think you need any type of display: the upgrade can be automated, or as in the question the PI can have a simple web server, as a User Interface. – ctrl-alt-delor Jul 4 '18 at 14:30
  • I was thinking of the interface in my older printers and my 3d printers. They let me know when there is an update. There might be a very good reason to refuse an update. I like to have the choice. – NomadMaker Jul 4 '18 at 18:41

Use cases

It does it automatically, or user attaches to PI Via a web browser, and clicks button Yes: install new firmware (there can be a user option, as to whether it is automatic, or it asks). In ether case, the PI does not need to reboot, except in rare occasions (new kernel, or core libraries). In these cases, the user is advised to reboot at the soonest opportunity.

An upgrade pattern

  • You will also need to upgrade the OS, if the device is in the field for long.
  • Having more than one upgrade method is a pain.
  • Manual download and then install is a pain.


Use the built-in upgrade system (apt) Put the app in a deb package, and register your website as a source for debs, on the PI. There will be no need for manual download, then install. The system can be configured to do it automatically or to ask for conformation.

What if it goes wrong, and the PI is bricked.

This could happen with an OS upgrade (well at least it could appear bricked to the user).

To help the user fix a PI that gets bricked. I would also look at setting up the PI so that on boot it will give the option to do a fresh install (I think that NOOBs may have this feature). This would require the user to connect a monitor, and keyboard. But only when stuff goes wrong.

  • Hope this use-case is OK. It will take away the fun of downloading and installing the wrong thing; Random reboots; Installing viruses from the web; going slow when updating; etc. – ctrl-alt-delor Jul 4 '18 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.