0

Feather nrf52 - OTA Software Updates
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: Feather nrf52 - OTA Software Updates

by bojh on Thu Jan 10, 2019 10:04 am

just got the notification about a new PR related to that themehttps://github.com/adafruit/Adafruit_nRF52_Arduino/pull/216/commits/9815c09664a937b9cc412a774543e3e04152a07d
... have testet the changes - but no success!

bojh
 
Posts: 29
Joined: Thu Sep 28, 2017 5:17 am

Re: Feather nrf52 - OTA Software Updates

by bojh on Tue Jan 15, 2019 7:54 am

Tested with new release 0.9.3 - but doesn't work yet.
... Connecting
... Enabling Bootloader ...
... Starting DFU ...
App (DFU Library Version 4.1.1) ==> Error: Operation failed
Firmware does hang and only can be reanimated by serial DFU (e.g. by IDE)

bojh
 
Posts: 29
Joined: Thu Sep 28, 2017 5:17 am

Re: Feather nrf52 - OTA Software Updates

by hathach on Tue Jan 15, 2019 8:19 am

Can you me how you test the OTA, android/iphone (also your mobile OS version), which app do you use nrf connect or toolbox app. If you test with iPhone, then please try with Android as well (and vice versa).

hathach
 
Posts: 969
Joined: Tue Apr 23, 2013 1:02 am

Re: Feather nrf52 - OTA Software Updates

by bojh on Tue Jan 15, 2019 8:29 am

Thank's for your reply:
*.zip file taken out of Arduino standard build location user\AppData\... *.zip file.
DFU/OTA tested with
- iPhone (iOS 12.1.2): nRF Toolbox (DFU library 4.1.1)

bojh
 
Posts: 29
Joined: Thu Sep 28, 2017 5:17 am

Re: Feather nrf52 - OTA Software Updates

by hathach on Tue Jan 15, 2019 8:57 am

Thanks for the infor, can you test with nrf connect and/or Android as well

hathach
 
Posts: 969
Joined: Tue Apr 23, 2013 1:02 am

Re: Feather nrf52 - OTA Software Updates

by bojh on Tue Jan 15, 2019 9:02 am

OK first: nRF connect on iOS:
Result: "Operation failed" also with nRF connect.

On Android 7.1.1: nRF Toolbox (DFU Library 1.6.1)
Uploading ...
Starting bootloader .... ca. 20 sec.
Uploading...
0%
1% at this progress the App-DFU does hang for ever.
nRF52-device does hang too in connected mode!
--> also not working !

bojh
 
Posts: 29
Joined: Thu Sep 28, 2017 5:17 am

Re: Feather nrf52 - OTA Software Updates

by hathach on Fri Feb 01, 2019 5:32 am

OTA hanged when connecting with latest BLE5 device such as iPhone X, since iPhone X request to use 2M Phy. This has been fixed with 0.2.7 bootloader.
Please update master branch, burn new bootloader and give it a try
https://github.com/adafruit/Adafruit_nRF52_Arduino

If it is confirmed, we will include this in the next BSP release.

hathach
 
Posts: 969
Joined: Tue Apr 23, 2013 1:02 am

Re: Feather nrf52 - OTA Software Updates

by bojh on Fri Feb 01, 2019 10:00 am

Hi hattach - thx for your reply.
... just have tested the new bootloader: Doesn't work up to now!
Do not have iPhone X (used iPhone 5s).
nRF-toolbox: With bonding the nrf52-app does reboot periodically "Enabling DFU Bootloader..."

bojh
 
Posts: 29
Joined: Thu Sep 28, 2017 5:17 am

Re: Feather nrf52 - OTA Software Updates

by hathach on Fri Feb 01, 2019 12:56 pm

Ok, yours may be a different issue. It has been lots of changes, can you list what you did with as much detail as possible e.g which board ( nrf52832, nrf52840), iphone 5, ios version, mobile app to test, bsp and bootloader version etc... And which sketch file is running (best to be stock example) and which sketch zip is used to uploaded to, did the board is paired with phone or not. I will try to reproduce it here as close as I could, it is reproduced, I will try my bedt to fix it.

hathach
 
Posts: 969
Joined: Tue Apr 23, 2013 1:02 am

Re: Feather nrf52 - OTA Software Updates

by bojh on Thu Feb 07, 2019 4:50 am

Hello Hathach
I would like to support you there:
My setup:
HW: Adafruit feather nrf52832, v2
Arduino-IDE: 1.8.6
Board Manager local: hardware/Adafruit/Adafruit_nRF52_Arduino/
(github master 9.3 from 2019-02-01) including new bootloader from 2019-01-31: SHA:457456a54bbc1e834e308269457e0c2da9e09389
iPhone: iPhone (iOS 12.1.2):
iOS-App: nRF-Toolbox (DFU library 4.1.1)

Board: "Adafruit Bluefruit nRF52832 Feather" (Port:"COM6")
Programmer: "Bootloader DFU for Bluefruit nRF52"
-> "Burn Bootloader" -> OK!

My Tests:
iOS: - Settings - Bluetooth: (pot. old bonded devices:) "Ignore device" -> OK!

Create Test-App:
Examples: Adafruit Bluefruit nRF Libraries - Peripheral - "bleuart"
-> Compile & Upload -> OK!
Look in compile output for Temp directory ...
C:\Users\<user>\AppData\Local\Temp\arduino_build_241243/bleuart.ino.zip
-> send via mail to iOS mobile: "blueuart.ino.zip"

