Search | Sailfish OS | Running | PineTime | All Posts

InfiniTime 1.6 "Ice Apple" - long standing BLE bug fixed!

October 05, 2021 — Nico Cartron

Yup, you're reading that correctly: a new InfiniTime release is available hardly 3 days after 1.5 (Huckleberry). But there's a really good reason for that!


BLE bug?

As part of making InfiniTime really open-source, JF and the community decided to use Apache NimBLE as the Bluetooth Low Energy stack, rather than using a proprietary one.
This also means that the community has to figure out a lot of things by itself, rather than relying on a "black box" - which is great but makes some bugs pretty hard to squash.

For a while, we had this bug where Bluetooth would stop working after around 18 hours, and the only solution would be to restart your PineTime, by holding the watch button for ~8 seconds.
Pretty annoying, but step by step, some progresses were made, either by upgrading the NimBLE version, or by having e.g. JF to do some extensive BLE debugging sessions.

A one-line PR/fix, really?

And here comes one of the many things I love about Open Source: out of nowhere, Daniel Jackson submitted a one-line PR.

And this PR is super well detailed, explaining why there was a drop in BLE adverts, and how this PR fixes it:

Always returning 0 (when `MYNEWT_VAL_BLE_LL_RFMGMT_ENABLE_TIME` is not defined), rather than a time near to the current tick, causes an issue in at least one place: `ble_ll_adv_sm_start()`, where the calculation of `delta` overflows when the system timer is at 0x80000000 or above -- causing an incorrect, huge adjustment to be made to the scheduled time, ultimately stopping adverts from being sent.

So does it work??

After more than 4 days of testing, I can confirm that the BLE connection is now stable, and still works! No need to restart my PineTime :-)

Interestingly, the tweet mentioning this is one of my most liked tweet :-)

Shall I upgrade?

Absolutely, I highly encourage you to upgrade to Ice Apple, it's really worth it!!!

It's nice, for 2 reasons:

  • first, because obviously it now works "as expected",
  • but more importantly, the devs community will now be able to spend time on more important and interesting features / bug fixes :-)

You can download InfiniTime 1.6 "Ice Apple" from here.


Tags: PineTime


I don't have any commenting system, but email me (nicolas at ncartron dot org) your comments!
If you like my work, you can buy me a coffee!