m8schmit / ecovacs-stack

A complete stack including backend server and frontend interface, to manage a Deebot T9.
GNU General Public License v3.0
24 stars 6 forks source link

Map not completely loading on Ozmo T8+ [LZMA_FORMAT_ERROR: File format not recognized] #8

Closed shanks3042 closed 2 months ago

shanks3042 commented 5 months ago

The error results in the LZMA_FORMAT_ERROR. Because there is no catch in that code block this leads to Child got SIGTERM, exiting and thus the webinterface is not loaded (at least not the map).

A small workaround to at least get the map to load was adding the catch statement in the mqttClient.ts file . But this leads to the problem that only the map loads but no map features are available.

    if (isTopic('getMapSubSet', topic)) {
      const res = getDatafromMessage(message);
      const type = res?.type;
      //console.log("Response value of vacuum robot: ", res.value);
      type === 'ar' &&
        decompressLZMA(res.value).then((value) =>
          WSsocket?.emit(`mapSubSet`, {
            ...res,
            value: value
              .toString()
              .split(';')
              .map((current) => current.split(',')),
          }),
        )
        .catch((error) => {
          // Handle the error here
          console.error("Error during LZMA decompression:", error);
          //console.error("Error response value of the vacuum robot is: ", res.value);
       });

What's not working:

Here is one example of a response that leads to the issue.

backend_1   | 4/3/2024, 6:41:09 PM [iot/p2p/getMapSubSet/85614e51-cddb-4fc7-8f87-2a11d9517cfc/fqxoiu/4fe8/HelperBot/x/qSug/p/x/j] {
backend_1   |   header: {
backend_1   |     pri: 1,
backend_1   |     tzm: 480,
backend_1   |     ts: '1712162468038',
backend_1   |     ver: '0.0.1',
backend_1   |     fwVer: '1.7.1',
backend_1   |     hwVer: '0.1.1'
backend_1   |   },
backend_1   |   body: {
backend_1   |     code: 0,
backend_1   |     msg: 'ok',
backend_1   |     data: {
backend_1   |       type: 'ar',
backend_1   |       subtype: '0',
backend_1   |       connections: '1,',
backend_1   |       name: '',
backend_1   |       seqIndex: 0,
backend_1   |       seq: 0,
backend_1   |       count: 0,
backend_1   |       totalCount: 73,
backend_1   |       index: 0,
backend_1   |       cleanset: '1,0,2',
backend_1   |       mssid: '0',
backend_1   |       value: '-3150,-2400;-3150,-1700;-2950,-1700;-2800,-1550;-2650,-1650;-1800,-1650;-1700,-1400;-1500,-1500;-1300,-1500;-1050,-1850;-850,-1850;-650,-1600;-300,-1550;-400,-1400;-400,-650;-150,-400;-400,-150;-700,-200;-500,300;0,300;150,100;1200,100;1300,300;1700,300;1850,100;2300,100;2450,-50;2600,-50;2600,-600;2400,-600;2250,-750;1950,-700;1800,-850;1900,-1000;1900,-1500;1800,-1600;1850,-2050;1950,-2150;2300,-2150;2450,-2000;2600,-2050;2550,-2600;2400,-2550;2300,-2650;900,-2650;750,-2800;150,-2800;50,-2600;-200,-2650;-300,-2550;-400,-2650;-700,-2650;-450,-2500;-50,-2450;50,-2350;-50,-2150;-500,-2350;-850,-2400;-1000,-2150;-1800,-2150;-1900,-1800;-2050,-1800;-2150,-1900;-2100,-2000;-2150,-2050;-2250,-1950;-2350,-2000;-2800,-2400;-2750,-2500;-2850,-2500;-2950,-2350;-3100,-2450;-3150,-2400',
backend_1   |       mid: '1091475701'
backend_1   |     }
backend_1   |   }
backend_1   | }
backend_1   | Error during LZMA decompression: [LZMA_FORMAT_ERROR: File format not recognized] {
backend_1   |   code: 7,
backend_1   |   desc: 'File format not recognized'
backend_1   | }

Do you have any tips how I can fix this? I would gladly fix this but I don't really know where to start so any help is appreciated.

rmelotte commented 4 months ago

I also had a similar issue at some point where all of a sudden, the map was broken and would not show anymore.

I suspect it is related to the fact that the map 'values' are supposed to be compressed. At some point my robot stopped sending compressed values (or it never did - I played with it so much that I cannot be sure anymore and I didn't save logs) even though I never upgraded its firmware.

Additionally, the 'center' value is missing in our case, so I think we would have to compute it from the existing values.

I did a very dirty adaptation to the code to get it to at least show the map and be able to use rooms in my case (basically skip decompressing and compute the center). I haven't tested nogo zones or editing the map though. I'm not currently in front of my PC, I will try to find the time to post a draft in the next couple of days.

shanks3042 commented 2 months ago

That would be very helpful

rmelotte commented 2 months ago

It's a dirty hack that still has debugging lines, but this is what I did to get the rooms to show up: https://github.com/m8schmit/ecovacs-stack/commit/793256298fd846be312a968b129215185aaf3e08

I believe no-go zones work, although I'm not entirely sure (let me know if you test it).

Editing the map still doesn't work for me though.

I can also see some lines pointing to each room that all converge to a point outside of the screen, so something else must still be wrong.

shanks3042 commented 2 months ago

Thanks, seems to be working so far :)