For LTE OTA pull request 1762, Example Script

For the below release in OS 1.1.1-rc.1, does anyone have an example script to try the OTA updates every 30 sec for 30 min to update the OS version while the device is in safe mode? Ie update from OS 1.1.0 to 1.2.1-rc.3.

[Electron/LTE] disables all eDRX AcT types [ch32051] #1762

Note: When eDRX mode is enabled, TX on the device temporarily allows the network to RX faster. For example, if the device published every 2 minutes and we asynchronous tried to read a Particle Variable every ~5 seconds, the device would up timing out 2-3 times in a row and succeeding 2-3 times in a row repeatedly. This affects OTA updates as well. An OTA update might never start until the device pings the Cloud and reduces the RX timing in the network. Because of this, devices with this behavior that are remote in the field might need special care in updating them remotely, Ex. a script that repeatedly tries OTA updating every 30 seconds for 30 minutes.

Here’s what I used:

while [ : ]
do
      curl -X PUT "https://api.particle.io/v1/products/${PRODUCT_SLUG}/devices/${DEVICE_ID}" -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" -d '{"desired_firmware_version":123,"flash":true}'
      sleep 30
done
1 Like