Python Forum

Full Version: Help with bleak - how to send test to BLE device?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
I'm trying to send data to my BLE device - but can't seem to find hte right fundtion for it

this is what I have done so far:
om bleak import BleakClient

address = "A7:01:Ad:A4:4A:A0"

async def main(address):
    client = BleakClient(address)
    try:
        await client.connect()
    except Exception as e:
        print(e)
    else:
        client.write('test')

asyncio.run(main(address))
on the BLE device - I can see the connection
but how do I send to it "test" ?

**** the BLE device is arduino nano BLE (if it's metter)

Thanks,
Not familiar with bleak, but the documentation is here: https://bleak.readthedocs.io/en/latest/