Git Product home page Git Product logo

Comments (15)

boriswerner avatar boriswerner commented on September 23, 2024

09.05.2020
11:30 Stopped instance on RPi
11:35:07 - 11:44:55 testing with VSCode and second iobroker installation (Windwos) , then stopped both
11:55:25 started instance on RPi
12:52:25 state change info.error => RequestOAuthError: Authentication error
Instance Reboot 13:04:09 --> ok

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on September 23, 2024

Deebot 901 / ioBroker Adapter:

2020-05-09 13:07:01.776 | Terminated (START_IMMEDIATELY_AFTER_STOP): Without reason
2020-05-09 13:07:01.775 | terminating
2020-05-09 13:07:01.279 | Terminated (START_IMMEDIATELY_AFTER_STOP): Without reason
2020-05-09 13:07:01.278 | terminating
2020-05-09 13:07:01.277 | cleaned everything up...
2020-05-09 13:07:01.276 | Got terminate signal TERMINATE_YOURSELF
2020-05-09 13:07:01.273 | Got terminate signal TERMINATE_YOURSELF
...
2020-05-09 12:53:03.340 | cleaned everything up...

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on September 23, 2024

This is hopefully fixed now.

Please use getDeviceId() for getting a unique device id and a device number if running multiple devices.

const deviceNumber = 0;
const deviceId = EcoVacsAPI.getDeviceId(nodeMachineId.machineIdSync(), deviceNumber)

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on September 23, 2024

@bwp91 @nicoduj @bertreb

Starting with version 0.5.0 you can run multiple devices at once without having this issue.
You must use the getDeviceId() method mentioned above and pass a unique device number (or name) in addition to the machineId.

cc: @boriswerner

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on September 23, 2024

@bwp91 @nicoduj @bertreb

Starting with version 0.5.0 you can run multiple devices at once without having this issue.
You must use the getDeviceId() method mentioned above and pass a unique device number (or name) in addition to the machineId.

cc: @boriswerner

@bwp91 @nicoduj

Unfortunately the Ecovacs API seems to require the deviceId to login.
I tried to detach the device instance from the login, but so far I did not succeed.

If I get it right HomeBridge doesn't allow multiple instances for a plugin anymore so maybe this is not an instant solution for you...
You can nonetheless run multiple devices, but there will still be some issues.

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on September 23, 2024

Unfortunately the Ecovacs API seems to require the deviceId to login.
I tried to detach the device instance from the login, but so far I did not succeed.

Maybe I'm wrong, because I suspect now that they mean the deviceId of the mobile device the app is running on.

    this.meta = {
      'country': country,
      'lang': 'en',
      'deviceId': device_id,
      'appCode': 'i_eco_e',
      'appVersion': '1.3.5',
      'channel': 'c_googleplay',
      'deviceType': '1'
    };

I'm still not sure if it is possible to run multiple devices without having to log in for each deebot device individually, but I will try to find a solution.

from ecovacs-deebot.js.

nicoduj avatar nicoduj commented on September 23, 2024

Hi, might be the case for deviceId, maybe they use it for notifications . Let me know if I can help in any way, will integrate your changes afterwards

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on September 23, 2024

The problem is that this deviceId is also used for authorization when sending a command like Clean or GetWaterLevel.
In this case it's used for the resource, and this.resource is equal to the deviceId that is used during the login process.

   const auth = {
       'realm': constants.REALM,
       'resource': this.resource,
       'token': this.secret,
       'userid': this.user,
       'with': 'users',
   }

My tests connecting/running 2 devices of different models simultaneously if using the same deviceId:

Model Slim 2 (XMPP) Ozmo 930 (XMPP) Deebot 901 (MQTT/XML) Ozmo 920 (MQTT/JSON)
Slim 2 (XMPP) / works works partially * works partially *
Ozmo 930 (XMPP) works / works partially * works partially *
Deebot 901 (MQTT/XML) works partially * works partially * / doesn't work
Ozmo 920 (MQTT/JSON) works partially * works partially * doesn't work /

*) Works if the XMPP based device is already successfully connected

Btw.: the problem is not caused by using MQTT. It happens while sending POST requests for sending the commands.

from ecovacs-deebot.js.

nicoduj avatar nicoduj commented on September 23, 2024

Myabe we are talking about 2 differents things ? Resource -> deviceId -> the unique identifier of the device for post commands, , and deviceId in the login function that is the mobile phone ? Do you get any resource id on each vaccum after login ?

(did not look deeper into api, so maybe what I am saying is dumb, sorry if it is the case)

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on September 23, 2024

@nicoduj

(did not look deeper into api, so maybe what I am saying is dumb, sorry if it is the case)

No, it's not "dumb" ... I think you are right when it comes to what we would expect, how it works :)

But the deviceId that is used for login (mobile app and ecovacs-deebot library) is equal to the resource that is used for sending post requests.

Do you get any resource id on each vaccum after login ?

Yes, but it seams that you cannot use it for authorization in the case of sending the post requests.

For each vacuum we get:

  • did (which maybe means "device id")
  • name (which starts with "E0" and in the case of the XMPP devices it seams to be equal with the did)
  • resource (a string like 'atom' in the case of the XMPP or for example "36OA" in the case of Ozmo 920)

from ecovacs-deebot.js.

nicoduj avatar nicoduj commented on September 23, 2024

okay, so maybe they are expecting some kind of string concat there Did you run the app with some reverse proxy to see the post bidy from the app ? (like charles) ?

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on September 23, 2024

Did you run the app with some reverse proxy to see the post bidy from the app ? (like charles) ?

Not yet

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on September 23, 2024

The library actually performs proper authorization. However, to run multiple MQTT-based devices, you need a separate login procedure for each device, each with a unique device id.

With the mobile app you cannot control multiple devices at once. You have to choose one device first before you're able to send commands.

In the ioBroker adapter and the Node-Red node you have seperate instances for each device. So if you use a unique device id for each device it's working fine now.
It is a real pity that this is not possible in Homebridge.

from ecovacs-deebot.js.

nicoduj avatar nicoduj commented on September 23, 2024

Ok, seems indeed plausible . will think of it, but it seems that there would be not way to support this without 2 homebridge instances

from ecovacs-deebot.js.

stale avatar stale commented on September 23, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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.