A system with multiple nics had an issue with selecting the right IP to listen on. Add --listen command-line arg. Usage: run_bumper.py --listen ip.address |
||
|---|---|---|
| .github/ISSUE_TEMPLATE | ||
| bumper | ||
| certs | ||
| docs/images | ||
| examples | ||
| tests | ||
| .gitignore | ||
| .travis.yml | ||
| appveyor.yml | ||
| CODE_OF_CONDUCT.md | ||
| LICENSE.txt | ||
| Pipfile | ||
| Pipfile.lock | ||
| README.md | ||
| start_bumper.py | ||
Bumper
A standalone implementation of the central server used by Ecovacs Deebot cleaning robots to relay data between the robot and client.
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.
The current master branch is unstable and based on the work for adding D900 series support to bumper, along with other code changes. Additional testing is needed with bots that use the XMPP protocols to ensure compatibility, so at this time it can only be guaranteed for 900-series bots (900/901/907).
If you want a working version of bumper for XMPP bots (M81 Pro, and others), the original code base has been branched off as v0.1.0 and will remain in the original state. Bumper needs users of models that use XMPP to assist with development efforts in order to ensure compatability as bumper moves forward.
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 the Ecovacs Android 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 report it so it can be added to the list.
Why?
For fun, mostly :)
But seriously, there are a several reasons for eliminating the central server:
- Convenience: It works without an internet connection or if Ecovacs servers are down
- Performance: No need for messages to travel to Ecovacs server and back.
- 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 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 installto 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.
- Example: If you see
eco-{countrycode}-api.ecovacs.comand 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 |
msg-{countrycode}.ecouser.net |
Used for XMPP |
mq-ww.ecouser.net |
Used for MQTT |
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)
- Download and install Sucks
- See the example script for how to connect
Using with the official Android/iOS App
Bumper can be used with the official 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 thecacert.crtfile, which is a DER encoded version that will work on either Android or iOS.
Importing the CA Cert on iOS
- Open the e-mail on your iOS device, and click the attached cert
- Install the profile by clicking "Install", and entering your pass code if prompted
- Accept the certificate warning by clicking "Install" again
- Click "Done" to exit the profile installation
- Go to Settings > General > About
- Scroll to the bottom and click "Certificate Trust Settings"
- Enable Full Trust for the Bumper CA Cert, by moving the slider to the right
- Click continue when prompted
- That's it, you can now Use the app
Importing the CA Cert on Android
- Open the e-mail on your Android device
Quick Method
- Click the cert, and if prompted provide a name
- Under "Used for", select "VPN and apps"
Long Method
- Save the attached cert file
- Go to Settings > Lock screen and security > Other security settings
- Under "Credential storage", click "Install from device storage"
- Browse to the downloaded cert, select it, then click "Done"
- Click the cert, and if prompted provide a name
- 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.
Bumper wouldn't exist without Sucks, an open source client for Ecovacs robots. Big thanks to @wpietri and contributors!





