Skip to content

Conversation

@JakubAndrysek
Copy link

@JakubAndrysek JakubAndrysek commented Jun 15, 2025

This pull request introduces BLE (Bluetooth Low Energy) support to the Jaculus ESP32 project, enabling it as an additional communication transport. The changes include updates to the build configuration, new BLE-specific functionality, and integration into the existing system.

Using this feature, users can now connect to the Jaculus ESP32 device over BLE also from the Web Browser - tested with a modified version of https://github.com/C2Coder/JacLy.
Online version is available at https://f.kubaandrysek.cz/JacLy-BLE. Tested with ESP32-S3.

image
Changes: https://gist.github.com/JakubAndrysek/3000812b2758116b8d814edc71826c3f

Everything seems to work well. I have tested simultaneous connections over BLE and Wi-Fi socket, and it works as expected. The BLE connection is stable and allows sending and receiving codes without issues.

Needs additional testing and review, especially regarding BLE performance and stability.
I haven't also updated sdkconfig files.


Below is a summary of the most important changes:

BLE Support Implementation

  • Added BleStream class: Implemented a BLE GATT server in main/util/bleStream.h to provide duplex communication. The class includes features like configurable MTU size, device name generation, and event handling for GAP and GATTS. It integrates with the existing transport system as a new stream type.

  • Conditional BLE initialization: Updated main.cpp to conditionally include and initialize the BLE stream based on the CONFIG_JAC_ESP32_ENABLE_BLE flag. This includes creating a BLE stream instance, starting it, and binding it to the multiplexer. [1] [2] [3]

Build System Enhancements

  • Refactored CMakeLists.txt: Modularized the component registration process and added conditional inclusion of BLE-related files and dependencies. This ensures BLE support is included only when enabled via configuration.

  • Updated CMake version requirement: Increased the minimum required version of CMake to 3.10 in main/resources/CMakeLists.txt to support newer features.

Configuration Options

  • Added BLE configuration options: Introduced a new menu in main/Kconfig.projbuild for configuring BLE features, including enabling/disabling BLE, setting the device name prefix, configuring GATT service/characteristic UUIDs, and specifying the MTU size. Debug logging for BLE operations can also be toggled.

@JakubAndrysek JakubAndrysek marked this pull request as draft June 15, 2025 14:35
@cubicap cubicap force-pushed the master branch 3 times, most recently from 882f36c to e2cd344 Compare July 2, 2025 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant