Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 of 10 tasks
korzonkiee opened this issue Nov 1, 2024 · 10 comments · May be fixed by #516
Open
2 of 10 tasks

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

korzonkiee opened this issue Nov 1, 2024 · 10 comments · May be fixed by #516
Labels
bug Something isn't working

Comments

@korzonkiee
Copy link
Contributor

korzonkiee commented Nov 1, 2024

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.

@korzonkiee korzonkiee added the bug Something isn't working label Nov 1, 2024
@jimmyzumthurm
Copy link
Member

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 ?

@korzonkiee
Copy link
Contributor Author

Hey @jimmyzumthurm

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

@jimmyzumthurm
Copy link
Member

@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 ?

@korzonkiee
Copy link
Contributor Author

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.

@korzonkiee
Copy link
Contributor Author

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

@korzonkiee
Copy link
Contributor Author

korzonkiee commented Dec 4, 2024

One way to fix it is to update waitDeviceSessionToOpen such that it checks the device session state is sessionOpen and additionally check if FTP client is ready, e.g. via sessionFtpClientReady.

Or, to keep things clean, leave waitDeviceSessionToOpen intact and introduce new waitSessionFtpClientReady method that will similarly to waitDeviceSessionToOpen and use it in places that proceed FTP-requiring operations.

korzonkiee added a commit to korzonkiee/polar-ble-sdk that referenced this issue Dec 6, 2024
korzonkiee added a commit to korzonkiee/polar-ble-sdk that referenced this issue Dec 6, 2024
@korzonkiee
Copy link
Contributor Author

Fixed in #516

@palmqvisti
Copy link
Contributor

palmqvisti commented Dec 10, 2024

FLOW-60541. The Fix will be out in the next release.

@samulimaa
Copy link
Contributor

This should be fixed in the latest SDK release 5.10.0.

@korzonkiee
Copy link
Contributor Author

Thank you, @samulimaa, for taking the time to look into this.

I am currently verifying whether the issue is resolved, but I'm having trouble locating the code that ensures the FTP is ready before any FTP operations are performed. Could you please point me to the part of the code that addresses this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants