Add support for Companion BLE OTA updates on nRF devices#2323
Add support for Companion BLE OTA updates on nRF devices#2323liamcottle merged 3 commits intomeshcore-dev:devfrom
Conversation
|
Thanks @liamcottle! I appreciate you and @recrof's help working through this. I have experienced the same need to forget the BLE device to get OTA updates to work on IOS devices running the Nordic DFU app, even prior to the changes in this PR. I have noticed that it would fail immediate when executing the step to try enabling the bootloader. If I forgot the device in BLE settings, and then re-paired through the DFU app, it worked fine, and continues to work going forward, both in the DFU app and the MeshCore app. I have also tested this PR on both RAK4631 and RAK3401 boards and it works as intended. Using NRF Connect for Mobile, the Legacy DFU service now appears in the BLE stack where it did not before. |
|
Updated the FAQ to reference Companion OTA. |
LitBomb
left a comment
There was a problem hiding this comment.
Thanks for updating the FAQ to match the new functionality.
there is a gap between 1.14.1 and the new FAQ information. If I understand it correctly from the discussion, one suggestion I have is to add some info to remind users that this feature only works with 1.15 firmware or newer, and that 1.15 needs to be already flashed onto the companion radio before BLE OTA can work.
Additional language added as requested. Thanks! |
This PR adds support for BLE OTA updates to MeshCore companion devices running on nRF based boards.
Thanks to @txkbaldlaw for the original changes. I've opened the PR on your behalf so you get credits for the commits.
When I originally looked into BLE OTA updates for companion devices a few months ago, I had made the same changes in this PR. However, I ran into several issues. One was mainly due to the outdated bootloader that comes preflashed by the factory on most devices sold by manufacturers.
The outdated bootloader would fail to update firmware with the default settings provided by the nRF DFU app for Android and iOS, and because it pre-wipes the flash when the BLE OTA process is started, it was not possible to reboot the device back into MeshCore companion firmware without a full reflash via USB.
Another issue is that if you had already paired with the device on Android without the changes in this PR, you would need to forget the device in Android Bluetooth settings, otherwise the OTA would fail with an error saying the device doesn't not support nRF DFU. This is most likely due to the Android device caching the BLE services/characteristics at pairing time. So an unpair/repair is needed to discover that the device supports the nRF BLE OTA service...
Please see the following list of things to keep in mind when using BLE OTA for companion devices:
4in the nRF DFU app for OTA to work, otherwise it fails 100% of the time due to this bug: DFU OTA always fails adafruit/Adafruit_nRF52_Bootloader#306Please see our blog posts for more information on how to update the bootloader and perform a BLE OTA update:
These changes have been tested on the WioTracker L1 Pro, with both the outdated bootloader and the OTAFIX bootloader.