I’m currently trying to include the incline angle over BLE with the Fitness Machine Control Point characteristic with Python Bleak. I’m pretty sure that the correct characteristic is “00002ad9-0000-1000-8000-00805f9b34fb”.
But I dont know how to give the command to the hometrainer to accept the inclination. Only found a document about Fitness Machine Services that includes the characteristic I’m using. Here is the whole pdf (“Fitness Machine Service 1.0”).
And the part with inclination.
Here is my code, I tried to implement it with a byte built with the op code and the desired inclination.
import asyncio
from bleak import BleakClient
async def set_fitness_machine_values(uuid):
address = "C5:B3:F0:FB:9A:1E"
target_inclination = int(target_inclination_percent * 10)
inclination_bytes = target_inclination.to_bytes(2, byteorder='little', signed=True)
op_code = 0x03
payload = bytes([op_code]) + inclination_bytes
async with BleakClient(address) as client:
await client.write_gatt_char(uuid, payload)
target_inclination_percent = 5.0
asyncio.run(set_fitness_machine_values("00002ad9-0000-1000-8000-00805f9b34fb"))
Here is the error:
bleak.exc.BleakError: Could not write value b'x032x00' to characteristic 0031: Protocol Error 0x81: Unknown
Eko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.