Bluetooth disconnecting after 1 second

Posted on
Page
of 2
Prev
/ 2
  • Tried the zip above without higher MTU negotiation with the C3 board and it is much better for me

    This is a really strange one. I was just about to write that MTU might be an issue - I wonder if it's possible that the ESP32 has some kind of static buffer for the MTU that's too small, and sometimes if it gets overwritten it can cause instability in the connection?

  • Well, it works fine from other devices to the ESP32. With verbose logging Arduino core offers MTU 512 and then agrees on 131.

    I tried

    • Bangle 2 to ESP32 (C3 or old classic one) - does not work very well
    • other nrf52 devices to ESP32 - works well

    What I actually did not test is Bangle2 to other devices. Maybe that will break in similar ways too?

  • What I actually did not test is Bangle2 to other devices.

    I tried same code sequence that I was running from Bangle to ESP32 C3 this time from Bangle to another Espruino device and that works just fine.

    I also tried to change TX power both on bangle (NRF.setTxPower) and Arduino (BLEDevice::setPower) because maybe this may be RF related (maybe both C3 and Bangle may be weak at transmitting or receiving so one of them misses the connection request/response) but again no significant difference in success/failure ratio

    I also reduced MTU on ESP32 side (BLEDevice::setMTU) to 131 like bangle and then to 53 like other nrf52 devices, again no significant difference. But this may be the way to not to change Bangle FW if lower MTU helps. If Arduino sketch would set MTU to 23 then no change on Bangle side is needed.

    Overall unlike @jes I do have lot of successful connections but also lot of failures - which would also hint at some RF issue and variation of the C3 and Bangle hardware (antenna)

    @jes maybe you can try to change MTU on Arduino side or TX power possibly on both sides to see if you'll get at least some success instead of complete failure?

    What I'll try in future (weekend probably)

    • put generic Espruino FW to Bangle 2 with no HW drivers to avoid possible SW or HW interference (display refresh, SPI flash traffic,...) to see if it starts working
    • put almost unchanged bangle firmware (just pin number changes) into other 52840 board with SPI flash that works now just fine to see if it breaks
  • I tried putting BLEDevice::setMTU(131) (and also 23) just before and just after BLEDevice::startAdvertising() in my Arduino code from the first post in this thread. No change, the Bangle.js 2 still says it was disconnected after ~1.0 seconds.

    My immediate problem is solved anyway, because I can just report my sensor readings in the "manufacturer data" field, and grab it with NRF.findDevices().

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Bluetooth disconnecting after 1 second

Posted by Avatar for jes @jes

Actions