Speeding over-the-air latency for IoT applications with compression
During the development cycle for a wireless Internet of Things (IoT) application, developers spend the most time debugging and getting over-the-air (OTA) downloading to work reliably. Some key challenges when implementing OTA are patch updates, security and new feature integration. Slow OTA updates in the field cause major service disruptions and increase the likelihood of firmware corruption. But in industrial settings, nodes are located in hard-to-access or no-access areas; therefore, updating the firmware reliably is critical.
It’s possible to reduce OTA update times by reducing the firmware image size. The trick is to identify an efficient compression algorithm with a small code footprint that adds only minimal system-level latency. This article offers a solution with LZ4 compression and provides design considerations specifically for Bluetooth® low energy OTA updates. Our solution can ultimately reduce OTA update times by as much as 40 percent, and help you implement a more economical OTA process that can scale for industrial applications with massive deployment.
From building and home automation to wearables, from automotive and smart cities to health care, the Internet of Things (IoT) touches every facet of our lives. Within the past decade, the number of IoT devices introduced on the market has increased dramatically. The total is approaching a staggering 8.4 billion, meaning that there are currently roughly two connected devices per living human.
This trend is expected to continue at a rapid pace, with an estimated 20.4 billion connected devices by the year 2020. Most connected devices within the IoT are nodes containing microcontrollers (MCUs), sensors, wireless devices and actuators that collect data. Figure 1 shows some of these connected devices.
Figure 1. IoT-enabled home, with connected devices and appliances working invisibly for consumers (Source: Texas Instruments)
The most common challenges when developing IoT devices are security and privacy, low power, diverse connectivity options and fragmented ecosystems. But one challenge isn’t mentioned that often: over-the-air (OTA) latency, which is the time that it takes to update an IoT device. Whether you are an IoT user or a developer/manufacturer, OTA latency is an interesting challenge, especially given the prevalence of high-memory nodes with low-speed interfaces.
We heard of a designer who was developing a smart e-lock with Bluetooth® low energy similar to the one shown in Figure 2. A 256KB image was taking close to 4 minutes to program. For the next generation (with extra features) of his e-lock, he wanted to increase the memory footprint to 512KB, but that would increase the upload time of new images to almost 8 minutes.
Figure 2. Bluetooth low energy e-lock (Source: Texas Instruments)
Slow OTA updates in the field cause major service disruptions and increase the likelihood of firmware corruption. During the development cycle for a wireless IoT application, developers often spend the most time debugging and getting OTA updates to work reliably.
Consumers already have connected devices like thermostats, energy meters, lighting control systems, e-locks, music streaming and control systems, remote video streaming boxes, pool systems, irrigation systems and garage door openers – with more to come. In industrial settings, the location of these nodes in hard-to-access or no-access areas makes reliable firmware updates critical.
Updating the software because of a bug fix or just because there are new features available is something that we expect IoT devices to be capable of; unfortunately, depending on wireless technology, such updates could vary between a few seconds to several minutes.
The most direct approach to reducing OTA firmware update times is to reduce the firmware image size. The trick is to identify an efficient compression algorithm with a small code footprint that adds only minimal overhead in terms of system-level latency.
One of these compression algorithms is LZ4 (LZ4 is an open-source specification), which is a lightweight compression library optimized for ultra-low power MCUs (for example, Texas Instruments SimpleLink™ MSP432™ MCUs).