Fix #31 #33

Merged
bmartin5692 merged 7 commits from fix-#31 into dev_broken-XMPP 2019-05-21 16:31:52 +02:00
3 changed files with 25 additions and 19 deletions

View file

@ -1,21 +1,17 @@
# Bumper
A standalone implementation of the central server used by Ecovacs Deebot cleaning robots to relay data between the robot and client.
A standalone and self-hosted implementation of the central server used by Ecovacs vacuum robots.
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.
**Note:** The current master branch is unstable.
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 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 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](https://github.com/bmartin5692/bumper/tree/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.
The original bumper code base has been branched off as [v0.1.0](https://github.com/bmartin5692/bumper/tree/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 the Ecovacs Android app, but has only been reported to work on the below:
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 |
|--|--|--|
@ -23,7 +19,7 @@ As work to reverse the protocols and provide a self-hosted central server is sti
| 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?](#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.
For more information about the protocols and how it works, see the [How does it work?](#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 :)
@ -40,7 +36,7 @@ But seriously, there are a several reasons for eliminating the central 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](#using-with-the-official-androidios-app) below.
- The "Ecovacs" or "Ecovacs Home" Android or iOS apps can be used if configured properly. See [Using with the official Android/iOS App](#using-with-the-official-androidios-app) below.
- [Sucks](https://github.com/wpietri/sucks) can also be used, which can act as a client and control the robots via command-line.
## Usage
@ -55,7 +51,8 @@ The easiest way is overriding the main domains used by EcoVacs using DNSMasq/PiH
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.
**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 |
@ -63,8 +60,13 @@ If this isn't an option, you'll need to configure your router DNS to point a num
| `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`
@ -83,7 +85,8 @@ Instructions (verified to work with Sucks 0.8.3)
- See the [example script](examples/sucks.py) 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.
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](#dns) section.
### Import the Bumper CA Cert
@ -197,6 +200,9 @@ The Rest API provided by `portal-{countrycode}.ecouser.net` receives the command
***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.
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](https://github.com/wpietri/sucks), an open source client for Ecovacs robots. Big thanks to @wpietri and contributors!

View file

@ -1163,7 +1163,7 @@ class ConfServer:
json_body["toId"]
)
)
body = {"id": randomid, "errno": bumper.ERR_COMMON, "ret": "fail"}
body = {"id": randomid, "errno": 500, "ret": "fail", "debug": "wait for response timed out"}
return web.json_response(body)
else:

View file

@ -151,13 +151,13 @@ class MQTTHelperBot:
self.command_responses.remove(msg)
return resp
return {"id": requestid, "errno": "timeout", "ret": "fail"}
return {"id": requestid, "errno": 500, "ret": "fail", "debug": "wait for response timed out"}
except asyncio.CancelledError as e:
helperbotlog.debug("wait_for_resp cancelled by asyncio")
return {"id": requestid, "errno": "timeout", "ret": "fail"}
return {"id": requestid, "errno": 500, "ret": "fail", "debug": "wait for response timed out"}
except Exception as e:
helperbotlog.exception("{}".format(e))
return {"id": requestid, "errno": "timeout", "ret": "fail"}
return {"id": requestid, "errno": 500, "ret": "fail", "debug": "wait for response timed out"}
async def send_command(self, cmdjson, requestid):
try: