Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Left Right MoveTurnAround ? #270

Open
matrix1233 opened this issue Dec 24, 2022 · 18 comments
Open

Move Left Right MoveTurnAround ? #270

matrix1233 opened this issue Dec 24, 2022 · 18 comments
Labels
Enhancement New feature or request Help wanted Extra attention is needed

Comments

@matrix1233
Copy link

The question

Hi,
am trying to move my ecovacs N8 but the move Left, Right and the MoveTurnAround can't work
vacbot.run("MoveForward"); ==> WORK
vacbot.run("MoveLeft"); ==> NOT WORKING
vacbot.run("MoveRight"); ==> NOT WORKING
vacbot.run("MoveBackward"); ==> WORK
vacbot.run("MoveTurnAround"); ==> NOT WORKING
vacbot.run("Stop"); ==> WORK

Can you help me to move my ecovacs to all direction ?

Thanks

Which model do you own?

None

Additional information

No response

@mrbungle64
Copy link
Owner

@matrix1233

The move commands are not working on every device.
For example none of them is working on my T8 AIVI.
They are actually for older models with remote control.

I still need to figure out the move commands for the newer models, but that's honestly not high on my priority list 😉
I'll let you know when I implemented new move commands.

@mrbungle64 mrbungle64 added the Enhancement New feature or request label Dec 25, 2022
@mrbungle64 mrbungle64 added the Help wanted Extra attention is needed label Jan 13, 2023
@scognito
Copy link

I have the same problem. Is there a way to debug?

@mrbungle64
Copy link
Owner

@scognito

I have the same problem. Is there a way to debug?

What model are you using?

@scognito
Copy link

scognito commented Apr 20, 2023 via email

@mrbungle64
Copy link
Owner

@scognito

Please try if the move commands of this branch are working:
https://github.com/mrbungle64/ecovacs-deebot.js/tree/test/2023-04

@scognito
Copy link

Unfortunately this didn't work (forward and backward commands work though, like the master branch).
This is the relevant part of the code (it's mainly the example):

        console.log("Devices:", JSON.stringify(devices));

        let vacuum = devices[deviceID];
        let vacbot = api.getVacBot(api.uid, EcoVacsAPI.REALM, api.resource, api.user_access_token, vacuum, continent);

        // Once the session has started the bot will fire a 'ready' event.
        // At this point you can request information from your vacuum or send actions to it.
        vacbot.on("ready", (event) => {
            console.log("vacbot ready");

            vacbot.run("RotateLeft");

            vacbot.on("BatteryInfo", (battery) => {
                console.log("Battery level: " + Math.round(battery));
            });
            vacbot.on('CleanReport', (value) => {
                console.log("Clean status: " + value);
            });
            vacbot.on('ChargeState', (value) => {
                console.log("Charge status: " + value);
            });
        });
        vacbot.connect();

This is the log (I removed a lot of information I think it is private, let me know if you need other info).

 info  Setting up EcovacsAPI instance
 function  connect(accountId,passwordHash)
 function  callUserAuthApi('user/login',{account:accountId,password:passwordHash})
 info  portalUrl.href: 'https://gl-it-api.ecovacs.com/v1/private/IT/EN/XXX/global_e/2.2.3/google_play/1/user/login'
 info  searchParams: 'account=XXX&password=1XXX&authTimespan=1682347383844&requestId=XXX&authTimeZone=GMT-8&authAppkey=XXX&authSign=XXX'
 payload 
{
  code: '0000',
  msg: '操作成功',
  time: 1682347384003,
  data: {
    uid: 'XXX',
    accessToken: 'XXXX',
    userName: 'XXX',
    email: 'XXX',
    mobile: null,
    isNew: null,
    loginName: 'XXX',
    ucUid: 'XXX'
  },
  success: true
}
 function  callUserAuthApi('user/getAuthCode',{"uid":"XXX","accessToken":"XXX"})
 info  portalUrl.href: 'https://gl-it-openapi.ecovacs.com/v1/global/auth/getAuthCode'
 info  searchParams: 'uid=XXX&accessToken=XXX&authTimespan=1682347384181&bizType=&deviceId=XXX&openId=global&authAppkey=XXX&authSign=XXX'
 payload 
{
  code: '0000',
  msg: '操作成功',
  time: 1682347384318,
  data: {
    authCode: 'XXX',
    ecovacsUid: 'XXX'
  },
  success: true
}
 function  callPortalApi('users/user.do','loginByItToken','{"edition":"ECOGLOBLE","userId":"XXX","token":"GLOBAL_APP__XXX","realm":"ecouser.net","resource":"XXX","org":"ECOWW","last":"","country":"IT"}')
 info  params: {"todo":"loginByItToken","edition":"ECOGLOBLE","userId":"XXX","token":"XXX","realm":"ecouser.net","resource":"XXX","org":"ECOWW","last":"","country":"IT"}
 info  portalUrl: 'https://api-app.dc-eu.ww.ecouser.net/api/users/user.do'
 payload 
{
  todo: 'result',
  result: 'ok',
  userId: 'XXX',
  resource: 'XXX',
  token: 'XXX',
  last: 604800000
}
 success  user authentication complete
 function  callPortalApi('users/user.do','GetDeviceList','{"userid":"XXX","auth":{"with":"users","userid":"XXX","realm":"ecouser.net","token":"XXX","resource":"XXX"}}')
 info  params: {"todo":"GetDeviceList","userid":"XXX","auth":{"with":"users","userid":"XXX","realm":"ecouser.net","token":"XXX","resource":"XXX"}}
 info  portalUrl: 'https://api-app.dc-eu.ww.ecouser.net/api/users/user.do'
 payload 
{
  todo: 'result',
  result: 'ok',
  devices: [
    {
      did: 'XXX',
      name: 'XXX',
      class: '7bryc5',
      resource: '8ukt',
      nick: 'Alfred',
      company: 'eco-ng',
      bindTs: 1643315113556,
      service: [Object]
    }
  ]
}
 function  callPortalApi('appsvr/app.do','GetGlobalDeviceList','{"userid":"XXX","auth":{"with":"users","userid":"XXX","realm":"ecouser.net","token":"XXX","resource":"XXX"}}')
 info  params: {"todo":"GetGlobalDeviceList","userid":"XXX","auth":{"with":"users","userid":"XXX","realm":"ecouser.net","token":"XXX","resource":"XXX"}}
 info  portalUrl: 'https://api-app.dc-eu.ww.ecouser.net/api/appsvr/app.do'
 payload 
{
  code: 0,
  todo: 'result',
  ret: 'ok',
  devices: [
    {
      did: 'XXX',
      name: 'XXX',
      class: '7bryc5',
      resource: '8ukt',
      nick: 'Alfred',
      company: 'eco-ng',
      bindTs: 1643315113556,
      service: [Object],
      homeId: 'XXX',
      homeSort: 9999,
      deviceName: 'DEEBOT N8+',
      icon: 'https://portal-ww.ecouser.net/api/pim/file/get/5fb474d4d16a99000667edd9',
      ota: true,
      UILogicId: 'N8_PLUS',
      materialNo: 'XXX',
      pid: 'XXX',
      product_category: 'DEEBOT',
      model: 'N8_PLUS_WHITE',
      updateInfo: [Object],
      status: 1,
      offmap: true
    }
  ]
}
Devices: [{"did":"XXX","name":"XXX","class":"7bryc5","resource":"XXX","nick":"Alfred","company":"eco-ng","bindTs":1643315113556,"service":{"jmq":"jmq-ngiot-eu.dc.ww.ecouser.net","mqs":"api-ngiot.dc-as.ww.ecouser.net"},"homeId":"XXX","homeSort":9999,"deviceName":"DEEBOT N8+","icon":"https://portal-ww.ecouser.net/api/pim/file/get/XXX","ota":true,"UILogicId":"N8_PLUS","materialNo":"XXX","pid":"XXX","product_category":"DEEBOT","model":"N8_PLUS_WHITE","updateInfo":{"needUpdate":false,"changeLog":""},"status":1,"offmap":true,"deviceNumber":0}]
 function  getVacBot('XXX','ecouser.net','XXX','XXX','[object Object]','eu')
 warn  got value 'eu' for continent (deprecated)
 success  '950type' model identified
 function  connect()
 info  url: 'mqtts://mq-eu.ecouser.net:8883'
 info  username: 'XXX@ecouser'
 info  clientId: 'XXX@ecouser/XXX'
 success  MQTT client connected
 function  subscribe()
 info  atr channel: 'iot/atr/+/XXX/XXX/XXX/j'
 success  successfully subscribed to atr channel
 info  [VacBot] Ready event!
vacbot ready
 success  MQTT client received ready event

If I can help debugging and testing something let me know, I would really like to help.
Thank you

@mrbungle64
Copy link
Owner

@scognito

vacbot.run("RotateLeft");

Why you use "RotateLeft"?

@scognito
Copy link

Sorry I was making some guessing and left the wrong command.
Changing to "MoveLeft" I get

 success  got response for 'move' with id '09675245':
 warn  errorCode: 500
 warn  errorDescription: Request Timeout
 info  [EcovacsMQTT] failure code 500 (undefined) sending command 'move'
 error  error sending command: Failure code 500 (undefined)

@mrbungle64
Copy link
Owner

@matrix1233 @scognito

Does the N8 (+) has control elements in the Ecovacs Home App to move the device?

@scognito
Copy link

scognito commented Apr 24, 2023 via email

@mrbungle64
Copy link
Owner

@scognito

No, it doesn't. Please don't tell me it's unsupported

The problem is that you cannot capture the traffic if you cannot trigger the function in the Ecovacs Home App 😉

@scognito
Copy link

scognito commented Apr 24, 2023 via email

@mrbungle64
Copy link
Owner

mrbungle64 commented Apr 24, 2023

Sounds good to me. Wonder how move forward and move back commands were captured since they work

I think it's working by accident 😉

I captured the traffic of the move commands for my T8 AIVI and X1 Turbo devices.
With the X1 it's working with the payload used in the test branch, but for the T8 AIVI it's still not working ...

That models have control elements in camera mode.

@scognito
Copy link

So you are 100% sure there is no way? It's a pity though. My idea was to add a mini IR camera on the N8 and create a mobile app for moving it like a security robot when I'm not at home 😔

@mrbungle64
Copy link
Owner

@scognito

So you are 100% sure there is no way?

I didn't say that, did I? 😉
I'll let you know if I finally got it working with the T8 AIVI or if there is otherwise any progress on it.

@scognito
Copy link

Ah ok cool! Let me know if and how I can help, thanks

@Hobart2967
Copy link

Same here, using a deebot N8 and LEft & Right are not working.

@Hobart2967
Copy link

Would offer my support in sniffing or testing if you'd like to have some more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants