I'm calling Bangle.http(...) from the Bangle every 1 second. After the memory leak on android has been resolved, it works much more stable now, however, I regularly run into another issue:
The Bangle sometimes runs into a strange state, where Bangle.http(...) systematically raises the "Timeout" exception, although the https server definitively never times out and returns immediately. The bangle seems to get into this state especially, when the bangle and the android phone automatically reconnect after a connectivity loss. It is a spurious problem and in most automatic reconnects, all is fine. Whenever the system is in the erroneous state, a manual disconnect and then connect from within gadgetbridge (global android Bluetooth can remain enabled during the reconnect) always fixes the issue for some time.
My suspicion is that after the automatic reconnect, some scrambling on the Bluetooth UART link occurs occasionally. Maybe there is something, which is reinitialized when manually reconnecting, but not when automatically reconnecting?
I have looked at:
adb logcat|grep gadgetbridge|grep UART
Whenever all is fine, I see repeating (personal data removed from the request and the response):
06-10 01:59:31.378 28485 28503 I nodomain.freeyourgadget.gadgetbridge.service.devices.banglejs.BangleJSDeviceSupport: UART RX LINE: {"t":"http","url":"https://...","id":"79638536497"}
06-10 01:59:31.386 28485 28503 I nodomain.freeyourgadget.gadgetbridge.service.devices.banglejs.BangleJSDeviceSupport: UART RX JSON parsed successfully
06-10 01:59:31.508 28485 28485 I nodomain.freeyourgadget.gadgetbridge.service.devices.banglejs.BangleJSDeviceSupport: UART TX: GB({t:"http",id:"79638536497",resp:"{...)
06-10 01:59:32.351 28485 28502 I nodomain.freeyourgadget.gadgetbridge.service.devices.banglejs.BangleJSDeviceSupport: UART RX LINE:
06-10 01:59:32.382 28485 31310 I
When it is broken, I see this kind of line regularly:
05-25 22:09:43.726 11962 12934 I nodomain.freeyourgadget.gadgetbridge.service.devices.banglejs.BangleJSDeviceSupport: UART RX line started with 13 - ignoring
The 13 seems to be random, it changes. The personal data reported in the RX/TX debug lines is still there, but it looks incomplete and random parts are missing.
Thank you in advance for letting me know what you think.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hello,
I'm calling Bangle.http(...) from the Bangle every 1 second. After the memory leak on android has been resolved, it works much more stable now, however, I regularly run into another issue:
The Bangle sometimes runs into a strange state, where Bangle.http(...) systematically raises the "Timeout" exception, although the https server definitively never times out and returns immediately. The bangle seems to get into this state especially, when the bangle and the android phone automatically reconnect after a connectivity loss. It is a spurious problem and in most automatic reconnects, all is fine. Whenever the system is in the erroneous state, a manual disconnect and then connect from within gadgetbridge (global android Bluetooth can remain enabled during the reconnect) always fixes the issue for some time.
My suspicion is that after the automatic reconnect, some scrambling on the Bluetooth UART link occurs occasionally. Maybe there is something, which is reinitialized when manually reconnecting, but not when automatically reconnecting?
I have looked at:
Whenever all is fine, I see repeating (personal data removed from the request and the response):
When it is broken, I see this kind of line regularly:
The 13 seems to be random, it changes. The personal data reported in the RX/TX debug lines is still there, but it looks incomplete and random parts are missing.
Thank you in advance for letting me know what you think.