A standalone and self-hosted implementation of the central server used by Ecovacs vacuum robots.
Find a file
2019-05-29 19:54:39 -05:00
.github/ISSUE_TEMPLATE Update issue templates 2019-03-11 21:10:27 -04:00
bumper STARTTLS working 2019-05-29 20:48:47 -04:00
certs Add der ca and update docs 2019-02-05 09:42:16 -05:00
docs/images Update doc for crt 2019-02-05 09:50:36 -05:00
examples add black and format 2019-02-22 00:09:19 -05:00
tests Fix confserver test and add dev pbr 2019-05-23 09:20:17 -04:00
.gitignore Individual log files 2019-05-03 09:00:05 -04:00
.travis.yml Update .travis.yml 2019-03-18 23:23:28 -04:00
appveyor.yml Create appveyor.yml 2019-03-18 23:33:35 -04:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2019-03-11 21:12:15 -04:00
LICENSE.txt License 2017-12-18 12:57:28 -08:00
Pipfile Fix confserver test and add dev pbr 2019-05-23 09:20:17 -04:00
Pipfile.lock Fix confserver test and add dev pbr 2019-05-23 09:20:17 -04:00
README.md Update README.md 2019-05-20 22:59:08 -04:00
start_bumper.py STARTTLS working 2019-05-29 20:48:47 -04:00

Bumper

A standalone and self-hosted implementation of the central server used by Ecovacs vacuum robots.

Note: The current master branch is unstable.

Bumper needs users to assist with development efforts and testing in order to ensure compatability as bumper moves forward! If you've tested Bumper with your bot, please open an issue with details on success or issues.

The original bumper code base has been branched off as v0.1.0 and will remain in the original state, this will work for XMPP bots (M81 Pro, N79S, and others), but not bots that utilize MQTT (D900, D600, and others).

Please note: this software is experimental and not ready for production use. Use at your own risk.

Compatibility

As work to reverse the protocols and provide a self-hosted central server is still in progress, Bumper has had limited testing. There are a number of EcoVacs models and varying protocols that it hasn't been tested against. So far two different protocols have been seen, XMPP and MQTT. Bumper should be compatible with most wifi-enabled robots that use either the Ecovacs Android/iOS app or the Ecovacs Home Android/iOS app, but has only been reported to work on the below:

Model Protocol Used Bumper Version
Deebot 900/901 MQTT master
Deebot Ozmo 930 XMPP master
Deebot M81 Pro XMPP v0.1.0

For more information about the protocols and how it works, see the How does it work? section at the end. If you test against another model and it works, please open an issue to report it.

Why?

For fun, mostly :)

But seriously, there are a several reasons for eliminating the central server:

  1. Convenience: It works without an internet connection or if Ecovacs servers are down
  2. Performance: No need for messages to travel to Ecovacs server and back.
  3. Security: We can completely isolate the robot from the public Internet.

Requirements

  • An Ecovacs wifi-enabled robot
  • A computer on your local network to run the Bumper server
  • Python 3 and pipenv
  • A network router that has functionality for overriding DNS queries
  • A client that can connect to Bumper and talk to the robot over the Ecovacs protocol.
    • The "Ecovacs" or "Ecovacs Home" Android or iOS apps can be used if configured properly. See Using with the official Android/iOS App below.
    • Sucks can also be used, which can act as a client and control the robots via command-line.

