pkoehlers / maploader

Map loader for Dreame robot vacuums running Valetudo
GNU General Public License v3.0
63 stars 7 forks source link

Supporting the Dreame F9 #8

Closed JamesBelchamber closed 2 years ago

JamesBelchamber commented 2 years ago

The current build cannot support the Dreame F9 since it is an ARM7 (32-bit) version, and the 64-bit binary fails with the following error:

/data/maploader-binary: line 1: syntax error: unterminated quoted string

I rebuilt maploader with GOARCH=arm which got it working, but now whenever I try to switch maps it fails with exit status 1. Here's the full log:

1970/01/01 00:45:23 Logging initialized
2022/06/20 21:22:49 Connected
2022/06/20 21:22:49 Subscribed to topic: valetudo/maploader/map/set
2022/06/20 21:22:49 Subscribed to topic: valetudo/maploader/map

(here I switch to the "office" map, which hasn't been created yet)

2022/06/20 21:23:49 Received message: office from topic: valetudo/maploader/map/set
2022/06/20 21:23:50 Changing map from main to office
2022/06/20 21:23:50 saving current map
2022/06/20 21:23:50 exit status 1
JamesBelchamber commented 2 years ago

The reason for this is likely because tar is failing - manually testing the tar attempt produces the following output:

[root@p2008_release:~]# tar zcvf test.tar.gz /data/ri /data/map /data/DivideMap /data/config/ava/mult_map.json 
tar: /data/ri: No such file or directory
tar: /data/map: No such file or directory
tar: removing leading '/' from member names
data/DivideMap/
data/config/ava/mult_map.json
tar: error exit delayed from previous errors

This gives an exit code of 1, matching the logs, and it's clear that some of the directory names are not the same on the Dreame F9.

(FWIW it's reasonable if you don't want to support this robot :) but if you do then I'm happy to hack on it a bit!)

pkoehlers commented 2 years ago

hi, I'm open to supporting your robot, if you provide the input/testing.

For the start, have you identified the map files/folders? If unsure attach the output of something like ls -lR /data. Also check for the existence of files /etc/rc.d/miio.sh and /etc/rc.d/ava.sh

JamesBelchamber commented 2 years ago

Okay, so I've done an ls -lR /data before and after running a Map Reset from Valetudo. I see the following changes:

In addition, the following files have been updated - but seem to just be log files (actual log files) under /data/log/ (these are likely irrelevant but provided for completeness):

It's weird to me that /data/DivideMap/ hasn't seen any updates - I'm running a clean and seeing if it gets updated at that point.

JamesBelchamber commented 2 years ago

After a clean the following changes can be seen:

Again, the following log files were updated under /data/log/ (probably irrelevant):

pkoehlers commented 2 years ago

I compared your results to my robot and created a draft PR based on this.

Please check out the new ARM binary from the CI job here: https://github.com/pkoehlers/maploader/actions/runs/2560460085

JamesBelchamber commented 2 years ago

It loads, it changes maps, it doesn't crash :sunglasses:

It's too late here now to test fully but tomorrow I'll run a full clean on two surfaces and then test switching between them. Looking good though :+1:

JamesBelchamber commented 2 years ago

This seems to be working fine - the only thing is that it's not saving the second room, but I suspect that's because I am not setting up the dock in that room (so it can't "finish" the job). It switches back to the first room just as expected.

I would say this is ready to be merged now - I'll raise any issues I find as I find them. Thanks!

pkoehlers commented 2 years ago

That's good to hear.

The saving of the second room actually works fine for me, even without placing the dock. Maybe you need to experiment a bit e.g. letting the robot search for the dock after cleaning vs stopping that process. But definitely not optimal without a dock....

JamesBelchamber commented 2 years ago

I actually just put the dock in the room this weekend and kept running it until it learned the room. Probably would've worked it out without the dock but now it knows the layout it seems happy :)

Thanks again - this is definitely now in use! Feel free to tag me if you ever need any testing on F9 hardware.

On Sun, 3 Jul 2022, 11:39 pkoehlers, @.***> wrote:

That's good to hear.

The saving of the second room actually works fine for me, even without placing the dock. Maybe you need to experiment a bit e.g. letting the robot search for the dock after cleaning vs stopping that process. But definitely not optimal without a dock....

— Reply to this email directly, view it on GitHub https://github.com/pkoehlers/maploader/issues/8#issuecomment-1173056453, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADBZL4UORDS4TTTYXQWFWLVSFUUZANCNFSM5ZKECU5A . You are receiving this because you authored the thread.Message ID: @.***>