NickWaterton / Roomba980-Python

Python program and library to control iRobot Roomba 980 Vacuum Cleaner
MIT License
371 stars 103 forks source link

The handshake operation timed out #40

Closed ryanandres closed 5 years ago

ryanandres commented 5 years ago

I'm tried many times and even rebooted Roomba and resetted it. What can cause this error?

PS C:\Repos\Roomba980-Python> python .\roomba\getpassword.py -R 192.168.3.18 waiting on port: 5678 for data found 1 Roomba(s) Make sure your robot (Roomba) at IP 192.168.3.18 is on the Home Base and powered on (green lights on). Then press and hold the HOME button on your robot until it plays a series of tones (about 2 seconds). Release the button and your robot will flash WIFI light. Press Enter to continue... Received: { "ver": "3", "hostname": "Roomba-3162C22490342750", "robotname": "Roomba", "ip": "192.168.3.18", "mac": "40:9F:38:95:4E:F2", "sw": "v2.4.6-3", "sku": "R980020", "nc": 1, "proto": "mqtt", "cap": { "pose": 1, "ota": 2, "multiPass": 2, "carpetBoost": 1, "pp": 1, "binFullDetect": 1, "langOta": 1, "maps": 1, "edge": 1, "eco": 1, "svcConf": 1 } } Roomba (Roomba) IP address is: 192.168.3.18 Connection Error _ssl.c:1034: The handshake operation timed out Socket Error: timed out Error getting password, receive 0 bytes. Follow the instructions and try again.

NickWaterton commented 5 years ago

Is this on Windows?

ryanandres commented 5 years ago

Yes on Windows 10. Perhaps a known compatibility issues?

On Mon, Nov 5, 2018, 9:08 AM Nick Waterton <notifications@github.com wrote:

Is this on Windows?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NickWaterton/Roomba980-Python/issues/40#issuecomment-435930971, or mute the thread https://github.com/notifications/unsubscribe-auth/AA9UmyeZXJR7tQ6n87w_btx3NjBIvav7ks5usGIJgaJpZM4YNLoE .

NickWaterton commented 5 years ago

I've never tested the code on Windows, it's an ssl error on the socket connection to the Roomba. This may have to do with the version of openSSL you have installed, as it uses the openSSL libraries.

This is from the python ssl library:

Note Which connections succeed will vary depending on the version of OpenSSL.
For example, before OpenSSL 1.0.0, an SSLv23 client would always attempt SSLv2 connections.

Roomba uses TLSv1, so you need an SSLv23 library.

You will run into a problem later on as well, as I'm not sure where the certificate files are stored in Windows, and the default locations are for linux OS's.

Seems odd that it's a timeout error though.

ryanandres commented 5 years ago

This was a network configuration issue. I got it to work.

I tried using Ubuntu 16.04 and had the same error. This led me to look at my network closer.

I have my IoT devices on a separate VLAN/Subnet/SSID so their IP is 192.168.3.x and my LAN is 192.168.1.x. Both networks can communicate together, however the firewall rule for my IoT network is it can access the internet but not any other of my networks unless it originates from them.

So I connected to the same SSID which puts me in the same 192.168.3.x subnet and the script worked on windows and linux.

I did not test precisely whether the firewall was the issue or the addressing.

NickWaterton commented 5 years ago

Good to know, glad you found it.