Python Forum
Help with bleak - how to send test to BLE device?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with bleak - how to send test to BLE device?
#1
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,
Reply
#2
Not familiar with bleak, but the documentation is here: https://bleak.readthedocs.io/en/latest/
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to automate loop test check on Network device jpc230 1 587 Oct-09-2023, 09:54 PM
Last Post: Larz60+
  Read 2 Value with bleak via BLE notify from ESP32 Nietzsche 8 2,824 May-04-2023, 09:31 PM
Last Post: Nietzsche
  How to continuously receive messages until specified to stop using Bleak jacobbreen25 3 2,141 Dec-28-2022, 04:25 PM
Last Post: jacobbreen25
  bleak library RuntimeError: This event loop is already running alice93 3 4,105 Sep-30-2021, 08:06 AM
Last Post: alice93
  How to test and import a model form computer to test accuracy using Sklearn library Anldra12 6 3,132 Jul-03-2021, 10:07 AM
Last Post: Anldra12
  How to write test cases for a init function by Unit test in python? binhduonggttn 2 3,124 Feb-24-2020, 12:06 PM
Last Post: Larz60+
  How to write test cases by Unit test for database configuration file? binhduonggttn 0 2,560 Feb-18-2020, 08:03 AM
Last Post: binhduonggttn
  Reading UDP from external device without device software ikdemartijn 2 3,407 Dec-03-2019, 04:29 PM
Last Post: Larz60+
  Display device details i.e connected with more than one device shintonp 6 5,320 May-10-2017, 06:00 AM
Last Post: shintonp

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020