Trying to hack Thermopro TP25
So I've been working on some way to receive the temperature from this ThermoPro TP25 therm 2024-12-3 09:29:42 Author: www.reddit.com(查看原文) 阅读量:8 收藏

So I've been working on some way to receive the temperature from this ThermoPro TP25 thermometer to integrate it to homeassistant (I like my steaks on point but I forget about them), I don't really understand BLE concepts but I'm trying.

So using my phone I was able to get the packages that the official app works with and together with wireshark filtering a bit I got this:

https://pastebin.com/mpwVJ7QA

the last part is the temperature data (I was able to partially decode it by moving the probes to the different channels) so I set out with python and bleak to try to get the data on my own but this is where I have not been able to go any further.

using this script I was able to get the features and services (I remind you that I have no idea what it means but it seems important)

async def get_services(address : str):
    async with BleakClient(address) as client: 
        return 

loop = asyncio.get_event_loop()
get_services_task = loop.create_task(get_services(thermopro.address))

while not get_services_task.done():
    await asyncio.sleep(0.1) 

services = get_services_task.result()
print_services(services)client.services

https://pastebin.com/gZ2ALQEM

I tried to read 1086fff1-3343-4817-8bb2-b32206336ce8 however what I get back does not look like the log in wireshark.

async def gatt_read(address, uuid):
    async with BleakClient(address) as client:
        res = await client.read_gatt_char(uuid) 
        return res

t = asyncio.run(gatt_read(DEVICE_ADDRESS, "1086fff1-3343-4817-8bb2-b32206336ce8"))

print(bytearray.hex(t))


>> 23060400ffffffff2967c2a0f69c3753e36c0c0a

I also tried to create a notification but I do not receive anything.

DEVICE_ADDRESS = "XX:XX:XX:XX:XX"  
NOTIFY_CHARACTERISTIC_UUID = "1086fff2-3343-4817-8bb2-b32206336ce8"  


async def notification_handler(sender, data):
    print(bytearray.hex(data))

async def subscribe_to_notifications():
    async with BleakClient(DEVICE_ADDRESS) as client:
        if client.is_connected:
            print("Connected to ThermoPro")
            await client.start_notify(NOTIFY_CHARACTERISTIC_UUID, notification_handler)
            await asyncio.sleep(10)  
            await client.stop_notify(NOTIFY_CHARACTERISTIC_UUID)

asyncio.run(subscribe_to_notifications())

my hypothesis is that somehow I have to tell the device to activate the notifications, but I'm not sure how to do it.

any ideas?


文章来源: https://www.reddit.com/r/HowToHack/comments/1h5brxb/trying_to_hack_thermopro_tp25/
如有侵权请联系:admin#unsafe.sh