hbldh / bleak

A cross platform Bluetooth Low Energy Client for Python using asyncio
MIT License
1.74k stars 292 forks source link

Connect bleak client to GATT Server running in MicroPython on ESP32 #1600

Closed jlandgrave62 closed 3 months ago

jlandgrave62 commented 3 months ago

Description

In this article : https://randomnerdtutorials.com/micropython-esp32-bluetooth-low-energy-ble/

The authors demonstrate how to create a BLE Server that publishes Read/Write Characteristics. I would like to know if it's possible to use bleak to build a client app that runs on a small micropython remote with Two Buttons that, when pressed , update a characteristic on the ESP32 BLE Server.

I didn't see any option in the bleak repository for the backend to be a microcontroller. As far as I can tell the supported back ends are microprocessors running fat operating systems. I'm trying to build a BLE Remote Client and Server using micropython on both devices where pressing buttons on the BLE client can set a value on the BLE Server. The BLE Server then displays information on an LED Matrix based on the client BLE button that was pressed.

If bleak cannot handle this, I'd appreciate any references you can share that might allow this.

What I Did

It is preferable if an issue contains a Miminal Workable Example. This will otherwise be one of the first questions you will get as a response.

It is also preferable if that example is not dependent on a specific peripheral device, but can be run and reproduced with other BLE peripherals as well.

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here as well.

Logs

Include any relevant logs here.

Logs are essential to understand what is going on behind the scenes.

See https://bleak.readthedocs.io/en/latest/troubleshooting.html for information on how to collect debug logs.

If you receive an OS error (WinError, BleakDBusError, NSError, etc.), Wireshark logs of Bluetooth packets are required to understand the issue!