Closed pauledd closed 4 years ago
Got it working:
class MyDelegate(DefaultDelegate):
def __init__(self):
DefaultDelegate.__init__(self)
def handleNotification(self, cHandle, data):
print(cHandle,data)
dev = Peripheral("0c:ae:7d:xx:xx:xx")
dev.setDelegate(MyDelegate())
# authenticate
z = dev.getCharacteristics(0x0028,0x0029)
dev.writeCharacteristic(0x0029,bytearray.fromhex("2107060504030201b8220000000000",),1)
# Enable realtime data collection
s = dev.getCharacteristics(0x0033,0x0034)
dev.writeCharacteristic(0x0034,bytearray.fromhex("0B0100000000"),1)
# Subscribe to realtime data collectionx
service = dev.getServiceByUUID(UUID("0000fff0-0000-1000-8000-00805f9b34fb"))
service.getCharacteristics(UUID("0000fff4-0000-1000-8000-00805f9b34fb"))
i=0
while i<10:
if dev.waitForNotifications(2.0):
print("Notifi")
continue
i+=1
print("waiting")
Hi there
I have a Inkbird (IBT-2x) Thermometer and want to read its temperature values. I was able to get notifications from it just by sending this with gatttool:
The "c8 00" is the temperature in hex and in that case its 20°C. How can I get this values with bluepy? I tried to replicate the gatttool commands with this:
but this gives only back:
any help would appreciated Ps: