-
'I switched from serial back to Web Bluetooth and that seems to have changed the MDBT42Q Central behavior'
Have you seen this note beneath heading 'Serial Console' from:
https://www.espruino.com/MDBT42Q#Serial-Console
"When you connect via Bluetooth, the console will automatically move over. To stop this, execute Serial1.setConsole(true) to force the console to stay on Serial1"
The entire section contains valuable tid-bits
'I can connect to the sensor now'
Which sensor? Link would be valuable to others attempting to diagnose.
What is being used to power the MDBT42Q breakout board? Could an old battery be the culprit? Power spikes, decoupling caps?
Hi again,
so this is really weird ... for reasons I don't understand it just started working. I can connect to the sensor now (well, most of the time, see below) and I also just added some code to read a service and characteristic and that works as expected. But the connect part of the code is still the same as before, so it's a bit of a mystery.
What I did change was the console settings. I switched from serial back to Web Bluetooth and that seems to have changed the MDBT42Q Central behavior. Although this is still not 100% reliable ... sometimes Web Bluetooth fails to connect to the MDBT42Q and sometimes Web Bluetooth unexpectedly disconnects and I have to power-cycle the MDBT42Q to get it to connect to the IDE again.
It feels like there is some combination of serial, Bluetooth, the console setting, and some other factor that messes up the MDBT42Q Bluetooth stack to a point where it wouldn't connect to anything as a Central. I also still get occasionally "Uncaught InternalError" from the MDBT42Q.
I will keep on eye on this and try to create reproducible behavior. Thanks for helping so far!
Best,
-- Terrence