Open mattysouth opened 4 years ago
I'm experiencing exactly the same and I'm afraid there is some problem in Characteristic.write(). I'm not sure if there will be a fix for this, since this module appears outdated. With bluez command line tools(I'm using 5.50), writing the characteristic works just fine.
I'm attempting to turn on and off an LED by using the writeCharacteristic command. My arduino BLE code takes in any number other than zero to turn the led on and zero to turn the LED off
This is the python script used for the central device:
from bluepy import btle import time import binascii
print ("Connecting...") dev = btle.Peripheral("3c:71:bf:cc:5c:7a")
print ("Services...") for svc in dev.services: print (str(svc))
char = dev.getCharacteristics() for c in char: print (c)
ser = dev.getServiceByUUID("19b10000-e8f2-537e-4f6c-d104768a1214") c = ser.getCharacteristics()[0]
print(c.valHandle)
dev.writeCharacteristic(c.valHandle, bytes(0x0110010))
I don't run into any run time error but the nano doesn't seem to respond to any of the writeCharacteristic commands. I can connect to the nano using my android phone through nrfConnect App and it works like magic. Is there something that I am missing out on?
Thank you.