IanHarvey / bluepy

Python interface to Bluetooth LE on Linux
Other
1.59k stars 491 forks source link

BLEperipheral writeCharacteristic fails with bluepy-helper (badstate) #397

Open marquesn opened 4 years ago

marquesn commented 4 years ago

Hello, I can connect to the device with blePeripheral.connect().

However, when I try to write to a characteristic eg: blePeripheral.writeCharacteristic(0x0024,"\x01")

I get the following error:

File "/usr/local/lib/python2.7/dist-packages/bluepy/btle.py", line 543, in writeCharacteristic
    return self._getResp('wr')
  File "/usr/local/lib/python2.7/dist-packages/bluepy/btle.py", line 407, in _getResp
    resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout)
  File "/usr/local/lib/python2.7/dist-packages/bluepy/btle.py", line 370, in _waitResp
    raise BTLEException("Error from bluepy-helper (%s)" % errcode, resp)
BTLEException: Error from bluepy-helper (badstate)

Anyone got a clue about this?

Thanks.