For application layer to send configuration message to device fleet, different from the configuration API exposed to front end.
Endpoint: http://52.35.217.241:1880/configuration
app_id
- required- AppEUI, fixed value for the traffic calming project
device_ids
- required- List of devEUI
config_id
- required- Identifier of the configuration, equals to the
incrementalId
in
- Identifier of the configuration, equals to the
schedules
- required- lists of configuration changes and their effective time
start_from
: required- represent in unixtime, 0 or a time in the past means to execute the configuration ASAP
params
: required- one or more parameters to change device behavior, refer to parameters
duration
- required- in seconds
repeat_interval
: optional- if not specified, the configuration expires after its duration
{
"app_id": 1,
"device_ids": [1,2,3],
"config_id": 00001,
"schedules": [
{ // morning rush hours
"start_from": 1491894000, // 04/11/2017T07:00:00
"duration": 10800, // 3 hrs
"repeat_interval": 86400, // 1 days
"params": {
"min_report_interval": 3600, // 1 hrs
"bucket_size": 300, // 5 min
"device_mode": 1, // 1: normal, 2: passive
}
},
{ // normal
"start_from": 1491904800, // 04/11/2017T10:00:00
"duration": 21600, // 6 hrs
"repeat_interval": 86400, // 1 days
"params": {
"min_report_interval": 43200, // 3 hrs
"bucket_size": 900, // 15min
}
},
{ // afternoon rush hours
"start_from": 1491904800, // 04/16/2017T10:00:00
"duration": 10800, // 3 hrs
"repeat_interval": 86400 // 1 days
"params": {
"min_report_interval": 3600, // 1 hrs
"bucket_size": 300, // 5 min
}
},
]
}
The behavior of a devices is defined by 2 layers of configurations:
- Default setting of the device
- Scheduled configuration: run for certain period of time, maybe periodically
- When there's no configuration scheduled for current moment, the device runs under the default setting
- The /configuration API updates this layer
//TODO: add graph
- Device only executes the new configuration after a data packet is formed
- When device sending uplink packet, the CONF_ACK field represents the current running configuration and the default setting. (xor)
More information:
https://gist.github.com/Sushisugre/fe429cdaf90e78e4bcf826a5ebf7ac56