Closed koalazak closed 3 years ago
@akpotter @Thoro :)
Hey @koalazak!
I'd like to help. Can you provide some instructions?
How do I find the app id to run your snippet? I guess it's from the mobile app?
Cheers
I think you can use any string with that format. I get my app ID sniffing the trafic.
OK, it seems to do something. Which is the relevant output? :)
So i did run a start stop cycle through the cloud and got readable output from your script.
Is this what you're looking for?
the output is all the messages sent to the topic $aws/things/' + ROBOT_BLID + '/shadow
(and subtopics) by the robot or by the official mobile app.
When you say through the cloud and got readable output
you mean using the official mobile app? or using this script (publishing to a topic with this script)?
What im looking for is what message and what topic we suppose to use in mqttClient.publish()
method in this script to start/stop the robot via this script.
Running this script, then triggering the bot via the official mobile app.
When I start the script, the output ends with "undefined".
One sec, I'm sanitizing the output.
ok, you are looking the messages published by the mobile app or robot to that topics. that is what i get too. and using the mqttClient.publish()
method I can set new schedule for example. But What im looking for is what message and what topic we suppose to use in mqttClient.publish() method in this script to start/stop the robot via this script.
So do you have some instructions to obtain them?
I have a ton of JSON output. But only after triggering something via the official mobile app.
you can start making a MITM attack to sniff the data between the official mobile app and the cloud, getting the mqtt packets and decode them. Google about MITM
No TLS on that?
No chance to reconstruct the command from something like this?
message: topic: $aws/things/ROBOT_BLID_HERE/shadow/update/accepted {"state":{"reported":{"lastCommand":{"command":"start","time":1488399056,"initiator":"rmtApp"}}},"metadata":{"reported":{"lastCommand":{"command":{"timestamp":1488399056},"time":{"timestamp":1488399056},"initiator":{"timestamp":1488399056}}}},"version":1617,"timestamp":1488399057}
yes, TLS on that. bypassing with sslsplit
.
I try some variants of that message but no way.
Is there a way to trigger the cloud api when you're on wifi?
I have a proxy running to monitor the traffic.
Never mind, i isolated my networks, now it tries to go through the cloud.
I see a message with the app id, i also get the cloud icon in the app. But now my roomba doesn't react when i press start.
Reset everything, now the roomba reacts, but I don't see the commands in the proxy. Only the requests for mission history, login, etc. Will debug a bit more...
Its like the start/stop commands are in other format not json, like raw mqtt packets, a few bytes...
Make sure you are creating certs with a valid CommonName. The mobile app is validating the CN field in the roomba cert with the format 'Roomba-{number16}' if it is not valid, then the mobile app disconnect. (the validation is in the mobile app, so you need a selfisgned cert with this CN if you want to perform a sslsplit to sniff the trafic
but if you are seeing the mission commands and commands when you set preferences, there is no problem with the cert.
Hmm, I used mitmproxy instead of sslsplit. I'm a bit too tired to read through how to use sslsplit right now.
There should be a option to see raw tcp traffic in mitmproxy. I'm seeing the http traffic, but I'm guessing mqtt gets lost.
I think i have a working setup now redirecting to sslsplit. A test port 80 request got logged. I tried redirecting 8883 but get no traffic. Any tips to debug the problem?
OK, finally got a start message :)
Can I send it to you by email? It's quite long. Seems like it came over an upgraded ssl websocket carrying mqtt. Theres the upgrade, some garbage (probably mqtt), then start message, garbage, pause message.
yes sure. I got the message too. But I cant figure out how to reproduce it in my test snippet. Can you?
I got to a version mismatch. It seems to be a sequence number. The question is where from.
well, that is a step forward! There is not in state object?
version is in every message received:
{
"state":{"reported":{"svcEndpoints":{"svcDeplId":"v007"}}},
"metadata":{"reported":{"svcEndpoints":{"svcDeplId":{"timestamp":1488553359}}}},
"version":3345,
"timestamp":1488553359
}
you can parse all the messages and store the version to use in the next call.
can you share your code? zaktu.x@gmail.com
Will send it later
Sent the log.
Btw, sending the previous command without the version actually gets a valid reply. But the robot doesn't start.
The message I sent was:
{"state":{"reported":{"lastCommand":{"command":"start","time":1488399056,"initiator":"rmtApp"}}},"metadata":{"reported":{"lastCommand":{"command":{"timestamp":1488399056},"time":{"timestamp":1488399056},"initiator":{"timestamp":1488399056}}}},"timestamp":1488399057}
{ "state":{ "desired":{ "command":{ "command":"start","time":+new Date(),"initiator":"rmtApp" } } }, "timestamp":+new Date() }
Bam! Your working start command! :)
I think that string you see in logs are a post-execution
message sent by the robot after receibe the command. And the real command is all the ugly bytes before that string
nice!
I tried something like that before but nothing. Maybe I dont use the time
filed in my tests...
Testing now....
I actually got the robot to react with the last posted one. "start" for start and "stop" for stop.
There seems to be some kind of problems with the timestamps though, as it will start over and over again.
Yes, it seems to be important.
oh crap, that works but the robot now is receiving the start command every second :p. let me kwno if you can stop it :p
Send the stop message. Same format. x)
you promise that i can not get a loop of start AND stop commands now? :p
I can't, but my hope is that a hard reset will be able to fix it. :)
Let me try if the app is still able to start it.
Actually it is in a start stop loop. I'm resetting mine.
Yep, a reset fixed it. But that means we have to find out where to get the right timestamps.
Or maybe it's not about the timestamps but some of the other parts of the messages. The messages in the app seem to contain more information.
reset as 10 second the start button?
Didn't try that. I used the "reset roomba" option in the app. But you have to pair it again.
reset with 10 second start button doest work. but yes with the App.
New firmware is rolling out (again). Does anybody know what's changed? Hopefully nothing broke.
@iosdeveloper opened a new issue for that: #31
@letier do you have any progress in the cloud api reverse engeniering?
No luck. :(
It works with the iOS app at the moment, but doesn't do anything when I send the signals. The reset option in the app is greyed out, so I have no clue if I got it stuck in a strange state again.
Managed to reset and catch another conversation with the app. Saw the start message. But I'm suddenly not getting it to start anymore. And there seems to be all kind of state from my past trials saved. I'll need to find a way to clean it up. Posting via the snippet doesn't seem to work anymore.
So the situation seems to be that you somehow have to switch between certain states.
The following cycles work for me: { "state":{"desired":{"command":{"command":"start","time":Math.floor(new Date()/1000),"initiator":"rmtApp"}}}} { "state":{"desired":{"command":{"command":"clean","time":Math.floor(new Date()/1000),"initiator":"rmtApp"}}}} { "state":{"desired":{"command":null}}}
{ "state":{"desired":{"command":{"command":"stop","time":Math.floor(new Date()/1000),"initiator":"rmtApp"}}}} { "state":{"desired":{"command":null}}}
I'm not sure if clean is a real command. I just tried it and the robot started moving.
I dont like that aprouch :p may there is another fancy way haha. If i dont foudn the way y just implement that in next version.
Hi guys, I have almost everything ready to make the Cloud API possible:
But i dont found the correct
topic
andmessage
content to send basic commands likestart
orstop
. Anybody sniff that data? or has that data?My sniff data is weired and malformed, i dont know if my sslsplit is showingme the info in the correct encoding. When I send a command with my phone over the cloud I see some bytes in the comunication but no one string like topic o json message.
can anybody help?
here is the working snippet: