Open kevinjwalters opened 2 years ago
I suspect there's some sort of timing issue where delays are required to workaround bugs but I'm really not sure here.
Interesting--that sounds believable. If a short sleep after connecting & before subscribing (since I think the subscription request is the only time we send data to the device) resolves it, then that's unfortunate, but also simple enough.
I have not had a chance to dig deeper into this issue.
When you say rebooting are you referring to the oximeter?
I asked myself the same thing when I read over the readme just now :) I think I meant reboot the oximeter.
I've been experimenting with large and small delays between receiving the BLE advertisement and making the connection. The strange thing is that a print statement to the serial console in CircuitPython seems to make things work about 95% of the time. Delays of a a few ms don't appear to help at all. I might have hit a CircuitPython specific issue or maybe I just never found the exact ms delay... All very odd
The strange thing is that a print statement to the serial console in CircuitPython seems to make things work about 95% of the time. Delays of a a few ms don't appear to help at all. I might have hit a CircuitPython specific issue or maybe I just never found the exact ms delay... All very odd
That is quite odd! How do delays in CircuitPython work?
Sometimes print statements aquire a lock, allowing other threads to run (if CircuitPython has threads, I've never used it). And sometimes delay code works by doing a busy loop.
Either of those things could explain the odd behavior.
P.S. looks like it might be possible to dump the flash on the device and reverse-engineer the bug: https://limitedresults.com/2020/06/nrf52-debug-resurrection-approtect-bypass/. Not something I have time for right now, but seems like a good intro to power glitching.
.
I've noticed some peculiarities with a
PC60-FW
(Wellue brand name on device) where my CircuitPython code fails to get data. I sometimes get some if I run the same code interactively. I suspect there's some sort of timing issue where delays are required to workaround bugs but I'm really not sure here. This could be related to the issue you mention in https://github.com/L0rek/PC-60FW/blob/main/README.mdDid you get to the bottom of that? When you say rebooting are you referring to the oximeter?