espruino / Espruino

The Espruino JavaScript interpreter - Official Repo
http://www.espruino.com/
Other
2.75k stars 739 forks source link

Uncaught InternalError: BLE task completed that wasn't scheduled (SERVICE/NONE) #2355

Closed nravanelli closed 1 year ago

nravanelli commented 1 year ago

I am having an issue present itself with the Bangle.js 2 connecting to a Bluetooth device. It is seemingly random and occurs with some of my Bangle.js2 devices, but not all.

I can sometimes get it to connect, but it takes many tries and reboots.

gfwilliams commented 1 year ago

Honestly, this is nowhere near enough information for me to be any help with...

Is your Bangle.js firmware up to date?

What device are you connecting to, and what is the code that's doing the connection?

That BLE task completed that wasn't scheduled error might happen if maybe you'd changed apps while currently trying to request services from the device you're connecting to - so by the time it finally returns the information the Bangle had effectively restarted and was no longer expecting any response from Bluetooth

nravanelli commented 1 year ago

Yes, I apologize for the lack of detail. But, your suggestion helped me narrow down the root cause, among others. Which then also required me to do a massive rewrite to my code... so its better now :)

Suggestion (or perhaps this already exists and I cannot find it) ==> Could we have a wiki/document for all the BLE errors that could possibly happen?

gfwilliams commented 1 year ago

Could we have a wiki/document for all the BLE errors that could possibly happen?

Sounds like a good idea. Any thoughts for where? We could put it under https://www.espruino.com/Troubleshooting+BLE and hopefully it'd get picked up by espruino.com's search?