Guide to IoT OTA updates for embedded Android

iot-ota-updates

The Fourth Industrial Revolution is upon us, driven by the Internet of Things (IoT). IoT refers to internet-connected devices with sensors, processing power, and other technologies that can communicate with similar devices across networks. 

Everywhere we look, there seem to be IoT devices such as point-of-sale (POS) terminals, parking meters, healthcare devices, vending machines, infotainment systems, and others. 

Many of these devices are created in-house for use by the business itself, such as by installing Android on Raspberry Pi (3b+) or some other hardware for a fleet of devices. 

When creating such a fleet of devices, Over-the-Air (OTA) software updates must be programmed into the device. These are updates that can be executed over the internet, obviating the need for so-called “truck rolls”—when technicians must be physically sent to the site to carry out updates that could be carried out remotely. 

What is an IoT OTA update?

IoT OTA updates are when versions of a software or firmware are pushed to the device via the internet. IoT OTA updates can be done automatically on a schedule, or the IoT OTA updates can be sent manually to a device by a fleet manager. 

A comprehensive OTA update solution is a critical component to a successful Android-based product. Pushing IoT OTA updates to devices is not a trivial task, and functionality across a broad range of devices and use cases must be ensured. An integrated solution is needed so that devices can be managed remotely via a device management hub, such as emteria’s Device Hub.

Using the Device Hub, a fleet manager can control all aspects of IoT OTA updates. The fleet manager can push IoT OTA updates to a subset of devices, a single device, or all devices. 

Why do companies need IoT OTA?

An IoT embedded system must be updated regularly. Failure to do so can result in buggy code, poor user experience, and possibly costly errors if the device is being used in an industrial or retail context.

Failure to implement the necessary code and infrastructure for IoT OTA updates on your fleet’s devices could mean that:

  • Updating devices will become difficult, and possibly simply ignored
  • You open the door to buggy devices
  • Updating devices requires many labor-hours
  • Updating devices becomes costly because technicians must go physically to carry out updates
  • Rolling back failed updates becomes a nightmare if errors are discovered days or weeks after the update

IoT OTA updates are the easiest way to roll out new technology to a company’s fleet of devices. 

Being an OTA update provider is something many companies want to know how to become. An IoT device, from OTA update perspectives, is one that can be updated remotely. 

What OTA IoT strategies exist and which is the best to choose?

Many companies create their own fleet of IoT devices, often by installing embedded Android on a Raspberry Pi and then adding a touchscreen and peripherals to it. 

IoT OTA updates don’t come preprogrammed out-of-the-box within the Android Open Source Project (AOSP). And you also have to invest in the enormous background infrastructure necessary to enable IoT OTA updates. 

IoT OTA updates require very precise coordination between the device and the backend cloud provider. Updates should also ideally be handled incrementally to make them faster and therefore rather effective and less error-prone. This might sound easy, but it is a fairly gigantic task. 

Essentially, two primary strategies exist to implement IoT OTA updates:

Building the entire IoT OTA update infrastructure yourself and managing it in-house, or

Using a pre-existing IoT OTA update infrastructure provided by a team dedicated to its smooth operation, such as emteria.

Raspberry Pi OTA updates in IoT environments

Raspberry Pi comes configured out-of-the-box with emteria.OS, which is an optimized version of Android designed to run on varied hardware configurations.

There are several IoT OTA update strategies you can choose from, such as:

  1. IoT OTA updates on a schedule
  2. IoT device OTA update only when the device is idle
  3. Automatically triggered OTA updates for IoT devices as determined by the device settings
  4. Manually or automatically triggered OTA updates for IoT devices as determined by a fleet manager who is using the Device Hub

The fourth option is a popular one in retail MDM, small business MDM, and other sectors

These strategies also work with other devices, not only Raspberry Pis.

From an administrator's perspective, the new version of the software is created and uploaded automatically, after which OTA updates can be triggered manually with a single Command. Alternatively, the command can be set as a Policy, which then executes the command automatically in the future. Thus, updates can occur automatically when a new version of the operating system is available. This can be done immediately or, which usually makes more sense, scheduled at a specific time so as not to disrupt the runtime of the device.

In an industrial environment, there is rarely a need for end-users to manually approve the installation of an update like there is on personal smartphones, but this is entirely possible if the device is so configured. 

Raspberry Pi device management to enable IoT OTA updates is particularly easy using emteria’s Device Hub because Raspberry Pi is one of the many hardware configurations that emteria.OS supports without any need to modify the underlying Android code. 

