miio icon indicating copy to clipboard operation
miio copied to clipboard

Could inspect device. Error was: Could not connect to device, token needs to be specified

Open mrdc opened this issue 5 years ago • 4 comments

Hello,

I receive "Could inspect device. Error was: Could not connect to device, token needs to be specified" when I try to inspect a device ( miio inspect 192.168.1.30). I have the token, but how should I use it in CLI for the "inspect"? miio inspect 192.168.1.30 xxxxxxxxxxxxxxxxx is not working, "xxxxxxxxxxxxxxxxx ", token: xxxxxxxxxxxxxxxxx also not working. Have found nothing about right arguments for inspect command.

mrdc avatar May 07 '19 23:05 mrdc

same here, I thinks some update might have broken things, I'm just triying to assimilate mi new Mi air2 today and so far i'm been unable.

After reset I can do inspect(though no capabilities reported):

~$ miio inspect xxxxxxxx Device ID: xxxxxxxx Model info: zhimi.airpurifier.mc1 Address: 192.168.13.1 Token: ffffffffffffffffffffffffffffff via auto-token Support: At least generic

Type info: miio Capabilities:

Firmware version: 1.4.3_21105 Hardware version: MW300

WiFi: . (FF:FF:FF:FF:FF) RSSI: -256 WiFi firmware version: SD878x-14.76.36.p84-702.1.0-WM

Remote access (Mi Home App): Maybe

then I'm unable to change token,

:~$ miio tokens update xxxx --token 12345678123456781234567812345678 INFO Updating token for xxxxx INFO Connected to miio:xxxxxxx - trying to change token ERROR Could not update token, double-check the given token

After configuring wifi, I cannot access anymore, becouse lack of knowling how to specify token

~$ miio inspect XXXXX token XXXXXXXXX INFO Attempting to inspect XXXXXXXX ERROR Could inspect device. Error was: Could not connect to device, token needs to be specified

Have tried: miio inspect XXXXX token TTTTTTTT miio inspect XXXXX --token TTTTTTTTTTT miio inspect XXXXX TTTTTTT

successbyfailure avatar May 13 '19 22:05 successbyfailure

To specify a token, please try the following command:

miio tokens update ip-of-device —token the-token

“—token” 2 dashes before token

mediter avatar Jul 12 '19 01:07 mediter

I have some problem

miio tokens update 192.168.1.1 --token 74271585b1ef517df210f62de4c717aa 
 ERROR  Could not update token, double-check the given token

alexpts avatar May 27 '20 18:05 alexpts

I believe that the token changes every second. I have fired this into my network, every second one command. The effect was that the code 'f37...' and 'f38....' and 'f39...' and so forth changed every second.

$ echo -ne '\x21\x31\x00\x20\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' | nc -W1 -u 192.168.x.x 54321|xxd -p|egrep -v "^ffff$"
12345670000000001234567800000f37ffffffffffffffffffffffffffff
$ echo -ne '\x21\x31\x00\x20\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' | nc -W1 -u 192.168.x.x 54321|xxd -p|egrep -v "^ffff$"
12345670000000001234567800000f38ffffffffffffffffffffffffffff
$ echo -ne '\x21\x31\x00\x20\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' | nc -W1 -u 192.168.x.x 54321|xxd -p|egrep -v "^ffff$"
12345670000000001234567800000f39ffffffffffffffffffffffffffff
$ echo -ne '\x21\x31\x00\x20\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' | nc -W1 -u 192.168.x.x 54321|xxd -p|egrep -v "^ffff$"
12345670000000001234567800000f3affffffffffffffffffffffffffff
$ echo -ne '\x21\x31\x00\x20\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' | nc -W1 -u 192.168.x.x 54321|xxd -p|egrep -v "^ffff$"
12345670000000001234567800000f3bffffffffffffffffffffffffffff

So my theory is that once we're synced with the other side, we know what we have to send as a token at that given second. The parts with 12345... are masked/greyed out by me.

Your thoughts? Could that be a route to get miio working again in those cases where obtaining a token wouldn't work?