From 6eb8cf20943ed0daeaf568dc8dee05a47f2ad874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9za=20Husi?= Date: Thu, 12 Sep 2019 16:59:30 +0200 Subject: [PATCH 1/4] PYFW-375: Documentation for OTA update from 1.18 to 1.20 --- content/tutorials/all/ota.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/content/tutorials/all/ota.md b/content/tutorials/all/ota.md index 49aad5b..9f27999 100644 --- a/content/tutorials/all/ota.md +++ b/content/tutorials/all/ota.md @@ -230,4 +230,24 @@ In order to check your software version, do: ``` import os os.uname().release -``` \ No newline at end of file +``` + +## OTA update from version 1.18 to 1.20 +Between version 1.18 and 1.20 the partition table is changed, the OTA_0 partition, among several others, is relocated because the size of the firmware has been increased due to the extended functioanlity of the 1.20 version. Due to this reason when updating from version 1.18 to 1.20 via OTA, an update to an intermediate version, numbered as 1.18.3, must be performed. +The intermediate version makes sure that when OTA update to 1.20 is requested, the partition table contains correct entries and the new image will be flashed to the proper location. + +The intermediate version, 1.18.3, contains the following EXTRA steps when OTA update is requested: +* Updates bootloader +* Moves the content of the "ota data" partition to its new location +* Updates the partition table + +_Note_: Please note that if bootloader or partition table update fails (e.g.: due to a power-loss), the device will not boot and recover and a new image must be flashed via a cable. + +When the device is being updated to the 1.18.3 intermediate version it may be flashed onto "OTA_0" partition depending on the where current active image is loaded from. In this case on next boot it automatically copies itself from "OTA_0" to "Factory" partition as a preparation for being able to receive the 1.20 image in the future. Without this step when the 1.20 image is being flashed on the "Factory" partition due to its increased size it would overwrite the first segments of the curently running firmware (which is the 1.18.3 and located on "OTA_0" partition). + +Therefore the correct update chain from 1.18 to 1.20 via OTA looks like: 1.18.2 -> 1.18.3 -> 1.20 + +Downgarding from 1.20 back to 1.18 is possible, however the target version must be 1.18.3. The 1.18.3 image able to detect whether a downgrade happened and in this case it will not perform the steps explained above, it behaves as the 1.18.2r7 image just with updated partition table and bootloader. Updating back again to 1.20 is possible and allowed. + +_Note_: Because 1.18 version only supports FatFs it is not supported to update via OTA to an 1.20 variant where the file system is LittleFs and vica-versa. +_Note_: Updating devices with encrypted flash is not supported. From e39d67756fe6137cdfb3450d3706ab948743481f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9za=20Husi?= Date: Fri, 13 Sep 2019 13:18:29 +0200 Subject: [PATCH 2/4] PYFW-247: Add MicroPython API for setting BLE tx Power Level --- content/firmwareapi/pycom/network/bluetooth/_index.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/content/firmwareapi/pycom/network/bluetooth/_index.md b/content/firmwareapi/pycom/network/bluetooth/_index.md index d803ed1..001f733 100644 --- a/content/firmwareapi/pycom/network/bluetooth/_index.md +++ b/content/firmwareapi/pycom/network/bluetooth/_index.md @@ -253,6 +253,15 @@ bluetooth.service('abc123') Closes the BLE connection with the client. +### bluetooth.tx\_power(type, level) + +Gets or sets the TX Power level. +If called with only `type` parameter it returns with the current value belonging to the given type. +If both `type` and `level` parameters are given, it sets the TX Power. + +Valid values for `type`: `Bluetooth.TX_PWR_CONN` -> for handling connection, `Bluetooth.TX_PWR_ADV` -> for advertising, `Bluetooth.TX_PWR_SCAN` -> for scan, `Bluetooth.TX_PWR_DEFAULT` -> default, if others not set +Valid values for `level`: Bluetooth.TX_PWR_N12` -> -12dbm, `Bluetooth.TX_PWR_N9` -> -9dbm, `Bluetooth.TX_PWR_N6` -> -6dbm, `Bluetooth.TX_PWR_N3` -> -3dbm, `Bluetooth.TX_PWR_0` -> 0dbm, `Bluetooth.TX_PWR_P3` -> 3dbm, `Bluetooth.TX_PWR_P6` -> 6dbm, `Bluetooth.TX_PWR_P9` -> 9dbm + ## Constants * Bluetooth mode: `Bluetooth.BLE` @@ -262,3 +271,5 @@ Closes the BLE connection with the client. * Characteristic properties (bit values that can be combined): `Bluetooth.PROP_BROADCAST`, `Bluetooth.PROP_READ`, `Bluetooth.PROP_WRITE_NR`, `Bluetooth.PROP_WRITE`, `Bluetooth.PROP_NOTIFY`, `Bluetooth.PROP_INDICATE`, `Bluetooth.PROP_AUTH`, `Bluetooth.PROP_EXT_PROP` * Characteristic callback events: `Bluetooth.CHAR_READ_EVENT`, `Bluetooth.CHAR_WRITE_EVENT`, `Bluetooth.NEW_ADV_EVENT`, `Bluetooth.CLIENT_CONNECTED`, `Bluetooth.CLIENT_DISCONNECTED`, `Bluetooth.CHAR_NOTIFY_EVENT` * Antenna type: `Bluetooth.INT_ANT`, `Bluetooth.EXT_ANT` +* TX Power type: `Bluetooth.TX_PWR_CONN`, `Bluetooth.TX_PWR_ADV`, `Bluetooth.TX_PWR_SCAN`, `Bluetooth.TX_PWR_DEFAULT` +* TX Power level: `Bluetooth.TX_PWR_N12`, `Bluetooth.TX_PWR_N9`, `Bluetooth.TX_PWR_N6`, `Bluetooth.TX_PWR_N3`, `Bluetooth.TX_PWR_0`, `Bluetooth.TX_PWR_P3`, `Bluetooth.TX_PWR_P6`, `Bluetooth.TX_PWR_P9` From 9509301e34bef6c57360c6566a55f9753781501b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9za=20Husi?= Date: Sun, 15 Sep 2019 16:11:21 +0200 Subject: [PATCH 3/4] Revert "PYFW-247: Add MicroPython API for setting BLE tx Power Level" This reverts commit e39d67756fe6137cdfb3450d3706ab948743481f. --- content/firmwareapi/pycom/network/bluetooth/_index.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/content/firmwareapi/pycom/network/bluetooth/_index.md b/content/firmwareapi/pycom/network/bluetooth/_index.md index 001f733..d803ed1 100644 --- a/content/firmwareapi/pycom/network/bluetooth/_index.md +++ b/content/firmwareapi/pycom/network/bluetooth/_index.md @@ -253,15 +253,6 @@ bluetooth.service('abc123') Closes the BLE connection with the client. -### bluetooth.tx\_power(type, level) - -Gets or sets the TX Power level. -If called with only `type` parameter it returns with the current value belonging to the given type. -If both `type` and `level` parameters are given, it sets the TX Power. - -Valid values for `type`: `Bluetooth.TX_PWR_CONN` -> for handling connection, `Bluetooth.TX_PWR_ADV` -> for advertising, `Bluetooth.TX_PWR_SCAN` -> for scan, `Bluetooth.TX_PWR_DEFAULT` -> default, if others not set -Valid values for `level`: Bluetooth.TX_PWR_N12` -> -12dbm, `Bluetooth.TX_PWR_N9` -> -9dbm, `Bluetooth.TX_PWR_N6` -> -6dbm, `Bluetooth.TX_PWR_N3` -> -3dbm, `Bluetooth.TX_PWR_0` -> 0dbm, `Bluetooth.TX_PWR_P3` -> 3dbm, `Bluetooth.TX_PWR_P6` -> 6dbm, `Bluetooth.TX_PWR_P9` -> 9dbm - ## Constants * Bluetooth mode: `Bluetooth.BLE` @@ -271,5 +262,3 @@ Valid values for `level`: Bluetooth.TX_PWR_N12` -> -12dbm, `Bluetooth.TX_PWR_N9` * Characteristic properties (bit values that can be combined): `Bluetooth.PROP_BROADCAST`, `Bluetooth.PROP_READ`, `Bluetooth.PROP_WRITE_NR`, `Bluetooth.PROP_WRITE`, `Bluetooth.PROP_NOTIFY`, `Bluetooth.PROP_INDICATE`, `Bluetooth.PROP_AUTH`, `Bluetooth.PROP_EXT_PROP` * Characteristic callback events: `Bluetooth.CHAR_READ_EVENT`, `Bluetooth.CHAR_WRITE_EVENT`, `Bluetooth.NEW_ADV_EVENT`, `Bluetooth.CLIENT_CONNECTED`, `Bluetooth.CLIENT_DISCONNECTED`, `Bluetooth.CHAR_NOTIFY_EVENT` * Antenna type: `Bluetooth.INT_ANT`, `Bluetooth.EXT_ANT` -* TX Power type: `Bluetooth.TX_PWR_CONN`, `Bluetooth.TX_PWR_ADV`, `Bluetooth.TX_PWR_SCAN`, `Bluetooth.TX_PWR_DEFAULT` -* TX Power level: `Bluetooth.TX_PWR_N12`, `Bluetooth.TX_PWR_N9`, `Bluetooth.TX_PWR_N6`, `Bluetooth.TX_PWR_N3`, `Bluetooth.TX_PWR_0`, `Bluetooth.TX_PWR_P3`, `Bluetooth.TX_PWR_P6`, `Bluetooth.TX_PWR_P9` From 7c47acf6b5a3701ad48cb564d86ba33477f8fbfe Mon Sep 17 00:00:00 2001 From: iwahdan88 Date: Sun, 15 Sep 2019 20:57:58 +0200 Subject: [PATCH 4/4] Minor Update to OTA --- content/tutorials/all/ota.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/content/tutorials/all/ota.md b/content/tutorials/all/ota.md index 9f27999..cd2444e 100644 --- a/content/tutorials/all/ota.md +++ b/content/tutorials/all/ota.md @@ -233,21 +233,34 @@ os.uname().release ``` ## OTA update from version 1.18 to 1.20 -Between version 1.18 and 1.20 the partition table is changed, the OTA_0 partition, among several others, is relocated because the size of the firmware has been increased due to the extended functioanlity of the 1.20 version. Due to this reason when updating from version 1.18 to 1.20 via OTA, an update to an intermediate version, numbered as 1.18.3, must be performed. +Between version 1.18.2 and 1.20 the partition table is changed, the OTA_0 partition, among several others, is relocated because the size of the firmware has been increased due to the extended functionality of the 1.20 version. Due to this reason when updating from version 1.18.2 to 1.20 via OTA, an update to an intermediate version, numbered as [1.18.3](https://github.com/pycom/pycom-micropython-sigfox/tree/v1.18.3), must be performed. The intermediate version makes sure that when OTA update to 1.20 is requested, the partition table contains correct entries and the new image will be flashed to the proper location. -The intermediate version, 1.18.3, contains the following EXTRA steps when OTA update is requested: +The intermediate version, [1.18.3](https://github.com/pycom/pycom-micropython-sigfox/tree/v1.18.3), contains the following EXTRA steps when OTA update is requested: * Updates bootloader * Moves the content of the "ota data" partition to its new location * Updates the partition table _Note_: Please note that if bootloader or partition table update fails (e.g.: due to a power-loss), the device will not boot and recover and a new image must be flashed via a cable. -When the device is being updated to the 1.18.3 intermediate version it may be flashed onto "OTA_0" partition depending on the where current active image is loaded from. In this case on next boot it automatically copies itself from "OTA_0" to "Factory" partition as a preparation for being able to receive the 1.20 image in the future. Without this step when the 1.20 image is being flashed on the "Factory" partition due to its increased size it would overwrite the first segments of the curently running firmware (which is the 1.18.3 and located on "OTA_0" partition). +When the device is being updated to the [1.18.3](https://github.com/pycom/pycom-micropython-sigfox/tree/v1.18.3) intermediate version it may be flashed onto "OTA_0" partition depending on the where current active image is loaded from. In this case on next boot it automatically copies itself from "OTA_0" to "Factory" partition as a preparation for being able to receive the 1.20 image in the future. Without this step when the 1.20 image is being flashed on the "Factory" partition due to its increased size it would overwrite the first segments of the curently running firmware (which is the 1.18.3 and located on "OTA_0" partition). Therefore the correct update chain from 1.18 to 1.20 via OTA looks like: 1.18.2 -> 1.18.3 -> 1.20 Downgarding from 1.20 back to 1.18 is possible, however the target version must be 1.18.3. The 1.18.3 image able to detect whether a downgrade happened and in this case it will not perform the steps explained above, it behaves as the 1.18.2r7 image just with updated partition table and bootloader. Updating back again to 1.20 is possible and allowed. -_Note_: Because 1.18 version only supports FatFs it is not supported to update via OTA to an 1.20 variant where the file system is LittleFs and vica-versa. _Note_: Updating devices with encrypted flash is not supported. + +_Note_: Downgrading via OTA from 1.18.3 to 1.18.2.xx is not allowed as this might casuse further OTA operations to fail. + +_Note_: Before doing OTA to 1.20 firmware make sure that the Scripts on device are updated (if necessary) to be compatible with 1.20 FW to avoid exceptions once device is updated to 1.20 which might lead to loosing connection to the remote device. + +You can find firmware images for 1.18.3 here: + +[Wipy](https://software.pycom.io/downloads/WiPy.html) +[FiPy](https://software.pycom.io/downloads/FiPy.html) +[GPy](https://software.pycom.io/downloads/GPy.html) +[LoPy](https://software.pycom.io/downloads/LoPy.html) +[LoPy4](https://software.pycom.io/downloads/LoPy4.html) +[SiPy](https://software.pycom.io/downloads/SiPy.html) +