Skip to content

OTA Configuration

mdemeyer edited this page Sep 21, 2020 · 1 revision

[[TOC]]

Idea

The idea of over the air configuration, is to standardize a way to configure some common parameters to our devices using two way communication.

Flash memory

The flash memory of the octa board (S25FL) is used, to store the configuration in non volatile memory. This makes the settings persist, even after reboots or other power cuts.
The first page of 256 bytes in flash memory is ALWAYS reserved for the configuration.

Octa Payload Format

For the configuration messages, both uplink and downlink, we use the octa payload format. In flash memory, the configuration is stored in the exact same way as the downlink messages, allowing us to use a single parser for both the initial flash readout and the downlink configuration update messages.

octa_configuration struct

The current configuration is kept in a struct at runtime, for ease of accessibility.

Flow

Bootup

On bootup of the device, the flash memory driver is initialised, after which, the first page (index 0) is read from flash memory. This buffer is fed through the configuration parser, which will update the octa_configuration instance called current_octa_configuration accordingly.

New configuration from server side

When the configuration has to be changed, the server will send a downlink message, for example a new Measurement interval & Multiplier (type 254) message.
This buffer will also be parsed by the same parser, and will update the configuration both in the current_octa_configuration struct and in the flash memory.

Configuration Confirmation

After this configuration is updated locally, the device has to confirm this again to the server.
The next message that the application will send, has to be appended by the relevant OTA CONFIGURATION UPLINKS types and values (also in octa payload format), which will be parsed by the server.
For the Measurement interval & Multiplier configuration, this uplink type value pair is is Confirmation of interval update (type 35), followed by the new measurement interval and multiplier.

Example

An inital example is provided in the stack under the name ota-configuration-example.

Clone this wiki locally