Git Product home page Git Product logo

Comments (27)

mrbungle64 avatar mrbungle64 commented on July 25, 2024

@cactusss

You're right. The client is only disconnected, but not unsubscribed.
I'll try to fix it today.

from ecovacs-deebot.js.

cactusss avatar cactusss commented on July 25, 2024

πŸ™πŸ»Thanks, It would help me a lot

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on July 25, 2024

@cactusss

Please try 0.9.2-alpha.3

If it's still not working properly you can try await vacbot.disconnectAsync() instead of vacbot.disconnect()

from ecovacs-deebot.js.

cactusss avatar cactusss commented on July 25, 2024

``Spoke too soon... @mrbungle64

With both command the MQTT messages still come in, resulting in the (Homey) error device_not_found

[err] 2023-01-08 17:53:55 Unhandled Rejection at: Promise { <rejected> Error: device_not_found at Remote Process at HomeyClient.emit (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/homey-apps-sdk-v3/lib/HomeyClient.js:1:312) at ManagerFlow._onCardTriggerDevice (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/homey-apps-sdk-v3/manager/flow.js:219:26) at FlowCardTriggerDevice.trigger (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/homey-apps-sdk-v3/lib/FlowCardTriggerDevice.js:1:1180) at EcovacsMQTT_JSON.<anonymous> (/drivers/Deebot/device.js:173:29) at EcovacsMQTT_JSON.emit (node:events:526:28) at EcovacsMQTT_JSON.handleMessagePayload (/node_modules/ecovacs-deebot/library/950type/ecovacsMQTT_JSON.js:196:22) at /node_modules/ecovacs-deebot/library/950type/ecovacsMQTT_JSON.js:122:32 at EcovacsMQTT_JSON.handleMessage (/node_modules/ecovacs-deebot/library/950type/ecovacsMQTT_JSON.js:126:15) at EcovacsMQTT_JSON.handleCommandResponse (/node_modules/ecovacs-deebot/library/950type/ecovacsMQTT_JSON.js:69:22) at EcovacsMQTT_JSON.sendCommand (/node_modules/ecovacs-deebot/library/ecovacsMQTT.js:212:22) { code: 404 } } reason: Error: device_not_found at Remote Process at HomeyClient.emit (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/homey-apps-sdk-v3/lib/HomeyClient.js:1:312) at ManagerFlow._onCardTriggerDevice (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/homey-apps-sdk-v3/manager/flow.js:219:26) at FlowCardTriggerDevice.trigger (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/homey-apps-sdk-v3/lib/FlowCardTriggerDevice.js:1:1180) at EcovacsMQTT_JSON.<anonymous> (/drivers/Deebot/device.js:173:29) at EcovacsMQTT_JSON.emit (node:events:526:28) at EcovacsMQTT_JSON.handleMessagePayload (/node_modules/ecovacs-deebot/library/950type/ecovacsMQTT_JSON.js:196:22) at /node_modules/ecovacs-deebot/library/950type/ecovacsMQTT_JSON.js:122:32 at EcovacsMQTT_JSON.handleMessage (/node_modules/ecovacs-deebot/library/950type/ecovacsMQTT_JSON.js:126:15) at EcovacsMQTT_JSON.handleCommandResponse (/node_modules/ecovacs-deebot/library/950type/ecovacsMQTT_JSON.js:69:22) at EcovacsMQTT_JSON.sendCommand (/node_modules/ecovacs-deebot/library/ecovacsMQTT.js:212:22) { code: 404 }

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on July 25, 2024

@cactusss

There are 4 places in your code where you connect to the API (EcoVacsAPI.connect()) and 2 places where you execute vacbot.connect()... Are you sure that this is necessary and correct in all cases?

In my tests I didn't receive any more messages after executing vacbot.disconnectAsync()

from ecovacs-deebot.js.

cactusss avatar cactusss commented on July 25, 2024

I didn't look at (it's inherited code) yet.

After looking I can find two (session handlers for login and devices) to the EcoVacsAPI in driver.js, but only one vacbot.connect in the device.js....

Please ignore the .homeybuild folder, I'v put it in the .gitignore file.

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on July 25, 2024

@cactusss

Why are you doing this?

this.vacbot.disconnect();
await this.vacbot.disconnectAsync();

from ecovacs-deebot.js.

cactusss avatar cactusss commented on July 25, 2024

It was a test :)

But I think I found the cause of the problem.

There was a loop that ran a robot.run('GetBatteryState') and a robot.run('GetCleanState') command (not sure why it was implemented that way) in the device.js. I guess that re-connected the vacbot. After removing those commands the vacbot.disconnect() seems to work properly.

I'm going to test ti see if without the loop everythings keep working, not sure if it was there as a keep alive, although I can't imagine that is needed.

I'll of course let you know the outcome. Thanks for the hints.

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on July 25, 2024

@cactusss

Please make sure that there are no loops running Get (or even worse Set) commands.
There are some reports that Ecovacs temporary locks out users when causing too many API calls.

from ecovacs-deebot.js.

cactusss avatar cactusss commented on July 25, 2024

Thanks. Glad i caught it then!

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on July 25, 2024

After removing those commands the vacbot.disconnect() seems to work properly.

I think we can close this issue. If you still receive messages after disconnecting you can open the issue again.

from ecovacs-deebot.js.

Aybert59 avatar Aybert59 commented on July 25, 2024

It was a test :)

But I think I found the cause of the problem.

There was a loop that ran a robot.run('GetBatteryState') and a robot.run('GetCleanState') command (not sure why it was implemented that way) in the device.js. I guess that re-connected the vacbot. After removing those commands the vacbot.disconnect() seems to work properly.

I'm going to test ti see if without the loop everythings keep working, not sure if it was there as a keep alive, although I can't imagine that is needed.

I'll of course let you know the outcome. Thanks for the hints.

Hello there
First thank you for all your great work
These loops were just there in order to keep in sync some status indicators. Of course managing this through the appropriate events is more convenient.
Any time you have a question on my code do not search for some hidden good reason, but rather start from the statement that i'm not an expert developer ;-)
Olivier

from ecovacs-deebot.js.

cactusss avatar cactusss commented on July 25, 2024

Hello there First thank you for all your great work These loops were just there in order to keep in sync some status indicators. Of course managing this through the appropriate events is more convenient. Any time you have a question on my code do not search for some hidden good reason, but rather start from the statement that i'm not an expert developer ;-) Olivier

Hey, don't downtalk yourself :) You did the hard part, I just added some features. I'm a hobbyist myself, copy/past is one of my best skills πŸ˜‚

from ecovacs-deebot.js.

cactusss avatar cactusss commented on July 25, 2024

@mrbungle64

Just found there is a problem with 0.9.2-alpha.3; there is something wrong with the either MapSpotArea or the MapSpotAreaInfo module. I'm not getting the right information.

I need to test further (hope to find the time this week) to see what goes wrong exactly.

Don't release it πŸ˜‰

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on July 25, 2024

@cactusss

Just found there is a problem with 0.9.2-alpha.3; there is something wrong with the either MapSpotArea or the MapSpotAreaInfo module. I'm not getting the right information.

Are you sure? I haven't changed anything in the MapSpotArea or MapSpotAreaInfo module ...

I'm using the 0.9.2-alpha.3 in my productive environment (ioBroker) and I haven't recognized any problems yet.

I need to test further (hope to find the time this week) to see what goes wrong exactly.

Have you made any changes to your code that may be causing this?
Have you already pushed all your recent changes to your GitHub repo?

from ecovacs-deebot.js.

cactusss avatar cactusss commented on July 25, 2024

No, I wasn't sure. But I couldn't figure out what was going wrong. So I reverted to Oliviers version on Github, to rule out any errors on my part. I tried to back-track what I did with this project, but without the changes of my own.

Olieviers github version is using ApiVersion 0.7.2 and runs fine.
I ran "npm install [email protected]", so now it's running ApiVersion 0.8.1 and it still runs fine.
I ran "npm install [email protected]", so now it's running ApiVersion 0.9.1 and it's broken.
I ran "npm install [email protected]" again, so now it's running ApiVersion 0.8.1 and it still runs fine again.
I ran "npm install [email protected]", so now it's running ApiVersion 0.9.0, and it's broken again
I ran "npm install [email protected]", so now it's running ApiVersion 0.8.3 and it still runs fine again.

Something in the 0.9.0 build must have been changed imho, specificaly in the GetSpotAreaInfo function. I think the problem lies there but I'm not 100% sure.

I need more time to debug this further, this is all I can offer right now.

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on July 25, 2024

@cactusss

Olieviers github version is using ApiVersion 0.7.2 and runs fine.
I ran "npm install [email protected]", so now it's running ApiVersion 0.8.1 and it still runs fine.
I ran "npm install [email protected]", so now it's running ApiVersion 0.9.1 and it's broken.
I ran "npm install [email protected]" again, so now it's running ApiVersion 0.8.1 and it still runs fine again.
I ran "npm install [email protected]", so now it's running ApiVersion 0.9.0, and it's broken again
I ran "npm install [email protected]", so now it's running ApiVersion 0.8.3 and it still runs fine again.

What exactly is broken?

Btw.: I'm using version 0.9.1-alpha.x in production since beginning of December and my ioBroker adapter uses since version 1.4.9 (current version is 1.4.10) version 0.9.1-x in beta with no reported issues so far ...
Version 0.9.0 is already in use even longer with no reported issues

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on July 25, 2024

@cactusss

