NickWaterton / Roomba980-Python

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

python error on 3.9 version #85

Closed pilot1981 closed 3 years ago

pilot1981 commented 3 years ago

got this error executing roomba.py:

roomba $ python3 roomba.py roomba.py:32: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working from collections import OrderedDict, Mapping Traceback (most recent call last): File "/tmp/Roomba980-Python/roomba/roomba.py", line 34, in from roomba.password import Password ModuleNotFoundError: No module named 'roomba.password'; 'roomba' is not a package

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "roomba.py", line 34, in from roomba.password import Password File "/tmp/Roomba980-Python/roomba/roomba.py", line 36, in from password import Password File "/tmp/Roomba980-Python/roomba/password.py", line 6, in import six ModuleNotFoundError: No module named 'six'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "roomba.py", line 36, in from password import Password File "/tmp/Roomba980-Python/roomba/password.py", line 6, in import six

pilot1981 commented 3 years ago

I used another phyton but I receive this error:

MacBook-Pro-di-daniele-147:roomba danielevelardi$ ./getpassword.py -R 192.168.4.42 paho mqtt client not found CV or numpy module not found, falling back to PIL PIL module not found, maps are disabled waiting on port: 5678 for data found 1 Roomba(s) Make sure your robot (RoombaP2) at IP 192.168.4.42 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: { "robotname": "RoombaP2", "sku": "R696040", "nc": 0, "ver": "3", "proto": "mqtt", "ip": "192.168.4.42", "hostname": "Roomba-3163C90852330790", "sw": "3.5.62", "mac": "80:C5:F2:71:BE:6D", "cap": { "eco": 1, "ota": 1, "svcConf": 1 } } Roomba (RoombaP2) IP address is: 192.168.4.42 Traceback (most recent call last): File "./getpassword.py", line 39, in main() File "./getpassword.py", line 36, in main Password(arg.roombaIP,file=arg.configfile) File "/private/tmp/Roomba980-Python/roomba/password.py", line 41, in init self.get_password() File "/private/tmp/Roomba980-Python/roomba/password.py", line 131, in get_password sock, ssl_version=ssl.PROTOCOL_TLS, ciphers='DEFAULT@SECLEVEL=1') #ciphers='HIGH:!DH:!aNULL' may work as well File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 931, in wrap_socket ciphers=ciphers) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 546, in init self._context.set_ciphers(ciphers) ssl.SSLError: ('No cipher can be selected.',)

pilot1981 commented 3 years ago

this is issue could be related to the use of another docking station of roomba? usually dock is unaccessible to me, so there I can't press home button...

NickWaterton commented 3 years ago

On a mac, the ciphers seem to be different, you have to use the alternative 'HIGH:!DH:!aNULL' as mentioned. You have to edit /private/tmp/Roomba980-Python/roomba/password.py and change line 130 to read:

wrappedSocket = ssl.wrap_socket(
    sock, ssl_version=ssl.PROTOCOL_TLS, ciphers='HIGH:!DH:!aNULL')

ie change the ciphers to the alternative given.

As to the python 3.9 issues, I think that it's time I re-wrote the whole Roomba package for python 3 exclusively. I am getting an S9+ soon, so I will spend some time in the next few months re-writing the whole thing.

pilot1981 commented 3 years ago

thanks very much: it's worked for me!

if you would add a note in the readme/wiki: it can work also if roomba irobot isn't in dock station...it can be useful to somebody else