0

i tried to notify the device but the problem is that nothing is printed in my console when using this function:

def callback(sender: int, data: bytearray):                                                                           
    print("{0}: {1}".format(sender, data))

in the main program i used start_notify method

await client.start_notify(chrc, callback)

I'm asking, does anybody have a idea how to print the data

  • 1
    Are you able to share more relevant informaton? For example, which IDE you are using (PyCharm) isn't relevant, but which operating system and Python library you are using is. Have you used a generic Bluetooth Low Energy scanning and exploration tool (e.g. [nRF Connect](https://www.nordicsemi.com/Products/Development-tools/nRF-Connect-for-mobile)) to find the properties of the UUID? For example, are you trying to write to a UUID or get notifications from a UUID? – ukBaz Mar 14 '22 at 10:47
  • i'm using PyCharm on windows , the library is bleak . in fact i already connected to a specififc device . what i'm trying to do is i'm sending chunks to a specific characteristic and i need to get a notification from another characteristic each time time i send a chunk – GHAZI JALLOULI Mar 15 '22 at 11:29
  • Is the `UART` example in the Bleak repo not very close to what you want? https://github.com/hbldh/bleak/blob/develop/examples/uart_service.py – ukBaz Mar 15 '22 at 11:58

0 Answers0