rand256 / valetudo

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

Multiple zone cleaning - More than 5 zones #298

Closed mcteixeira closed 4 years ago

mcteixeira commented 4 years ago

Hi,

Vacuum: Xiaomi vacuum gen 1 Firmware version: Valetudo RE 0.9.8

I've set up multiple zone cleaning with 10 different zones. When the robot finishes the first 5 zones it returns to the dock with the message "finished zoned cleanup" and do not cleans the remaining 5 zones.

Is the feature of cleaning mote than 5 zones available only on the Gen2 or is this a bug on this Valetudo version?

Thanks in advance!

rand256 commented 4 years ago

That's interesting. I thought it should work on gen1 as well, but I have only gen2 device so there's no way I could check.

Probably there's something different in gen1 regarding this... Please try this build and see Settings -> Info -> System Log at the bottom right after the device begins returning to dock instead of continuing to enqueued zones (or those zones left if started with more than 5 zones). It should write state changes and "cleaning finished" events there.

Right now I guess the issue could be in gen1 simply not sending "zoned_clean_succ" event, so valetudo just doesn't know that cleaning has finished. Though I've double checked the AppProxy binary from gen1 4017 firmware definitely has "zoned_clean_succ" in its strings list.

mcteixeira commented 4 years ago

Hello,

Should I flash the attached file as I flash PKG with mirobo? I don't have much experience on this and I'm afraid I do something wrong

@pidator

Can you please give it a try? I think you may be more experient than me.

Thanks a lot!

pidator commented 4 years ago

Should I flash the attached file as I flash PKG with mirobo?

Definitely NO! On robot, first stop valetudo with #service valetudo stop then you can replace the current valetudo bin in /usr/local/bin with the (extracted) test one provided by rand256. (E.g. with scp from your linux machine #scp valetudo root@rockrobo:/usr/local/bin). Then you could start valetudo on robot again with #service valetudo start.

Can you please give it a try?

Installed today, will first have to create more than 5 zones ;-)

Edit: the update steps are basically nearly the same like described here.

pidator commented 4 years ago

see Settings -> Info -> System Log at the bottom right after the device begins returning to dock instead of continuing to enqueued zones (or those zones left if started with more than 5 zones). It should write state changes and "cleaning finished" events there.

I've just created 6 zones on map tap and started the cleaning. On map tab, the sixth zone "disappeared" (that was to be expected, because the firmware just can clean 5 zones in one step) and the robot started the cleaning. After finishing the fifth zone the robot returned to dock.

Here's the log output

2020-09-21T12:20:36.359Z status_changed 8 17
2020-09-21T12:29:28.803Z received cleaning_finished: [object Object] (undefined,null,1)
2020-09-21T12:29:29.085Z status_changed 17 6
2020-09-21T12:30:49.015Z status_changed 6 8

If I start the cleaning with only 5 zones, these are the log messages:

2020-09-20T13:54:42.068Z status_changed 8 17
2020-09-20T14:46:51.915Z received cleaning_finished: [object Object] (undefined,null,0)
2020-09-20T14:46:52.207Z status_changed 17 6
2020-09-20T14:48:34.446Z status_changed 6 8

@rand256 are these logs helpfull?

rand256 commented 4 years ago

Oh, well. Please try this build now. I hope this should make 5+ zones cleanup work properly on gen1 devices too. For easier testing you can just enqueue a new zone cleanup on an already started cleaning, since it uses the same technique as initially starting a single cleanup with more than 5 zones selected.

pidator commented 4 years ago

For easier testing you can just enqueue a new zone cleanup on an already started cleaning

yes, while in cleaning a zone I send an additional zone-to-clean-command and after finishing the first one, the robot told me for a short time "zoned cleaning finished" but directly started the additional zoned cleaning!

btw: what is the time source or the timezone setting for the log entries in /var/log/upstart/valetudo.log?

rand256 commented 4 years ago

the robot told me for a short time "zoned cleaning finished" but directly started the additional zoned cleaning!

There's no way to disable those phrases in such circumstances unfortunately, but I'm glad it finally works as intended. I'll make a new release with these fixes soon then.

btw: what is the time source or the timezone setting for the log entries in /var/log/upstart/valetudo.log?

AFAIK it always uses GMT+0, but it is for auxiliary usage anyway.

pidator commented 4 years ago

There's no way to disable those phrases in such circumstances unfortunately

that's fine for me too, just want to describe what happened exactly ;)

but I'm glad it finally works as intended. I'll make a new release with these fixes soon then.

thanks for your efforts!

AFAIK it always uses GMT+0, but it is for auxiliary usage anyway.

thank you for clarifying this - GMT+0 makes sense. I was just wondering because all other time settings of my robot have the right timezone.