rand256 / valetudo

Valetudo RE - experimental vacuum software, cloud free
Apache License 2.0
667 stars 73 forks source link

No Map Data in Access Point Mode #201

Closed noscript closed 4 years ago

noscript commented 4 years ago

This fork claims to work cloud free, yet I cannot get the maps working without connecting to Internet.

How to Reproduce

  1. Flash vacuum_valetudo_re_2008.pkg on a Gen2/S5 cleaner.
  2. Connect to the cleaner's AP roborock-vacuum-s5_miapXXXX
  3. Open http://192.168.8.1/ in browser
  4. Start the cleaning
  5. Go to Map view

Expected behavior Map being updated in real time.

Actual behavior Seeing "NO_MAP_DATA".

Vacuum Model: Gen2/S5

Valetudo Version: 0.9.2

pidator commented 4 years ago

You'll have to differentiate between "cloud free" and "unprovisioned mode". If you do not connect the robot after flashing the firmware to a Wifi, it will stay in "unprovisioned mode". I've never tested the behaviour of the robot in this state yet, because everyone in reach of the signal could so easily connect to the robot, but it could be possible, that there are no map updates in this state. If you've connected it successfully to a Wifi (even a Wifi without internet connectivity) everything will work like expected! All connections to xiaomi cloud are blocked and the robot will run "cloud free".

rand256 commented 4 years ago

Actually, device's firmware just doesn't send any map data when the robot is in AP mode, since it thinks there's no reason to try doing that when it's not connected to the internet, as obviously it doesn't know that with valetudo we're working locally.

Probably this can be changed with binary patching some manufacturer's services running on the robot, but generally trying using the device in AP mode is a bad idea from the security point of view, and also the device would shut down the AP after a while anyway, it won't be up forever.

noscript commented 4 years ago

My bad. Connecting to a WiFi without internet connectivity actually makes the maps working.

Is there a workaround to use maps in AP mode?

noscript commented 4 years ago

trying using the device in AP mode is a bad idea from the security point of view

Why would it be the case if I set a password to for AP?

the device would shut down the AP after a while anyway

I think that could be changed to keep it permanently on.

rand256 commented 4 years ago

Then the only thing you need is to learn how to patch ARM executables, find the condition where it checks whether it's in AP mode, and disable it to make the maps uploaded regardless of Wifi mode. Unfortunately I have literally zero experience in this.

Btw it will require no changes from valetudo - only a patch of, most likely, /opt/rockrobo/cleaner/bin/AppProxy.