bmartin5692 / bumper

A standalone and self-hosted implementation of the central server used by Ecovacs vacuum robots.
GNU General Public License v3.0
286 stars 48 forks source link

Error with install #23

Closed DENightOne closed 4 years ago

DENightOne commented 5 years ago

Firstly thanks for doing this project. I dont like placing all my faith in a cloud server running my deebot.

I have having issues when trying to run the code....I keep getting this error.

Traceback (most recent call last): File "start_bumper.py", line 4, in import bumper File "/usr/src/bumper-dev_broken-XMPP/bumper/init.py", line 3, in from .confserver import ConfServer File "/usr/src/bumper-dev_broken-XMPP/bumper/confserver.py", line 11, in import contextvars ModuleNotFoundError: No module named 'contextvars'

I am running alpine linux with python 3.6.8 I have tried installing contextvars with the following " pipenv install contextvars" but i still get the same error.

I am not a linux user so I am struggling, any pointers would help.

Thanks

DENightOne commented 5 years ago

update...it seems for some reason pipenv is running twice...meaning it runs once...then runs again and deletes the previous virtual enviroment... on a forum someone discovered that wheel is deleteing the module install files before it installs...hence the no module found...when i run pipenv sync i see that the module is not installed....

Just to check if it workes...I created a VM that only runs python and run your code straight from folder...no pipenv..... havent tested with vacuum yet....

Since i started testing yesterday my Deebot 901 has gone totally crazy just bashes into everything and cant follow the map....or just goes in circles....:( unrealted to bumper...just unfortunate timing. What i have noticed is that when my deebot cant find the internet it just stays still and asks for help....not good!

bmartin5692 commented 5 years ago

Thanks for reporting this. I just merged #24 into the dev_broken-XMPP branch. The context vars weren't used anymore, I just hadn't finished removing them after moving to async.

Give that a shot and let me know how it does. I also fixed a dumb issue with the initial startup if bumper hadn't been run before due to not creating the folder on linux/mac for the bumper.db.

I haven't tried bumper with alpine, but I've run it from a RaspberryPI, Ubuntu, and Windows. Let me know how it does now.

DENightOne commented 5 years ago

Running the new code now.... runs without issue now...but I am not seeing the Deebot connecing to mqtt... I see the bot register with serial number but thats it....nothing appears in the mqtt logs.... I have "port scanned" the bumper server and I see all the ports open but nothing connects....I am still having issues with my deebot going crazy and bumping into things...so maybe its that.... when I point at the normal servers I do see it connecting to mqtt on 8883 to the evacs portal... Is there any way to run in verbose mode...or can I turn on more logging? When i point my andriod app (with bumper cert installed) at the bumper server I also get a lot of unable to post data errors and the deebot doesnt show up at all... any tips on android install.....I will try later on my ipad Thank again....I really hope that I get this to work because its a fantastic project.

bmartin5692 commented 5 years ago

Try running with --debug and see if that gives you more detail. It may also be worth checking the DNS to ensure it's mapped correctly. It is easiest to override the top-level domains instead of the individual API, MQ, etc due to the various country settings and differences.

DENightOne commented 5 years ago

Thanks......I am using pihole with custom config to override the domains......like this

address=/ecouser.net/192.168.1.20 address=/ecovacs.com/192.168.1.20 address=/ecovacs.net/192.168.1.20

Hope those are all the domains!

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Brian Martin notifications@github.com Sent: Tuesday, May 14, 2019 2:49:36 PM To: bmartin5692/bumper Cc: DENightOne; Author Subject: Re: [bmartin5692/bumper] Error with install (#23)

Try running with --debug and see if that gives you more detail. It may also be worth checking the DNS to ensure it's mapped correctly. It is easiest to override the top-level domains instead of the individual API, MQ, etc due to the various country settings and differences.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/bmartin5692/bumper/issues/23?email_source=notifications&email_token=AF5QUMKHIZ77XA64VITRWC3PVKYOBA5CNFSM4HMJ3BAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVLLWKY#issuecomment-492223275, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AF5QUMLPFTYIWP64JFQ2JPTPVKYOBANCNFSM4HMJ3BAA.

bmartin5692 commented 5 years ago

Should be, let me know if running with --debug provides any additional information.

DENightOne commented 5 years ago

When I run –debug I only get one line

PS S:\Development\bumper-dev_broken-XMPP> pipenv run python .\start_bumper.py --debug [2019-05-14 16:24:25,984] :: DEBUG :: xmppserver :: xmppserver :: async_server :: 26 :: listening on 192.168.1.60:5223

I haven’t tried to connect to MQTT yet with the robot.... just wanted to confirm

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Brian Martin notifications@github.com Sent: Tuesday, May 14, 2019 2:49:36 PM To: bmartin5692/bumper Cc: DENightOne; Author Subject: Re: [bmartin5692/bumper] Error with install (#23)

Try running with --debug and see if that gives you more detail. It may also be worth checking the DNS to ensure it's mapped correctly. It is easiest to override the top-level domains instead of the individual API, MQ, etc due to the various country settings and differences.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/bmartin5692/bumper/issues/23?email_source=notifications&email_token=AF5QUMKHIZ77XA64VITRWC3PVKYOBA5CNFSM4HMJ3BAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVLLWKY#issuecomment-492223275, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AF5QUMLPFTYIWP64JFQ2JPTPVKYOBANCNFSM4HMJ3BAA.

bmartin5692 commented 5 years ago

That looks correct. Once the bot checks in and you control via the app you'll see much more. The logs directory will have 5 log files as well that will begin to be populated.

DENightOne commented 5 years ago

I have installed the cert on my ipad and get the following in the –debug mode

[2019-05-14 17:40:57,452] :: DEBUG :: aiohttp.access :: web_log :: log :: 233 :: 192.168.1.44 [14/May/2019:15:40:57 +0000] "GET /v1/global/auth/getAuthCode?accessToken=22bd59eb8b0d493dbec6bdfe986b03b8&authAppkey=1520391491841&authSign=e12c1155e8e3e8ae1af8918df10c65fa&authTimespan=1557848457354&bizType=&deviceId=e9198c52a3d0424aaf550d1121f357a6&uid=fuid_tmpuser HTTP/1.1" 404 174 "-" "EcovacsHome/1.1.5 (iPad; iOS 9.3.5; Scale/2.00)"

It says 404 but not sure what page its trying to get too

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Brian Martin notifications@github.com Sent: Tuesday, May 14, 2019 4:29:23 PM To: bmartin5692/bumper Cc: DENightOne; Author Subject: Re: [bmartin5692/bumper] Error with install (#23)

That looks correct. Once the bot checks in and you control via the app you'll see much more. The logs directory will have 5 log files as well that will begin to be populated.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/bmartin5692/bumper/issues/23?email_source=notifications&email_token=AF5QUMKVJQAGQTKMMSBI5FDPVLEEHA5CNFSM4HMJ3BAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVLVDIQ#issuecomment-492261794, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AF5QUMKPMY2U2NDYQIPCFPTPVLEEHANCNFSM4HMJ3BAA.

bmartin5692 commented 5 years ago

Ah - You are using the EcoVacs Home app - Bumper doesn't work with that yet. I'm not sure the difference between the two as I haven't had the need to dig into the EcoVacs Home app yet, but the D90X series works with either the EcoVacs Home or Ecovacs app.

Try using the Ecovacs app (non-Home) version and see if that works.

DENightOne commented 5 years ago

Aaah...sadly I will have to fiddle....as when I use Ecovacs I get an error saying that with the firmware that I have on the robot I can only use ecovacs home app....my firmware is 2.1.3 and I got the robot with that firmware......I bought it second hand as “new” and I think the previous owner messed the firmware upgrade up as the robot worked well for three full cleans and now it just goes crazy

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Brian Martin notifications@github.com Sent: Tuesday, May 14, 2019 5:49:12 PM To: bmartin5692/bumper Cc: DENightOne; Author Subject: Re: [bmartin5692/bumper] Error with install (#23)

Ah - You are using the EcoVacs Home app - Bumper doesn't work with that yet. I'm not sure the difference between the two as I haven't had the need to dig into the EcoVacs Home app yet, but the D90X series works with either the EcoVacs Home or Ecovacs app.

Try using the Ecovacs app (non-Home) version and see if that works.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/bmartin5692/bumper/issues/23?email_source=notifications&email_token=AF5QUMPTD7T2IUTTNOLMSNDPVLNPRA5CNFSM4HMJ3BAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVL5QOQ#issuecomment-492296250, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AF5QUMMWLITJJ36VFQRDVV3PVLNPRANCNFSM4HMJ3BAA.

bmartin5692 commented 5 years ago

Interesting. My bot is on firmware 1.5.3. If I get time later I will see about checking for the latest and also working on EcoVacs Home app compatibility (#25).

bmartin5692 commented 5 years ago

Hi @DENightOne - I worked on this over the weekend and have added initial support for the EcoVacs Home app. Could you give the support-ecovacs-home branch a try and see if you are able to use your app successfully now?

bmartin5692 commented 5 years ago

I did a lot of testing myself and decided to merge the support-ecovacs-home branch into both master (#29) and dev_broken-xmpp (#30). Either way let me know how it works out for you.

DENightOne commented 5 years ago

Will do...thanks

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Brian Martin notifications@github.com Sent: Monday, May 20, 2019 7:13:46 PM To: bmartin5692/bumper Cc: DENightOne; Mention Subject: Re: [bmartin5692/bumper] Error with install (#23)

Hi @DENightOnehttps://github.com/DENightOne - I worked on this over the weekend and have added initial support for the EcoVacs Home app. Could you give the support-ecovacs-homehttps://github.com/bmartin5692/bumper/tree/support-ecovacs-home branch a try and see if you are able to use your app successfully now?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/bmartin5692/bumper/issues/23?email_source=notifications&email_token=AF5QUMJJXVNDSI5SBTW2TE3PWLL4VA5CNFSM4HMJ3BAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVZPUXI#issuecomment-494074461, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AF5QUMKFW45CYG7KWOZBICTPWLL4VANCNFSM4HMJ3BAA.

DENightOne commented 5 years ago

Running new code...

When I launch the ecovacs home app I just get hundreds of cert errors

Traceback (most recent call last): File "/usr/lib/python3.7/asyncio/sslproto.py", line 526, in data_received ssldata, appdata = self._sslpipe.feed_ssldata(data) File "/usr/lib/python3.7/asyncio/sslproto.py", line 189, in feed_ssldata self._sslobj.do_handshake() File "/usr/lib/python3.7/ssl.py", line 763, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert certificate unknown (_ssl.c:1056)

I have the bumper cert installed on my android phone. (under user certs)

Do I have to do something special on the server as well?

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Brian Martin notifications@github.com Sent: Tuesday, May 21, 2019 4:35:47 AM To: bmartin5692/bumper Cc: DENightOne; Mention Subject: Re: [bmartin5692/bumper] Error with install (#23)

I did a lot of testing myself and decided to merge the support-ecovacs-home branch into both master (#29https://github.com/bmartin5692/bumper/pull/29) and dev_broken-xmpp (#30https://github.com/bmartin5692/bumper/pull/30). Either way let me know how it works out for you.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/bmartin5692/bumper/issues/23?email_source=notifications&email_token=AF5QUMN5ZRY2GAM5EU2A6LTPWNNYHA5CNFSM4HMJ3BAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV2SOZI#issuecomment-494217061, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AF5QUMKZSNOK76ZGZIWIWXLPWNNYHANCNFSM4HMJ3BAA.

DENightOne commented 5 years ago

Actually its this error

[2019-05-21 09:09:18,324] :: DEBUG :: asyncio :: selector_events :: _accept_connection :: 159 :: <Server sockets=[<socket.socket fd=11, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.1.20', 443)>]> got a new connection from ('192.168.1.145', 45136): <socket.socket fd=19, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.1.20', 443), raddr=('192.168.1.145', 45136)> [2019-05-21 09:09:18,327] :: DEBUG :: asyncio :: sslproto :: _start_handshake :: 596 :: <asyncio.sslproto.SSLProtocol object at 0x7fd9fbf223c8> starts SSL handshake [2019-05-21 09:09:18,328] :: DEBUG :: asyncio :: base_events :: _run_once :: 1733 :: poll 334.531 ms took 0.105 ms: 1 events [2019-05-21 09:09:18,423] :: DEBUG :: asyncio :: base_events :: _run_once :: 1733 :: poll 330.474 ms took 91.346 ms: 1 events [2019-05-21 09:09:18,424] :: ERROR :: asyncio :: base_events :: default_exception_handler :: 1608 :: SSL handshake failed

My phone keeps saying handshake failed

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Brian Martin notifications@github.com Sent: Tuesday, May 21, 2019 4:35:47 AM To: bmartin5692/bumper Cc: DENightOne; Mention Subject: Re: [bmartin5692/bumper] Error with install (#23)

I did a lot of testing myself and decided to merge the support-ecovacs-home branch into both master (#29https://github.com/bmartin5692/bumper/pull/29) and dev_broken-xmpp (#30https://github.com/bmartin5692/bumper/pull/30). Either way let me know how it works out for you.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/bmartin5692/bumper/issues/23?email_source=notifications&email_token=AF5QUMN5ZRY2GAM5EU2A6LTPWNNYHA5CNFSM4HMJ3BAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV2SOZI#issuecomment-494217061, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AF5QUMKZSNOK76ZGZIWIWXLPWNNYHANCNFSM4HMJ3BAA.

bmartin5692 commented 5 years ago

That looks like the cert wasn't installed properly, or was the wrong one. Check that you follow the directions here. Make sure you email yourself the cacert.crt from the bumper directory /certs/CA/cacert.crt. When importing make sure it is set for "VPN and apps".

DENightOne commented 5 years ago

Will reinstall cert...but that was the one that I was using...

PS...Just want to confirm that ecovacs home is in the dev_broken-XMPP branch as I don’t see a separate branch for ecovacs home?

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Brian Martin notifications@github.com Sent: Tuesday, May 21, 2019 4:53:52 PM To: bmartin5692/bumper Cc: DENightOne; Mention Subject: Re: [bmartin5692/bumper] Error with install (#23)

That looks like the cert wasn't installed properly, or was the wrong one. Check that you follow the directions herehttps://github.com/bmartin5692/bumper#importing-the-ca-cert-on-android. Make sure you email yourself the cacert.crt from the bumper directory /certs/CA/cacert.crt. When importing make sure it is set for "VPN and apps".

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/bmartin5692/bumper/issues/23?email_source=notifications&email_token=AF5QUMNAIN5L2XIOVN5WW7TPWQEIBA5CNFSM4HMJ3BAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV4FRVY#issuecomment-494426327, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AF5QUMIALELV7NJGGHW6KKDPWQEIBANCNFSM4HMJ3BAA.

bmartin5692 commented 5 years ago

Ok, I hope that fixes it for you. Yes the dev_broken branch contains the modifications for Ecovacs Home to work. I merged the changes from that branch into both master and dev_broken-XMPP.

I tested the Ecovacs Home app on both Android and iOS successfully.

DENightOne commented 5 years ago

Pretty sure my error is cause becuase I am running Android 9 (Pie) on my phone.....this applies to Pie

According to the Android 9 Change-Log this is expected for certificates without SAN:

RFC 2818 describes two methods to match a domain name against a certificate—using the available names within the subjectAltName (SAN) extension, or in the absence of a SAN extension, falling back to the commonName (CN).

However, the fallback to the CN was deprecated in RFC 2818. For this reason, Android no longer falls back to using the CN. To verify a hostname, the server must present a certificate with a matching SAN. Certificates that don't contain a SAN matching the hostname are no longer trusted.

DENightOne commented 5 years ago

I have installed the app on my wifes Android 7 phone..... although I still get some weird SSL errors and its telling me that its not connecing to 443... it still starts logging stuff into the XMPPserver logs.... which is a little weird as I thought Deebot 900 used MQTT and didnt communicate with XMPP? I have reset the phone app and now resetting the robot and will let you know how it goes

bmartin5692 commented 5 years ago

Thanks that is good information. The cert was on my list of things that I want to be generated by Bumper either at runtime or by the user instead of coming with the repo/code. I have the SAN in that cert for .ecouser.net and .ecovacs.com. That was made before I had dug into all of the domains the app would communicate with, so I think a new one needs to be created with additional SAN domains like *.ecovacs.net.

It's been a while, but I think the 900 connects to XMPP then sits there only accepting pings. From my testing it worked fine without being able to connect to XMPP. You'll notice the app connects to XMPP as well once you are able to select the bot, even though it doesn't use that for communication.

DENightOne commented 5 years ago

Installed certificate and app on my old ipad 3 with IOS9.... works great...installs fine..reset the Deebot and it connects and finds Deebot..... My Deebot is still freaking out and running all over the place.....His/Her latest trick is to stand still for like 3 min and then ask for help....will need to send it away for repairs or wait for newer firmware..... Thanks again for all you help.....I will watch this space for a new SAN cert

For your info this is what my phone looks for when I open the ecovacs home app on my andoid 9 phone:

2019-05-21 20:36:42 A recommender.ecovacs.com 192.168.1.145 OK (forwarded) IP (310.3ms)
2019-05-21 20:36:40 A gl-de-openapi.ecovacs.com 192.168.1.145 OK (forwarded) IP (161.9ms)
2019-05-21 20:36:37 A gl-de-api.ecovacs.com 192.168.1.145 OK (forwarded) IP (318.5ms)
2019-05-21 20:36:37 A gl-de-api.ecovacs.com 192.168.1.145 OK (forwarded) IP (308.7ms)
2019-05-21 20:36:37 A bigdata-europe.ecovacs.com 192.168.1.145 OK (forwarded) IP (318.8ms)

also portal-ww.ecouser.net

The Deebot connects to : mq-ww.ecouser.net

bmartin5692 commented 5 years ago

Hi @DENightOne -

The latest version of master has a utility for creating certificates. It uses a list of SANs for the generation, so it should be able to add to it in the future or provide custom ones as needed. Can you test this and let me know if it addresses the issue?

DENightOne commented 5 years ago

Hi,

I tested this today.... a few things to note.

When I generate the cert with the using create_certs_linux (alpine and Debian) it generates a cert without the contents of the Bumper_SAN.txt file included....only generates SAN of localhost..127.0.0.0 and machine name and machine IP. When I generated the certs with create_certs_windows it worked fine (meaning contents of Bumper_SAN.txt included...so I just generated the certs on a windows machine and copied them over.

Secondly, --debug and –listen (and I assume –annouce) don’t work at all.... I had to hardcode the BUMPER_LISTEN and DEBUG into the file to get it to work..... once I hardcode the environmental variables it worked fine... (took a brief look at the code and it seems there is no provision for arguments)

Sadly still does not work on Ecovacs home app runnin Andoid 9 (Pie)...... It works fine on my iPad 3 (IOS9) ...Pretty sure Andoid Pie still has certificate pinning issues... my wife has andoird 7 so I will try that tomorrow and let you know is Ecovacs Home works on Android 7

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Brian Martin notifications@github.com Sent: Sunday, June 9, 2019 2:31:06 PM To: bmartin5692/bumper Cc: DENightOne; Mention Subject: Re: [bmartin5692/bumper] Error with install (#23)

Hi @DENightOnehttps://github.com/DENightOne -

The latest version of master has a utility for creating certificates. It uses a list of SANs for the generation, so it should be able to add to it in the future or provide custom ones as needed. Can you test this and let me know if it addresses the issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/bmartin5692/bumper/issues/23?email_source=notifications&email_token=AF5QUMJAHOPJNIM3T7HBIS3PZTZYVA5CNFSM4HMJ3BAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXIJGGY#issuecomment-500208411, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AF5QUMI33QH7HHBSFLAV3RLPZTZYVANCNFSM4HMJ3BAA.

bmartin5692 commented 5 years ago

Thanks. I split this into three issues:

  1. 41 - Create_Certs

    • I tested certs, but will have to look closer. It probably needs some tests written for it as well, I was focusing on the Python tests and Create_Certs is written in Go. - Fixed by #45
  2. 42 - Command-line Args

    • This is strange. I have tests for these and also tested on Mac/Windows/Linux. To run it with args you did something like pipenv run python -m bumper --listen 0.0.0.0 ? I was able to reproduce this. I guess this was broken along the way and my tests don't properly test it....Fixed by #44
  3. 43 - Android 9 Pie and Cert Pinning

    • I'll have to get Android Studio/Pie 9 running to test and look into this.