buttplugio / stpihkal

Repo deprecated, STPIHKAL moved to docs.buttplug.io repo
https://docs.buttplug.io/
93 stars 21 forks source link

Document Elvie Trainer protocol #109

Open knkelec opened 3 years ago

knkelec commented 3 years ago

I expected it to use NOTIFY, but doesn't seem to. Instead, this reads the pressure in a loop. Maybe the pressure info is wider than a single byte, but this seems to work (byte 5 (6th) of the byte array you get back), outputting a range approx 9-21:

from bluepy.btle import Peripheral, UUID

p = Peripheral(sys.argv[0]) # MAC of your Elvie
svc = p.getServiceByUUID(UUID("0a09fff0-dcac-7001-ed03-030502030401"))
ch = svc.getCharacteristics(UUID("0a09fff1-dcac-7001-ed03-030502030401"))[0]

while True:
    print(ch.read()[5])

Waking up the device to connect seems to require a few squeezes, I'm not sure. Needs a few retries to get it connected...