polarofficial/polar-ble-sdk

updateFirmware fails on iOS SDK 5.8.0 (VeritySense) with notificationNotEnabled error

Opened this issue ยท 5 comments

Platform on which you observed the bug:

  • Android
  • iOS
  • Other
  • Platform is not relevant for this bug

Device on which you observed the bug:

  • Polar OH1
  • Polar Verity Sense
  • Polar H10
  • Polar H9
  • Other
  • Device is not relevant for this bug

Describe the bug
updateFirmware fails with the following error:

2024-11-01T12:58:52.239Z V [Polar SDK] [BLE] Error during device reboot or factory reset: notificationNotEnabled
2024-11-01T12:58:52.239Z V [Polar SDK] [BLE][ERROR] Error during firmware update: notificationNotEnabled

updateFirmware.log

How to Reproduce

  1. Connect with Polar Verity Sense on iOS SDK 5.8.0
  2. Call updateFirmare method.
  3. Wait ~5 minutes.
  4. Observer error.

Expected behavior
updateFirmware should not fail.

Hi @korzonkiee ,

From what version are you trying to perform the update ? Note that there is an issue that it's not possible to perform firmware update with a Verity Sense while it's being charged before latest release 2.2.6 that fixed the issue, so the next firmware updates (if we make any) will work properly with charger. I'm wondering if this could be the issue for you right now ?

Hey @jimmyzumthurm

I was trying to update from 2.1.0. The device was not connected to charger during firmware update.

@korzonkiee Thanks for the information. So I don't see any reason why it would fail from the device side.

@samulimaa @R-Laukka @TeemuLauPolar Could any of you look into this ?

One of our users just experienced this issue on iOS SDK 5.8.0 with Polar 360 as well. After doing some investigation, it looks like after writing the firmware is finished (link), the device gets rebooted and when device reconnects, it tries to factory reset the device (link). However, it appears that sometimes the doFactoryReset method is invoked too early โ€” before the PSFTP_MTU_CHARACTERISTIC becomes enabled โ€” which causes the sessionFtpClientReady method from doFactoryReset to throw PolarErrors.notificationNotEnabled.

In the logs attached above, you can see that the FB005C51-02E7-F387-1CAD-8ACD2D8DF0C8 (PSFTP_MTU_CHARACTERISTIC) was enabled after trying to perform factory reset.

2024-11-01T12:58:52.230Z V [Polar SDK] [BLE] Session opened, deviceId: AD18CC2C
2024-11-01T12:58:52.230Z V [Polar SDK] [BLE] Performing factory reset while preserving pairing information
2024-11-01T12:58:52.238Z V [Polar SDK] [BLE] Factory reset initiated
2024-11-01T12:58:52.239Z V [Polar SDK] [BLE] Error during device reboot or factory reset: notificationNotEnabled
2024-11-01T12:58:52.239Z V [Polar SDK] [BLE][ERROR] Error during firmware update: notificationNotEnabled
2024-11-01T12:58:52.900Z V [Polar SDK] [BLE] GATT Base notifyDescriptorWritten for chr: FB005C51-02E7-F387-1CAD-8ACD2D8DF0C8 enabled: true err 0