IoT device OTA update functionality and an OTA IoT framework: Build or buy?

Let’s look at the precise requirements to integrate IoT OTA updates into your Android-powered fleet if you were to build the operating system and infrastructure in-house. 

 IoT OTA updates HR resources

The first thing you’ll require to run successful IoT OTA updates in-house is a competent IoT OTA update manager who can oversee every aspect of the OTA IoT process. This would require knowledge of hardware, security, microservices, Android builds, and cloud infrastructure. 

The IoT OTA update manager would also need at least a few team members with specialties in each of the above areas. These HR needs would of course be in addition to your company’s core service or product offering. 

 Security for IoT OTA updates

When programmed incorrectly, IoT OTA updates could be intercepted, potentially causing millions of dollars in lost production and damage. Transmitting data from the update server to the device during IoT OTA updates must be done securely, with data verified at the endpoint. 

After installation, the device should boot correctly to ensure the OTA IoT procedure was successful. If it wasn’t, the device should be able to roll back the IoT OTA update and restore itself to its previous state. 

The solution to ensuring secure IoT OTA updates is to stick rigorously to OTA updates IoT best practices and industry standards. 

Building a properly functioning OTA IoT trust framework is imperative. 

If you’re building a modified version of Android so that it runs on embedded devices, the security of the OS delivered by the OTA IoT framework must also be fully in place.  

 Maintenance

One of the major problems of in-house IoT OTA updates is that companies don’t have the resources to keep the system maintained. 

The IoT OTA updates server will itself require updates and patches from time to time. And newly discovered bugs in devices mean that IoT OTA updates must be quickly pushed out to address these. 

 Scalability

One oft-overlooked aspect of in-house IoT OTA updates solutions is their ability to scale. Deploying IoT OTA updates to a handful of devices compared to thousands spread across the globe is like comparing apples to oranges. And any failure in large-scale IoT OTA updates can be catastrophic for businesses. 

Scalability must be built in from the start, and this includes implementing automated rollbacks in case of failed IoT OTA updates. 

 Excessive complexity

Because in-house IoT OTA updates projects are focused on delivering business-specific needs, an IoT OTA updates project quickly becomes a conglomeration of “point solutions”—specific solutions to precise business needs—rather than a holistic, well-integrated system. 

Dedicated IoT OTA updates providers will design the IoT OTA updates framework following IoT OTA best practices, making the solution an integrated whole rather than a mishmash of ad-hoc code. 

 Costs

All of the above sums up to tremendous costs for implementing an in-house IoT OTA update solution. And the costs are not a once-off. There will be costs for maintenance and also costs every time a new type of device is added. 

Overcoming IoT OTA update challenges

The simplest way to overcome all the IoT OTA update challenges mentioned above is to outsource the procedure to a third-party company that specializes in it, such as emteria. 

Emteria has built the infrastructure necessary to support a fully-functioning IoT OTA update framework. 

Emteria.OS is a modified version of Android which has been designed to run on a wide variety of embedded systems and hardware configurations. Stock Android does have the internal functionality to implement OTA updates but it lacks the needed infrastructure. Emteria.OS, however, supports IoT OTA updates out of the box, backed by a robust infrastructure. The OS is actively maintained by a dedicated team of hardware and software specialists. 

Using something like emteria.OS instead of baking your own IoT OTA update solutions solves the home-baked version challenges in the following ways: 

 HR resources

IoT OTA updates HR resources are all taken care of by the third-party provider. You don’t need to invest in a specialist team to handle your IoT OTA update infrastructure, but can simply leave it up to the third-party solution you opted for. 

 Security

IoT OTA update security is all taken care of by the third-party provider, including signing of updates, vulnerability checks and more. Again, much of this comes back to HR needs where specialist personnel is required for maintaining server security as well as ensuring that IoT OTA best practices are followed for secure transfers of OTA updates on IoT devices. 

 Scalability

Emteria has built an entirely scalable solution for OTA in IoT. The Emteria infrastructure supports a single device up to hundreds of thousands. The devices and their updates can be managed remotely through emteria’s Device Hub cloud interface, which you access via your browser. 

Using this interface, you can push IoT OTA updates to single devices, subsets of devices, or the entire fleet. And you can also tweak other settings on the device as well, such as turning Bluetooth on and off remotely or installing apps remotely. 

Before the above can be done on a device, an IoT product needs OTA provisioning. This means it must be initially configured to support OTA updates during the initial setup. This is all taken care of when you use emteria’s Device Hub. 

 Maintenance

