Bluetooth UART on ESP32

Posted on
  • Hi,

    I'm just playing with BLE on ESP32, and it's looking really good (although loads of warnings! :) ).

    @JumJum you mentioned issues with BLE UART? It looks like you can turn it on with NRF.setServices({},{uart:true})?

    One thing I noticed is that while it has the service 6e400001-b5a3-f393-e0a9-e50e24dcca9e once connected, that's not actually advertised - that could well be affecting whether the device is found or not (usually I advertise it in the 'scan response' packet).

    The other thing, which I think explains your dropout when trying to connect on windows (and which I get issues with as well) is notifications on the TX characteristic (6e400003...).

    If you connect with NRF connect, then go to that characteristic and click the 3 downarrow icon to the right of it, that should enable notifications. It does on something like a Puck.js (the button is toggleable) - you should be able to change the 'characteristic configuration' descriptor between 'Notifications and indications disabled' and 'Notifications enabled'.

    I think it must be something like the write to the characteristic descriptor needing a special response? It looks like you need something like this: https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/gatt_server/main/gatts_demo.c#L356-L404

  • @Gordon

    Great to hear you have an esp32 to play with now!

    I think @JumJum has made more progress on the uart - however has not updated any github repository yet.

    I'm trying to get the Bluetooth scanning working - I'm trying to connect to a digital thermometer called a Tilt - however at this stage can set it with scans using the esp32. I don't know if it's an implementation issue on esp32. I've managed to get a puck working- so I'll try a scan on that and compare the output.

  • @wilberforce, I've UART running with my Android phone.
    @Gordon, testing the same with Windows is a desaster.
    There is nothing I can replicate. Problems occur following a kind of randomizing.
    Problems like:

    • BLE scanner shows all boards, but admin page shows only a few of them.
    • sometimes ESP32 is not recognized, sometimes puck.js is not recognized
    • testing with Chrome browser tells "Bluetooth Adapter not available", from time to time
    • sometimes WebIDE recognizes boards (even Puck.js), but does not connect
    • and some others where I don't even know how to describe

    My priority right now is to add enable/disable for Bluetooth which saves about 2000 jsVars.
    Once this is done, next step will be to add UART, at least for Android clients
    Last not least, Windows will get a new try. BTW, feedback from ESP32Forum to Windows was poor, and misleading. Nothing from an Espruino guy.

  • Hi team, I really appreciate the work you've been doing, I've been quietly watching for quite a while. My critical requirement is BLE UART (along with analog read, pwm and I2C for an ADS1115 ADC as esp32 adc seems untrustworthy), so let me know if there's some bounty I could assist with, and I can also help by validating ios & android clients written on the ionic platform as that will likely be your major client base..

  • Enable/disable Bluetooth and WIFI is in actual git
    UART works in my test with Android, but not on Windows 10. To be open, I've some questionmarks how to fix this.

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

Bluetooth UART on ESP32

Posted by Avatar for Gordon @Gordon

Actions