BLE implementation
Any plans to have bluetooth connectivity instead of wifi? i'm looking to build a mobile app that design and push GIF's through bluetooth something similar to this app:
https://play.google.com/store/apps/details?id=com.led.iledcolor
I believe the ESP32 already have bluetooth capabilities
That would be great! ESP32 does have builtin BT. Let me know what do you need from the Clockwise firmware side, I can help.
Would be nice if the firmware expose a simple communication protocol over BT that mirrors the existing Clockwise API plus a function to push JSON updates directly over Bluetooth.
Maybe a flag to skip embedding the hosted webpage in flash, to save memory.
I'd appreciate any guidance on where you think the best entry point in the firmware would be for this.
@chihebdev Let's start providing the configuration first. We could use BLE with GATT, each parameter is a characteristic, can you create an app that could read and write those characteristics?
These are all parameters available -> https://github.com/jnthas/clockwise/blob/main/firmware/lib/cw-commons/CWWebServer.h
Sure! I can put something together for that.
Hi @jnthas,
I’ve drafted an Android app that scans for the ESP32 over BLE and mirrors all parameters from CWWebServer.h as readable and writable GATT characteristics.
Once the firmware exposes these configs over BLE, the app should work with real values immediately. Let me know if you’d like me to adjust the UUID structure or parameter layout.
You can find the repo here
Hello @chihebdev, thank you for that! I will take a look this weekend and let you know
Hello @chihebdev! I have implemented BLE support in Clockwise but I'm having some problems to set the values. The app can discover the device and connect, when I try to set a value I see it was disconnected. Not sure exactly where is the problem.
Here is the branch with the changes if you can take a look. I've created 1 file called CWBLEServer that hold all the logic and changed the ´main´ to start advertising when it boots.
This is the ESP32 log you should see when it starts and connects: ´´´ Starting BLE Server... BLE: Initializing BLE Server... BLE: Device initialized as 'Clockwise' BLE: Server created BLE: Services created BLE: Device config characteristics set up BLE: Network characteristics set up BLE: Display characteristics set up BLE: Device info characteristics set up BLE: All services started BLE: Advertising started with service UUID BLE: Server initialized and advertising BLE: Advertising UUID: 11111111-0000-1000-8000-00805F9B34FB BLE: Client connected BLE: Client disconnected - restarting advertising ´´´
This is the screenshot when it connects:
When I try to set a parameter
When it disconnects