iOS: Open mailer and forward attached "blueuart.ino.zip" to App: "nRF-Toolbox" -> OK!
iOS: nRF-Toolbox: "Firmware Update" is opened and the "blueart.ino.zip" is already preselected.
-> "SELECT DEVICE" -> and choose: "Bluefruit52" OK!
-> Press "Upload" ....
.. starting, Enabling upload at 0% -> "Error: Operation failed"!!!

Next Trail: .... pairing should be mandatory!
add following lines to the bleuart.ino sketch:

Code: Select all | TOGGLE FULL SIZE
// callback invoked when central connects
void connect_callback(uint16_t conn_handle)
{
  char central_name[32] = { 0 };
  Bluefruit.Gap.getPeerName(conn_handle, central_name, sizeof(central_name));

    Serial.print("Pairing ...");   // <<
    if (!Bluefruit.requestPairing()) {   // <<
      Serial.println("Failed");      // <<
    } else {            // <<
      Serial.println("Done!");      // <<
    }               // <<

  Serial.print("Connected to ");
  Serial.println(central_name);
}

-> compile & upload: OK!
... now pairing (bonding) is required!

iOS:
-> open nRF-Toolbox "Firmware Update" again
and test DFU again: (FIRMWARE is still selected!)
-> 1. Choose "SELECT DEVICE"
.... now the "device name" has changed to "AdaDFU"!
-> select "AdaDFU" OK!
-> 1. trigger "UPLOAD"
... "Connecting"
... a request for "Pairing the device" window is opened
... does stay some seconds
... and closes by itself: with "Error: Operation failed"
-> 2. Trail: Choose again "SELECT DEVICE"
... is not possible because firmware DFU Service does
-> Arduino: re-upload via Serial DFU sketch again ... OK!
... device does advertise again... OK!
-> 3. "SELECT DEVICE" choose "AdaDFU" again
-> "Upload" ...and fastly try to confirm "Pairing"...
... "Error: Operation failed!"
... can't see paired device in iOS bluetooth settings!

-> 4. trial with DEBUG level=2:
this is what I got on the Serial Terminal:
Code: Select all | TOGGLE FULL SIZE
[BLE   ] BLE_GAP_EVT_ADV_SET_TERMINATED : Conn Handle = 65535
[BLE   ] BLE_GAP_EVT_CONNECTED : Conn Handle = 0
[GAP   ] Conn Interval= 30.000000
[BLE   ] BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP : Conn Handle = 0
Pairing ...[BLE   ] BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST : Conn Handle = 0
[GAP   ] ATT MTU is changed to 185
[BLE   ] BLE_GAP_EVT_SEC_PARAMS_REQUEST : Conn Handle = 0
[BLE   ] BLE_GATTS_EVT_WRITE : Conn Handle = 0
[BLE   ] BLE_GATTS_EVT_WRITE : Conn Handle = 0
[GATTS ] attr's cccd
000:  01 00                                           | ..

[BLE   ] BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST : Conn Handle = 0

... any ideas?
So my conclusion: There is a problem starting OTA DFU for 0.9.3 firmware images .
For me it's a pity that I can't have any debug information on iOS side.
... and by the way: This procedure has already worked for the old version 0.8 environment.

Thanks for your investigations

bojh
 
Posts: 29
Joined: Thu Sep 28, 2017 5:17 am

Re: Feather nrf52 - OTA Software Updates

by hathach on Thu Feb 14, 2019 5:01 am

thanks for your detail how-to instruction. I am able to reproduce the issue with OTA, and is troubleshooting this. Will let you know when it is fixed.

hathach
 
Posts: 969
Joined: Tue Apr 23, 2013 1:02 am

Re: Feather nrf52 - OTA Software Updates

by tronicgr on Thu Feb 14, 2019 10:54 am

Really interested in this as well, if we can update the firmware via OTA. Does it still requires custom bootloader or the standard bootloader that comes with the NRF52 can do OTA updates of the program?

Thanks
Thanos

tronicgr
 
Posts: 76
Joined: Wed Feb 03, 2016 1:48 pm

Re: Feather nrf52 - OTA Software Updates

by hathach on Thu Feb 14, 2019 2:56 pm

update: OTA works just fine with nrfConnect on Android (although the speed is rather low), but failed with iOS.

hathach
 
Posts: 969
Joined: Tue Apr 23, 2013 1:02 am

Re: Feather nrf52 - OTA Software Updates

by hathach on Fri Feb 15, 2019 12:21 pm

@bojh OTA issue with iOS has been fixed with bootloader version 0.2.8
https://github.com/adafruit/Adafruit_nR ... r/releases

Please download the feather_nrf52832 zip file in above release page and give it a try.
1. You could use the nrfutil command to manually burn new bootloader or
2. just rename current one in the bsp to sth else e.g old_bootloader and rename the newly download one with the old name, so that you could still the IDE burn menu

Let us know if it is fixed, if yes, we will include this in the new BSP release.

@tronicgr : the OTA feature is built-in in our bootloader, search the forum for how to do OTA. There is lots of instruction we gave previously.

hathach
 
Posts: 969
Joined: Tue Apr 23, 2013 1:02 am

Re: Feather nrf52 - OTA Software Updates

by bojh on Fri Feb 15, 2019 12:46 pm

Hi @Hathach,
just have tested your new bootloader - and: It does work correctly :-) - bella!
Have tested with the Arduino way and the iOS nRF-Toolbox DFU functionality.
Thx for your fast troubleshooting and remedy.

bojh
 
Posts: 29
Joined: Thu Sep 28, 2017 5:17 am

Please be positive and constructive with your questions and comments.