ecovacs-stack icon indicating copy to clipboard operation
ecovacs-stack copied to clipboard

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

Open shanks3042 opened this issue 1 year ago • 1 comments

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:

  • Rooms
  • Nogo zones
  • Probably everything related to Edit the map in the frontend

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.

shanks3042 avatar Apr 03 '24 16:04 shanks3042

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.

rmelotte avatar Apr 16 '24 19:04 rmelotte

That would be very helpful

shanks3042 avatar Jun 09 '24 15:06 shanks3042

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.

rmelotte avatar Jun 12 '24 13:06 rmelotte

Thanks, seems to be working so far :)

shanks3042 avatar Jun 21 '24 20:06 shanks3042