Usage

  • Run pipenv install to install dependencies
  • Configure your Ecovacs vacuum using the official mobile app (if you haven't done this already)

DNS

You need to configure your router to point DNS locally to where Bumper is running.
The easiest way is overriding the main domains used by EcoVacs using DNSMasq/PiHole, by adding address entries in a custom config:

address=/ecouser.net/{bumper server ip}
address=/ecovacs.com/{bumper server ip}
address=/ecovacs.net/{bumper server ip}

If this isn't an option, you'll need to configure your router DNS to point a number of domains used by the app/robot to the Bumper server.
Note: Depending on country, your phone may be using a different domain. Most of these domains contain country-specific placeholders. We'll work to document all domains we encounter, but there may be additional domains and the preferred method is a overriding the full domains as above.

  • Example: If you see eco-{countrycode}-api.ecovacs.com and you live in the US/North America you would use: eco-us-api.ecovacs.com
Address Description
lb-{countrycode}.ecovacs.net Load-balancer that is checked by the app/robot
eco-{countrycode}-api.ecovacs.com Used for Login
portal-{countrycode}.ecouser.net Used for Login and Rest API
portal-ww.ecouser.net Used for various Rest APIs
msg-{countrycode}.ecouser.net Used for XMPP
mq-ww.ecouser.net Used for MQTT
gl-{countrycode}-api.ecovacs.com Used by Ecovacs Home app for API
recommender.ecovacs.com Used by Ecovacs Home app

Starting Bumper

  • Start Bumper with pipenv run python start_bumper.py

  • Reboot your robot

    • Note: Some models may require removing and re-inserting the battery pack.
    • This doesn't seem to be required for models that don't have easily accessible batteries such as the 900/901.
  • If your configuration is correct, the robot will connect to Bumper within about 30 seconds. Bumper will output information about the connection status.

  • Configure your client - see below.

Using with Sucks

Instructions (verified to work with Sucks 0.8.3)

Using with the official Android/iOS App

Bumper can be used with the official "Ecovacs" or "Ecovacs Home" app, but with limitations. Your phone needs to use your DNS server with custom settings, and you must import Bumper's CA cert and trust it before the app will work.

DNS

  • Configure your DNS server as described above in the DNS section.

Import the Bumper CA Cert

  • E-mail yourself the Bumper CA cert (located at ./certs/CA/cacert.crt) Note: Make sure you select the cacert.crt file, which is a DER encoded version that will work on either Android or iOS.

Example of emailing CA cert

  • Import the cert as a CA, and trust it
    • Instructions here are different for iOS vs Android

Importing the CA Cert on iOS

  1. Open the e-mail on your iOS device, and click the attached cert

Example of email on iOS device

  1. Install the profile by clicking "Install", and entering your pass code if prompted

Example of install profile on iOS device

  1. Accept the certificate warning by clicking "Install" again

Example of cert warning on iOS device

  1. Click "Done" to exit the profile installation
  2. Go to Settings > General > About
  3. Scroll to the bottom and click "Certificate Trust Settings"
  4. Enable Full Trust for the Bumper CA Cert, by moving the slider to the right

Example of enable trust cert on iOS device

Example of enable trust cert on iOS device 2

  1. Click continue when prompted
  2. That's it, you can now Use the app

Importing the CA Cert on Android

  1. Open the e-mail on your Android device

Quick Method

  1. Click the cert, and if prompted provide a name
  2. Under "Used for", select "VPN and apps"

Long Method

  1. Save the attached cert file
  2. Go to Settings > Lock screen and security > Other security settings
  3. Under "Credential storage", click "Install from device storage"
  4. Browse to the downloaded cert, select it, then click "Done"
  5. Click the cert, and if prompted provide a name
  6. Under "Used for", select "VPN and apps"

Now, start using the app.

Use the app

  • Open the app
  • At this time there is no authentication layer, you can enter any e-mail address and password (as long as it is 6 characters) and you will be authenticated
  • If your robot has already checked into Bumper, then it will be available in the list of robots
  • The app now does a ping to the robot to make sure it is online, and if it is you can now control the robot

How does it work?

App/Authentication

EcoVacs servers provide authentication of accounts and match those up to registered robots. Once authenticated, users can control the robots via the app. Bumper provides an implementation of the central servers providing authentication and matching.

Robots

So far two protocols have been identified that various models of EcoVacs robots use: XMPP and MQTT. These appear to be mutually exclusive and your robot model will use one of these two protocols for communication. Bumper provides an implementation of both protocols handling communication between the app and robots.


Login/Authentication/RestAPI

Bumper provides a fully simulated central server that handles login/authentication for the app/clients.

The EcoVacs app encrypts the username/password with the public key of EcoVacs when authenticating. Since we don't have the private key to decrypt, there is no way to provide true security and authentication.

Future versions may add additional options here for security.

Bots have no authentication and once a robot has been configured to access your WiFi it never needs to communicate with EcoVac's servers again.


XMPP

Example Model: Deebot M81 Pro

The robot utilizes XMPP for control. When the robot boots up it sends a HTTP request to lbo.ecovacs.net:8007 asking for the IP address and port of the XMPP server. Because of our DNS override, this request will be received by Bumper. We tell the robot to connect over XMPP to our local machine.

Both the app and robot connect to the central XMPP server, which relays messages between the app and robot. The messages contain commands for the robot to execute or responses and statuses of the robot.

Bumper exposes a simulated XMPP server that implements the necessary functions for relaying messages between a robot and a client, acting as the central server.

Note: It's been observed that the apps will attempt to utilize XMPP regardless of robot model. For models that utilize MQTT, no activity is performed over XMPP just pings.


MQTT

Example Model: Deebot 900/901

The robot utilizes MQTT for control. On startup it connects to an MQTT broker (mq-{countrycode}.ecovacs.com) and subscribes to a p2p topic where commands are issued.
The app also connects to the MQTT broker and subscribes to a attr topic where the robot will periodically post status and location updates.

The app receives status updates, for example battery status or robot position information, periodically via the attr topic.

However, commands issued via the app/client are not published directly to the p2p topic that the robot subscribes to. When the app sends a command such as "Clean", this is sent via a Rest API to the server at portal-{countrycode}.ecouser.net.

The Rest API provided by portal-{countrycode}.ecouser.net receives the command and passes it to a "helper" bot that has permission to publish to the p2p topic the robot is subscribed to. The "helper" bot waits for a response to be published by the robot and then passes that response back to the server for the Rest API to send back as a response.

Bumper provides a simulated RestAPI and "helper" bot, performing the same function as the central server above.

Thanks

A big thanks to the original project creator @torbjornaxelsson, without his work this project would have taken much longer to build. The project reached its original goal and remained in a stable, but stale state with the last commit in Dec 2017. Since the original release of bumper newer bots have been released that use different protocols, and a growing Ecovacs user base has sparked further interest in the project.

In early 2019 after making massive changes to the codebase and with ideas for additional feature development, it was decided that @bmartin5692 would take over active development. The fork was detached and all future development of bumper will take place here.

Bumper wouldn't exist without Sucks, an open source client for Ecovacs robots. Big thanks to @wpietri and contributors!