Version 0.9.0 had a breaking change:
"Breaking change: Bump minimum required version of Node.js to 14.x"
What version of Node.js are you using?

Edit: I checked some issues created from you. It seems that you're using version 16.x

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on July 25, 2024

@cactusss

If your app also not working with version 0.9.0 the issue seem to be in your app or your environment.
Version 0.9.0 was already released Nov 24, 2022
Stable version 1.4.8 of my ioBroker adapter (released Nov 12, 2022) runs with version 0.9.0-beta.2 with no reported issues.

from ecovacs-deebot.js.

cactusss avatar cactusss commented on July 25, 2024

@cactusss

Version 0.9.0 had a breaking change: "Breaking change: Bump minimum required version of Node.js to 14.x" What version of Node.js are you using?

Edit: I checked some issues created from you. It seems that you're using version 16.x

According to the release nodes of an earlier firmware version Homey is running node v16:
Homey v7.4.1 [Core] Update Homey Apps to run in Node.js v16 environment

When I look at the app process I get these versions:
versions: { node: '16.14.2', v8: '9.4.146.24-node.20', uv: '1.43.0', zlib: '1.2.11', brotli: '1.0.9', ares: '1.18.1', modules: '93', nghttp2: '1.45.1', napi: '8', llhttp: '6.0.4', openssl: '1.1.1n+quic', cldr: '40.0', icu: '70.1', tz: '2021a3', unicode: '14.0', ngtcp2: '0.1.0-DEV', nghttp3: '0.1
So I guess the node.js version shouldn't be a problem

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on July 25, 2024

@cactusss
Version 0.9.0 had a breaking change: "Breaking change: Bump minimum required version of Node.js to 14.x" What version of Node.js are you using?
Edit: I checked some issues created from you. It seems that you're using version 16.x

According to the release nodes of an earlier firmware version Homey is running node v16: Homey v7.4.1 [Core] Update Homey Apps to run in Node.js v16 environment

When I look at the app process I get these versions: versions: { node: '16.14.2', v8: '9.4.146.24-node.20', uv: '1.43.0', zlib: '1.2.11', brotli: '1.0.9', ares: '1.18.1', modules: '93', nghttp2: '1.45.1', napi: '8', llhttp: '6.0.4', openssl: '1.1.1n+quic', cldr: '40.0', icu: '70.1', tz: '2021a3', unicode: '14.0', ngtcp2: '0.1.0-DEV', nghttp3: '0.1 So I guess the node.js version shouldn't be a problem

Yes, I already mentioned that some hours ago:

"Edit: I checked some issues created from you. It seems that you're using version 16.x"

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on July 25, 2024

@cactusss

You haven't told me what exactly is broken ...

I mean: Is your app throwing an error or is your app not working correctly?

from ecovacs-deebot.js.

cactusss avatar cactusss commented on July 25, 2024

@cactusss

You haven't told me what exactly is broken ...

I was still investigating πŸ˜‰

On 0.8.3 the command this.vacbot.run('GetSpotAreaInfo', 1110814285,2); triggers the vacbot.on('MapSpotAreaInfo', (area).... <cut off> command which serves me a JSON with the spotinfo.
On 0.9.0 the same command doesn't trigger the on MapSpotAreaInfo event. Even when I use this

this.vacbot.on('MapSpotAreaInfo', (area) => { console.log('Wazzup?') });

Nothing happens, it just doesn't gets fired. No error, nothing

That's what I have now. Only difference in the code is Api v0.8.3 vs Api v0.9.0

Thanks for you time btw, I understand this is hard for you to try and solve, but I don't have a clue on how to handle this myself.

from ecovacs-deebot.js.

cactusss avatar cactusss commented on July 25, 2024

(deleted by maintainer)
(deleted by maintainer)
device.js.txt

The output from the two Api versions, and the js file being used

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on July 25, 2024

@cactusss

Thanks for the information.
I can see the difference from the output, but this is a very odd behavior I think.
I haven't change anything between 0.8.3 and 0.9.0 that should cause this.
In my projects I don't have this issue and I haven't heard of any such issues with other projects either...

I guess we'll have to take a closer look at your code...

Btw.: It would be helpful if you push changes to your code directly to GitHub...

from ecovacs-deebot.js.

cactusss avatar cactusss commented on July 25, 2024

@mrbungle64

It's working again. @Aybert59 hinted to the --no-optional and that seems to have done did the trick.
After running
npm install --omit=dev --omit=optional [email protected]
everything seems workiung again.

Sorry for the inconvenience, and thanks for your patience.

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on July 25, 2024

@cactusss

@mrbungle64

It's working again. @Aybert59 hinted to the --no-optional and that seems to have done did the trick. After running npm install --omit=dev --omit=optional [email protected] everything seems workiung again.

That means that the canvas module is causing that problems ...

from ecovacs-deebot.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.