Skip to content

Support for BLE setup #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ryanckulp opened this issue Jul 2, 2024 · 8 comments
Open

Support for BLE setup #6

ryanckulp opened this issue Jul 2, 2024 · 8 comments

Comments

@ryanckulp
Copy link
Contributor

ryanckulp commented Jul 2, 2024

the TRMNL PCB supports BLE, so we could make this an option for the WiFi credential handshake. requested by Noah in public comments.

our RPi prototype implemented a rough Web Bluetooth API option, but we replaced this with WiFi AP Captive portal.

image

@gdifiore
Copy link
Contributor

Working on this

@gdifiore
Copy link
Contributor

  1. Is there a preference for another web-based UI?
    I have a prototype branch for app-based provisioning, it was easier to implement as a PoC. I do believe keeping a non-web-based option could be beneficial as well.
  2. How should we determine which WiFi provisioning method to use?
    For example, should we have a dropdown in the device settings, or attempt BLE provisioning if the captive portal fails after three retries?

Also, for reference on increased binary size from added BLE libraries:

# Latest `main`
Checking size .pio\build\local\firmware.elf
...
RAM:   [===       ]  28.2% (used 92404 bytes from 327680 bytes)
Flash: [=======   ]  65.5% (used 1288164 bytes from 1966080 bytes)
# WIP BLE WiFi Provisioning (nimBLE library)
Checking size .pio\build\local\firmware.elf
...
RAM:   [===       ]  30.0% (used 98356 bytes from 327680 bytes)
Flash: [=======   ]  74.1% (used 1457082 bytes from 1966080 bytes)

@Omeryl
Copy link
Collaborator

Omeryl commented Mar 14, 2025

Oh yikes. 10% of the flash spent just for provisioning is kind of scary to me since so much flash is already spent on the provisioning for captive portal.

@gdifiore
Copy link
Contributor

Agreed, that's why I paused after getting it working. If someone knows a smaller library than nimBLE I can take a look, but it may be the smallest possible.

@gdifiore
Copy link
Contributor

@ryanckulp Thoughts/ideas on this?

@stevekennedyuk
Copy link

simpleBLE? Or direct use of the ESP-IDF and remove the unnecessary bits

@gdifiore
Copy link
Contributor

gdifiore commented Mar 17, 2025

simpleBLE doesn't appear to support creating Bluetooth characteristics, which is required for receiving data from from the input (either app or web page).

The minimum implementation with ESP-IDF brought the FW binary size up to around 94%(!) of flash. The linker should already "remove unnecessary bits" from the lib, so manually editing code or compiler flags wouldn't change the final binary size.

@0PandaDEV
Copy link

Am I right that this would make it possible to use the trmnl completely without Wi-Fi all over BLE if it were to be implemented? Because that would be a game changer for me as I turn my Wi-Fi off overnight but still need the data.

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

No branches or pull requests

5 participants