rytilahti / python-miio

Python library & console tool for controlling Xiaomi smart appliances
https://python-miio.readthedocs.io
GNU General Public License v3.0
3.73k stars 556 forks source link

rockrobo.vacuum.v1 No request was made #1826

Open PAKalucki opened 1 year ago

PAKalucki commented 1 year ago

Describe the bug mirobo update-firmware fails with "No request was made"

Version information (please complete the following information):

Device information:

To Reproduce

I'm trying to upload veletudo to device using mirobo. I'm in the same subnet as device, no VLANs, no VPNs.

Console output

miiocli cloud list
Username: xxx@gmail.com
Password: xxx
Locale (cn, de, i2, ru, sg, us, all): cn
== Robot odkurzający (Ready to go) ==
        Model: rockrobo.vacuum.v1
        Token: xxxx6e51754344697a735949594f6965
        IP: 192.168.1.28 (mac: 78:11:DC:EE:76:35)
        DID: 82946938
        Locale: cn

mirobo --ip 192.168.1.28 --token xxxx6e51754344697a735949594f6965 update-firmware --ip 192.168.1.102 ./xiaomi/v11_004028.pkg
INFO:miio.integrations.vacuum.roborock.vacuum_cli:Debug mode active
DEBUG:miio.integrations.vacuum.roborock.vacuum_cli:Using config: {'seq': 208, 'manual_seq': 0}
DEBUG:miio.integrations.vacuum.roborock.vacuum_cli:Connecting to 192.168.1.28 with token xxxx6e51754344697a735949594f6965
Going to update from ./xiaomi/v11_004028.pkg
INFO:miio.updater:Serving on 0.0.0.0:37795, timeout 10
INFO:miio.updater:Using local ./xiaomi/v11_004028.pkg (md5: 377ab605d2f0872fe5a6634763c959ed)
Hosting file at http://192.168.1.102:37795/v11_004028.pkg
DEBUG:miio.miioprotocol:Got a response: Container: 
    data = Container: 
        data = b'' (total 0)
        value = b'' (total 0)
        offset1 = 32
        offset2 = 32
        length = 0
    header = Container: 
        data = b'!1\x00 \x00\x00\x00\x00\x04\xf1\xabze\x070\x9b' (total 16)
        value = Container: 
            length = 32
            unknown = 0
            device_id = unhexlify('04f1ab7a')
            ts = 2023-09-17 17:00:11
        offset1 = 0
        offset2 = 16
        length = 16
    checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
DEBUG:miio.miioprotocol:Discovered 04f1ab7a with ts: 2023-09-17 17:00:11, token: b'ffffffffffffffffffffffffffffffff'
DEBUG:miio.miioprotocol:192.168.1.28:54321 >>: {'id': 209, 'method': 'miIO.ota', 'params': {'mode': 'normal', 'install': '1', 'app_url': 'http://192.168.1.102:37795/v11_004028.pkg', 'file_md5': '377ab605d2f0872fe5a6634763c959ed', 'proc': 'dnld install'}}
DEBUG:miio.miioprotocol:192.168.1.28:54321 (ts: 2023-09-17 17:00:11, id: 209) << {'result': ['ok'], 'id': 209}
Update started!

  0%|          | 0/100 [00:00<?, ?it/s]DEBUG:miio.miioprotocol:192.168.1.28:54321 >>: {'id': 210, 'method': 'miIO.get_ota_state', 'params': []}
DEBUG:miio.miioprotocol:Retrying with incremented id, retries left: 3
DEBUG:miio.miioprotocol:Got a response: Container: 
    data = Container: 
        data = b'' (total 0)
        value = b'' (total 0)
        offset1 = 32
        offset2 = 32
        length = 0
    header = Container: 
        data = b'!1\x00 \x00\x00\x00\x00\x04\xf1\xabze\x070\xa0' (total 16)
        value = Container: 
            length = 32
            unknown = 0
            device_id = unhexlify('04f1ab7a')
            ts = 2023-09-17 17:00:16
        offset1 = 0
        offset2 = 16
        length = 16
    checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
DEBUG:miio.miioprotocol:Discovered 04f1ab7a with ts: 2023-09-17 17:00:16, token: b'ffffffffffffffffffffffffffffffff'
DEBUG:miio.miioprotocol:192.168.1.28:54321 >>: {'id': 311, 'method': 'miIO.get_ota_state', 'params': []}
DEBUG:miio.miioprotocol:192.168.1.28:54321 (ts: 2023-09-17 17:00:16, id: 311) << {'result': ['failed'], 'id': 311}

  0%|          | 0/100 [00:05<?, ?it/s]
DEBUG:miio.integrations.vacuum.roborock.vacuum_cli:Writing {'seq': 311, 'manual_seq': 0} to /home/prka/.cache/python-miio/python-mirobo.seq
ERROR:miio.updater:No request was made..
rytilahti commented 1 year ago

That error happens when the device does not try to fetch the hosted firmware package. Is the IP address you give as a parameter the correct one for the device you run the command? You could use tcpdump to see if the device tries to create a TCP connection to that port at all.

Btw, I think valetudo ships (or instructs to use) nowadays a script to perform the update, so there is no need to use mirobo for that. Maybe you could give it a try?