Product maintenance is also taken care of by the third-party provider. You don’t need to ensure that you regularly develop or purchase updates for your operating system because IoT OTA updates form the third party’s core business model. New versions of the operating systems will be developed by them. Maintenance, therefore, does actually take place and is not pushed to the side.

By using a third-party provider whose entire business revolves around the successful implementation of IoT OTA updates in an Android device, you are guaranteed an integral whole instead of a mishmash of jerry-rigged code that was assembled on an ad-hoc basis. This prevents excessive complexity in the code and reduces the potentiality for bugs. 

 Costs

Tremendously reduced cost is the overall result of going with a reliable third-party provider. Doing it in-house is prohibitively expensive. Using a third-party IoT OTA update provider means you will only pay a tiny fraction of the costs comparatively. 

IoT OTA update best practice

IoT OTA updates can run automatically or can be triggered by a fleet manager. Automatic updates are performed by settings that must be made on each device. The device queries at regular intervals whether new updates are available and automatically executes them if this is the case. To trigger an update remotely as a fleet manager, the device must be connected to a cloud solution such as emteria's Device Hub. As already mentioned, OTA updates can be triggered manually with a single command or set as a policy, which then executes them automatically.

Although both strategies work fine for many use cases, we recommend using the Device Hub option as it gives you more control and enables you to use additional functions such as update scheduling.

For example, let’s imagine a scenario where a manufacturing company has a fleet of Raspberry Pi devices. To perform their Raspberry Pi device management, they use the MDM manufacturing solution within the emteria’s Device Hub. 

The manufacturing industry often uses “always-on” devices, and different demands and pressures sometimes necessitate different fleets of devices to be deployed on different schedules.

Carrying out IoT OTA updates in such a mercurial environment with thousands of devices can be challenging. Running IoT OTA updates on an automated schedule can mean that groups of devices in individual sections of the factory can be updated one at a time without bringing all production to a halt.

The best practice here is to use update policy within the emteria Device Hub, or in individual cases to first resort to manually triggered IoT OTA updates on a subset of devices.

Crossed Screwdriver and Wrench on Red Button on Black Computer Keyboard | ESB Professional / Shutterstock

Source: ESB Professional / Shutterstock

Top 4 things to keep in mind about IoT OTA updates

Although there is an enormous amount to know about running successful IoT OTA updates, four points stick out as the most vital. These are:

1. Run IoT OTA updates in batches

If anything goes wrong during IoT OTA updates, the entire fleet of devices can be rendered unusable, bringing productivity to a halt. It’s therefore best to run IoT OTA updates in batches so that any potentially faulty updates are limited to non-essential devices. 

It is even possible to keep a subset of test devices and feed the IoT OTA updates to them initially. 

This is all done very easily through emteria’s Device Hub where devices can be categorized in groups, and where the manager can decide which devices to update or not. 

2. Update during idle times

IoT OTA updates are best run during device idle times. This is not always possible for always-on devices such as POS terminals at a gas station. In this case, it is best to run updates during non-peak hours, but also to run the IoT OTA updates on a small subset of devices, or even just a single device at a time. This is all easily possible using emteria’s Device Hub. 

3. Have excellent connectivity

Emteria has ensured that connectivity from the server is excellent, but it is imperative that the receiving entity also has excellent connectivity. This is not only important for IoT OTA updates but also just for general device management. 

In many cases, a device that isn’t connected also cannot function at all, such as in POS systems that must communicate with payment providers. 

4. Have a rollback mechanism in place

If the IoT OTA updates fail, it must be possible to roll back the update and restore the device to its previous state. There are several different strategies that can be used to achieve this, each with its pros and cons. Standard practices exist to ensure updates can be rolled back easily. 

The most cost-effective IoT OTA update option

In-house IoT OTA updates might initially seem like a good idea but they usually become very costly indeed. The task of providing regular and reliable IoT OTA updates is Herculean in scope. 

The combination of maintaining an up-to-date embedded Android version as well as a well-oiled IoT OTA update infrastructure is a business unto itself. 

Outsourcing these services to a reliable third-party provider is the most logical option, and emteria has repeatedly proven itself competent in this sphere by providing high-quality and reliable Android versions and IoT OTA updates to many industry-leading companies. 

Learn more about emteria and its IoT OTA updates service. ⬇️

Build unique products, boost device performance

See why emteria is the chosen Android™ customization & management platform for OEM solution builders — and what it can do for your team and customers.

Book live demo
emteria Android

Table of contents

emteria Demo
See emteria in action