Perform OTA Update
[TCP/WebSocket <--> InvisOutlet]
Perform an OTA update for InvisOutlet, InvisDeco, or both devices as one ordered full update.
Request
packetID: The packet ID. This can be any six-digit number with no leading zeros.payload:callbackName: 21callbackArgs:1: Update target; 1 - InvisOutlet only, 2 - InvisDeco only, 3 - Update all (InvisDeco first, then InvisOutlet)2: InvisDeco update method; 0 - Update via Wi-Fi, 1 - Update via InvisOutlet
callbackArgs
Operation
[1,0]
Update InvisOutlet over Wi-Fi
[2,0]
Update InvisDeco over Wi-Fi
[2,1]
Update InvisDeco through InvisOutlet.
[3,0]
Update all: InvisDeco over Wi-Fi, then InvisOutlet over Wi-Fi
[3,1]
Update all: InvisDeco through InvisOutlet, then InvisOutlet over Wi-Fi.
[3,1] always transfers the InvisDeco image via InvisOutlet. The InvisDeco will be updated regardlessly if the firmware version is already up-to-date.
Update all using InvisDeco Wi-Fi
Update all using InvisDeco via InvisOutlet
Update-all sequence
For target 3, InvisOutlet treats both device updates as one ordered transaction:
InvisDeco starts using the selected update method.
When InvisDeco succeeds, InvisOutlet starts its update over Wi-Fi.
If InvisDeco is already up-to-date during
[3,0], its stage is treated as a successful no-op and InvisOutlet still starts.If InvisDeco fails, the pending InvisOutlet stage is cancelled.
InvisOutlet owns the handoff. A client must not send a second callback 21 request after receiving the successful InvisDeco result.
If InvisOutlet loses power or unexpectedly restarts before the transaction finishes, refresh both firmware versions and issue a new request if required.
Progress and result events are emitted separately for each device. Clients receive InvisDeco events first (callbackArgs[0] = 2), followed by InvisOutlet events (callbackArgs[0] = 1). When an InvisOutlet WWW partition update is included, its events use callbackArgs[0] = 3.
Immediate response
The immediate response confirms whether the request was accepted.
sn: InvisOutlet serial number.packetID: The request packet ID.PUBACK:1— Request accepted and the first stage will start.0— Request rejected or could not initialize. Target3is also rejected when InvisDeco is offline, the arguments are invalid, or another OTA transaction is active.
Synchronous stage-start response
payload.callbackName:21payload.callbackArgs[0]: Device whose OTA stage is starting.1— InvisOutlet2— InvisDeco
payload.callbackArgs[1]:1— OTA stage can continue0— OTA stage failed to initialize
For an accepted update-all request, the normal order is:
InvisDeco stage-start/progress/result events with device role
2.InvisOutlet stage-start/progress/result events with device role
1.Optional InvisOutlet WWW progress/result events with role
3, when a WWW update is included.
A successful InvisDeco result is an intermediate result, not completion of the update-all operation.
Last updated