pypavlok
pypavlok copied to clipboard
The pavlok doesn't perform an 'action' (beep, vibrate, shock)
I am not able to let the pavlok perform an action, but it seems to be able to read certain values from it.
I have used the example code, but no response unfortunately.
DEBUG:pypavlok:GATT characteristics: [{'value_handle': 3, 'handle': 2, 'uuid': '00002a00-0000-1000-8000-00805f9b34fb', 'properties': 2}, {'value_handle': 6, 'handle': 5, 'uuid': '00002a01-0000-1000-8000-00805f9b34fb', 'properties': 2}, {'value_handle': 10, 'handle': 9, 'uuid': '00002a29-0000-1000-8000-00805f9b34fb', 'properties': 2}, {'value_handle': 13, 'handle': 12, 'uuid': '00002a24-0000-1000-8000-00805f9b34fb', 'properties': 2}, {'value_handle': 16, 'handle': 15, 'uuid': '00002a25-0000-1000-8000-00805f9b34fb', 'properties': 2}, {'value_handle': 19, 'handle': 18, 'uuid': '00002a27-0000-1000-8000-00805f9b34fb', 'properties': 2}, {'value_handle': 22, 'handle': 21, 'uuid': '00002a26-0000-1000-8000-00805f9b34fb', 'properties': 2}, {'value_handle': 25, 'handle': 24, 'uuid': '00002a28-0000-1000-8000-00805f9b34fb', 'properties': 2}, {'value_handle': 29, 'handle': 28, 'uuid': '00002a19-0000-1000-8000-00805f9b34fb', 'properties': 18}, {'value_handle': 34, 'handle': 33, 'uuid': 'bcf9db43-b768-4382-b4a4-dceddb0da82d', 'properties': 18}, {'value_handle': 38, 'handle': 37, 'uuid': 'b641cb90-62e0-4cea-983e-498550c27305', 'properties': 26}, {'value_handle': 42, 'handle': 41, 'uuid': 'b641c9b0-62e0-4cea-983e-498550c27305', 'properties': 10}, {'value_handle': 46, 'handle': 45, 'uuid': '7eca7033-fc71-4a58-8775-225e813a03fb', 'properties': 10}, {'value_handle': 49, 'handle': 48, 'uuid': 'efd6fd9d-681b-4f19-9121-59900f57a401', 'properties': 10}, {'value_handle': 52, 'handle': 51, 'uuid': '6e9d7a34-ddc0-4b47-9df4-fc45d2891827', 'properties': 26}, {'value_handle': 56, 'handle': 55, 'uuid': '0102a282-7f71-4d53-85d4-c5f039491de5', 'properties': 10}, {'value_handle': 59, 'handle': 58, 'uuid': 'fe6c2113-51c8-4696-839b-8dcf18319198', 'properties': 10}, {'value_handle': 62, 'handle': 61, 'uuid': 'c2e1d352-55a0-4316-b61c-0ebd1e8d419f', 'properties': 18}, {'value_handle': 66, 'handle': 65, 'uuid': '6647679b-2bf8-4baf-bdd2-969f51aeb90e', 'properties': 10}, {'value_handle': 70, 'handle': 69, 'uuid': '04402e31-73af-49b6-a009-a51856c11711', 'properties': 18}, {'value_handle': 74, 'handle': 73, 'uuid': '26cb603d-0f79-4e5e-bb9c-b56c84761537', 'properties': 10}, {'value_handle': 78, 'handle': 77, 'uuid': 'e6b17021-195d-4e84-b216-034caeb05498', 'properties': 26}, {'value_handle': 83, 'handle': 82, 'uuid': 'fbdd1135-9121-49de-bc0d-fc7432486afb', 'properties': 26}, {'value_handle': 87, 'handle': 86, 'uuid': '4149908d-0d64-409c-bdef-8a3e105e89c8', 'properties': 18}, {'value_handle': 92, 'handle': 91, 'uuid': 'f7bf3564-fb6d-4e53-88a4-5e37e0326063', 'properties': 8}, {'value_handle': 94, 'handle': 93, 'uuid': '984227f3-34fc-4045-a5d0-2c581f81a153', 'properties': 4}, {'value_handle': 96, 'handle': 95, 'uuid': '9673d35f-773e-4b84-b9e1-108f88533d72', 'properties': 18}, {'value_handle': 100, 'handle': 99, 'uuid': '57a6e8cb-2971-4950-8883-e345290711aa', 'properties': 4}] DEBUG:pypavlok:GATT value handles: {'battery_level': 29, 'led': 56, 'vibration': 46, 'firmware_revision': 22, 'hardware_revision': 19, 'shock': 52, 'beep': 49} DEBUG:pypavlok:Hardware revision: v2.0.0, firmware revision: 2.4.82 100 beep DEBUG:pypavlok:write array: handle: 49, args: ([3, 127, 10, 5],), encoded data: 037f0a05 vib DEBUG:pypavlok:write array: handle: 46, args: ([1, 127, 50, 50],), encoded data: 017f3232 2.4.82
They have changed the gatt characteristics in (2.4.99, possibly earlier) like:
- The first byte encodes the write mode and the count:
- 0x40+count to save
- 0x80+count to execute
- 0xc0+count to save+execute
Example: 0x41FF2020 - reads: Save 1 times at level 0xFF with pattern on 0x20ms and off 0x20ms 0x81FF2020 - reads: Execute 1 times at level 0xFF with pattern on 0x20ms and off 0x20ms 0xc1FF2020 - reads: Save+execute 1 times at level 0xFF with pattern on 0x20ms and off 0x20ms
you can try all this easily with the nrf connect app (from nordic semi)