Skip to content

[enhancement] Bluetooth LE support for ESP32s #146

@mmvanheusden

Description

@mmvanheusden

Proof-of-concept: https://github.com/mmvanheusden/arduino_web-bluetooth-api

Image

Testing

To test, leaphy-extensions bluetooth branch must be cloned to ~/Arduino/libraries with folder name Leaphy_Extensions.
leaphy-webbased-backend will try to overwrite the library with the upstream one so the skip-libraries branch must be used, and Leaphy_Extensions should be ignored in the config.

conf.py:

     <snip>
     ignored_libraries: list[str] = [
-        ""
+        "Leaphy_Extensions"
     ] # Libraries that should be ignored when downloading them, for testing unpublished changes to libraries
     <snip>

Architecture

Learn: https://learn.adafruit.com/introduction-to-bluetooth-low-energy/gatt
Test with: https://punchthrough.com/how-to-use-lightblue/
Every Leaphy SHOULD have a Leaphy BLE service with the same UUID across Leaphy devices. This can then be used by other apps to distinguish a Leaphy Bluetooth device from a not Leaphy Bluetooth device.

The most important logic is in the LeaphyBLE abstraction file.

To-do list:

  • There should be no more than one BLE.poll(); in loop().
  • Add LeaphyBLE wrapper to leaphy-extensions. This removes the need to maintain a fork of ArduinoBLE Done: feat: add LeaphyBLE Bluetooth LE wrapper leaphy-extensions#8
  • Ability to initiate a connection from a Leaphy to possibly another Leaphy or Bluetooth device with characteristics. For example a device with a binary characteristic that controls a LED.
  • Explore Web Bluetooth API. With chromium-browser --enable-features=WebBluetooth A Chromium-based browser supports web Bluetooth. See PoC.
  • Some types of characteristics need a size set when initialized. Can this overflow and is it large enough?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestresearchAn issue that takes a long time and need some investigation to implement.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions