-
Notifications
You must be signed in to change notification settings - Fork 0
OTA Configuration
[[TOC]]
The idea of over the air configuration, is to standardize a way to configure some common parameters to our devices using two way communication.
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.
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.
The current configuration is kept in a struct at runtime, for ease of accessibility.
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.
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.
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.
An inital example is provided in the stack under the name ota-configuration-example.