Giter Site home page Giter Site logo

roomba980-python's Issues

enable_map on hassio

Hi Nick,
Thanks for your wonderful work!
Trying to get Roomba980-Python generate a cleaning map for my 980 but currently stuck on an error, can you please help with troubleshooting?
Here's what I'm doing in my script:

roomba = Roomba(
address=host, blid=xxx, password=xxx, cert_name=xxx,
continuous=xxx)
roomba.enable_map(
enable=True, mapSize="(800,1650,-300,-50,2,0)",
enableMapWithText=False,
roomOutline=False,
mapPath="/www/map/",
iconPath="/www/res"
)`

I get the following error:

TypeError: enable_map() got an unexpected keyword argument 'enableMapWithText'

If I try to comment out the enableMapWithText line I get other errors related to missing freetype support in Pillow which will be more difficult to fix on this platform.
Can you suggest how to call enable_map correctly?
Thanks in advance!

Problem with Roomba i7 since 3.0.11 firmware upgrade

Hello,
I am using this great library in a plugin for the French home automation system Jeedom.
One of my users reported that since his Roomba i7 has been upgraded (in the last week of September) the plugin is no more working and he even unable to retrieve the password (even after trying many times).
For all other users having different robot models (including me) the script is still working great so until now the problem seems limited to i7/i7+
I did a bit of debugging on his system and in fact the problem arise at connection step https://github.com/NickWaterton/Roomba980-Python/blob/master/build/lib.linux-x86_64-2.7/roomba/password.py#L127 because the robot is returning a 104 error connection reset by peer.
After a search it appears that other have the same exact problem see ratsputin comment here home-assistant/core#27028.

Automatically generated config.ini appears to be unusable by read_config_file() in roomba.py.

It appears there are at lease two read_config_file()s; one in roomba.py and one in main.py. And the version in roomba.py looks like it will only use the first address if there are more than one, based on the indention.

Example Application code:

myroomba = Roomba()
myroomba.connect()

Error from Application code:

Traceback (most recent call last):
  File "/usr/lib/python3.5/configparser.py", line 1135, in _unify_values
    sectiondict = self._sections[section]
KeyError: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "complicated.py", line 64, in <module>
    myroomba = Roomba()
  File "/home/jgstratton/Work/venvs/Roomba980-Python/lib/python3.5/site-packages/roomba/roomba.py", line 210, in __init__
    self.read_config_file(file)
  File "/home/jgstratton/Work/venvs/Roomba980-Python/lib/python3.5/site-packages/roomba/roomba.py", line 232, in read_config_file
    self.blid = Config.get(self.address, "blid"),
  File "/usr/lib/python3.5/configparser.py", line 778, in get
    d = self._unify_values(section, vars)
  File "/usr/lib/python3.5/configparser.py", line 1138, in _unify_values
    raise NoSectionError(section)
configparser.NoSectionError: No section: None

Suspect Code in read_config_file() in roomba.py (Note the indention of "self.address = addresses[0]"):

        if self.address is None:
            if len(addresses) > 1:
                self.log.warn("config file has entries for %d Roombas, "
                              "only configuring the first!")
                self.address = addresses[0]
        self.blid = Config.get(self.address, "blid"),
        self.password = Config.get(self.address, "password")

There might be other issues around the getting of the address. I'm kind of playing around with a fix and may open a PR unless a fix gets banged out sooner (or I missed something obvious and by Issue request is invalid...)

Gettimestamp is not working

Hi,

I am not sure if this is an issue. But I re-installed everything and everything seems to work. except, during the logs and sitemap, I get:
Rule 'Roomba Last Update Timestamp': The name 'getTimestamp' cannot be resolved to an item or type; line 48, column 5, length 12

noPP, vacHigh and schedHold settings meaning?

I noticed those three settings and cannot make out what they mean: noPP, vacHigh and schedHold. vacHigh I assumed to be something to wether to go constantly on full power mode or not, but changing the value does not have any direct effect (at least while the cleaning job is running). The other two I have no clue.

Anybody got an idea?

replace roombaName in log messages with address when roombaName not known

When roombaName is unknown, the log messages which display self.roombaName display an empty string for the name. Please either look up the name from the config file or somewhere when the name is unknown, or replace it with the address (IP address). This will significantly aid in log readability when more than one roomba is in the house. The following code snippet might prove useful.

self.password = password if roombaName == "": self.roombaName=address else: self.roombaName = roombaName self.log.info("Setting roombaName to {}".format(self.roombaName)) self.topic = topic
This could impact the set_mqtt_client function, and map file naming.

Reconnect issues

I’m have a problem that I can’t reconnect to my Roomba if the connection is lost.
According to the log it tries to reconnect but nothing happens.
If I restart roompa.py I get connection refused.
I always have to restart my Roomba to be able to connect to it again.

Roomba 671 - Lights do not turn off

I've managed to configure hassbian access with the help of your code. Everything is working correctly, except for the lights on the device not turning off.

I have continuous: false set in my configuration.yaml. Is there anything else I need to do, please?

Many thanks.

Voltage

Hi, is it possibile to get current voltage ? (900 series)

Performance Optimisations

Hello,

I run your program on a low power Celeron J4105 powered board and it is running with ~50% CPU utilization if the roomba is active.

Now I tried to optimize it a little bit.

  1. I disabled the storage of the lines.png and the problems.png. I use it as a in memory only image.
  2. I apply the problems.png only if there are problems.
  3. I disabled the map.png because I use the map_notext.png only. I will make this configureable

as a result, the utilization is going down from 50-60% to 18-20%.

Is there any reason why you are storing the lines.png and the problems.png on the harddisk?

Later I can also provide a pull request.

Failing to Parse JSON Responses

Hi,
When I try to run the quick start, I get the output shown below. It seems to scan and find my Roombas correctly, but fails to parse the responses even though it is receiving them, and thus fails out thinking it didn't find any. OS is Linux Mint 18.2 (Ubuntu 16.04 base).

$ roomba
[I 2017-11-26 20:28:29,106] *******************
[I 2017-11-26 20:28:29,106] * Program Started *
[I 2017-11-26 20:28:29,106] *******************
[I 2017-11-26 20:28:29,106] Roomba.py Version: 1.2.1
[I 2017-11-26 20:28:29,106] Python Version: 3.5.2 (default, Sep 14 2017, 22:51:06) [GCC 5.4.0 20160609]
[I 2017-11-26 20:28:29,106] Paho MQTT Version: 1.3.1
[I 2017-11-26 20:28:29,106] CV Version: 3.3.0
[I 2017-11-26 20:28:29,107] PIL Version: 4.3.0
[I 2017-11-26 20:28:29,107] <CNTRL C> to Exit
[I 2017-11-26 20:28:29,107] Roomba 980 MQTT data Interface
[I 2017-11-26 20:28:29,107] reading info from config file ./config.ini
[W 2017-11-26 20:28:29,107] No roomba or config file defined, I will attempt to discover Roombas, please put the Roomba on the dock and follow the instructions:
waiting on port: 5678 for data
supplied address 255.255.255.255 does not match discovered address 192.168.1.118, using discovered address...
supplied address 255.255.255.255 does not match discovered address 192.168.1.247, using discovered address...
json decode error: the JSON object must be str, not 'bytes'
RECEIVED: %s (b'{"ver":"2","hostname":"Roomba-3117481C00311810","robotname":"Roomba1","ip":"192'
 b'.168.1.247","mac":"F0:03:8C:67:F3:14","sw":"v2.2.11-4","sku":"R980020","nc":'
 b'0,"proto":"mqtt"}')
supplied address 255.255.255.255 does not match discovered address 192.168.1.121, using discovered address...
json decode error: the JSON object must be str, not 'bytes'
RECEIVED: %s (b'{"ver":"2","hostname":"Roomba-3117450410338620","robotname":"Roomba2","ip":"192.'
 b'168.1.121","mac":"F0:03:8C:53:11:12","sw":"v2.2.11-4","sku":"R980020","nc":0'
 b',"proto":"mqtt"}')
No Roombas found, try again...
[I 2017-11-26 20:28:39,273] reading info from config file ./config.ini
[E 2017-11-26 20:28:39,273] No Roombas found! You must specify RoombaIP, blid and roombaPassword to run this program, or have a config file, use -h to show options.

Roomba 695

Has anyone tested this on Roomba 695? Am trying to get my Roomba integrated with Home Assistant, so I need this module to work.

I am unable to connect, only see:

Robot Data:
undefined

Debug log shows:

4 verbose run-script [ 'pregetpassword', 'getpassword', 'postgetpassword' ]
5 info lifecycle [email protected]~pregetpassword: [email protected]
6 info lifecycle [email protected]~getpassword: [email protected]
7 verbose lifecycle [email protected]~getpassword: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~getpassword: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/redbull/roomba/dorita980/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
9 verbose lifecycle [email protected]~getpassword: CWD: /home/redbull/roomba/dorita980
10 silly lifecycle [email protected]~getpassword: Args: [ '-c', 'node ./bin/getpassword.js "192.168.10.166"' ]
11 silly lifecycle [email protected]~getpassword: Returned: code: 1  signal: null
12 info lifecycle [email protected]~getpassword: Failed to exec getpassword script
13 verbose stack Error: [email protected] getpassword: `node ./bin/getpassword.js "192.168.10.166"`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at EventEmitter.emit (events.js:213:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at ChildProcess.emit (events.js:213:7)
13 verbose stack     at maybeClose (internal/child_process.js:897:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/redbull/roomba/dorita980
16 verbose Linux 4.13.4-1-pve
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "getpassword" "192.168.10.166"
18 verbose node v8.1.2
19 verbose npm  v5.5.1
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] getpassword: `node ./bin/getpassword.js "192.168.10.166"`
22 error Exit status 1
23 error Failed at the [email protected] getpassword script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Any ideas?

Hass.io Support

Trying to add this to hassio by adding the component configuration in the configuration.yaml
I've ssh'd into the hassio instance and roomba or python roomba.py are not found.

Any points in the right direction are appreciated.

Final Map redraw cuts off half the map if rotation is set to 90

Hi,
The distorted map is now fixed while the Roomba is running and mapping the room, however, when it completes the job, since my room have a rotation of 90, on final draw, it seems to re-rotate, and cuts off half the map.
I have attached the map.png (while it is running) and the lines.png and the finalmap when it completes the job.

Maybe remove the final map rotation. I am not sure if that is even needed.

Command I have:
-s '(2100,800,-550,-280,90,180)'

Map while running:
map

Lines.png:
lines

Map when job completed:
map_final

Compatible with i7?

Is there anyway that I can help with making this compatible with i7?

I just gave this a try and it is not detecting the BLID or password....

Actual error codes

Roomba 980, FW 2.4.6-3 June 15, 2018 (latest).
Error codes from real tests, texts - from official iRobot app (v.4.4.2):

        1: "Left wheel off floor",
        3: "Right wheel off floor",
        4: "Left wheel stuck",
        5: "Right wheel stuck",

Not able to connect Roomba 980

Even I do a portscan on the IP of my roomba nmap $IP -p1-65535 I do not get any open port

user:~/.local/bin$ ./roomba-getpassword -R $IP
waiting on port: 5678 for data
No Roombas found, try again...

Password issue: Socket Error: ('The read operation timed out',)

I'm having immense trouble trying to extract the BLID and password from my Roomba. I've run this from 2 different machines running bash for windows. I've removed the app from my phone completely, rebooted the robot, and I still can't get it to work. This is the output I receive each time.

Received: {
"robotname": "Roomba",
"sku": "R675020",
"nc": 0,
"ver": "3",
"proto": "mqtt",
"ip": "10.105.20.217",
"hostname": "Roomba-3192C21860517830",
"sw": "3.3.47",
"mac": "DC:F5:05:25:DE:96",
"cap": {
"eco": 1,
"ota": 1,
"svcConf": 1
}
}
Roomba (Roomba) IP address is: 10.105.20.217
Socket Error: ('The read operation timed out',)
Error getting password, receive 2 bytes. Follow the instructions and try again.

FYI, this is a Roomba 690.

Map resets during mission dock pause

The map seems to reset when the roomba pauses its mission to recharge or empty bin. It would be nice if the map didn't reset if the 'cleaning time' was greater then zero.

For example my i7 cleans for an hour then has to go back to the dock to recharge. It then continues its mission. The cleaning time attribute is correct as it doesn't reset to zero, but the map seems to clear out and start drawing from scratch again. If the cleaning time isn't zero when the roomba starts cleaning again, the map should just continue on.

Connection Error timed out for GetPassword

waiting on port: 5678 for data
supplied address 255.255.255.255 does not match discovered address 192.168.1.110, using discovered address...
supplied address 255.255.255.255 does not match discovered address 192.168.1.90, using discovered address...
found 1 Roomba(s)
Make sure your robot (Roomba) at IP 192.168.1.90 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: {
"sku": "R960040",
"nc": 0,
"ip": "192.168.1.90",
"hostname": "Roomba-3115801850212750",
"ver": "3",
"cap": {
"eco": 1,
"langOta": 1,
"svcConf": 1,
"pp": 1,
"multiPass": 2,
"pose": 1,
"edge": 1,
"maps": 1,
"binFullDetect": 1,
"ota": 2
},
"mac": "74:C6:3B:C6:D8:6F",
"proto": "mqtt",
"sw": "v2.4.6-3",
"robotname": "Roomba"
}
Roomba (Roomba) IP address is: 192.168.1.90
Connection Error timed out
Traceback (most recent call last):
File "getpassword.py", line 39, in
main()
File "getpassword.py", line 34, in main
Password(file=arg.configfile)
File "/etc/scripts/Roomba980-Python/roomba/password.py", line 39, in init
self.get_password()
File "/etc/scripts/Roomba980-Python/roomba/password.py", line 136, in get_password
wrappedSocket.send(packet)
File "/usr/lib/python3.5/ssl.py", line 871, in send
return socket.send(self, data, flags)
socket.timeout: timed out

Map does not contain the full floor

Hi,

If you have a large floor, the mapping will bot be able to fully map the floor. You will see the irobot icon reach the edge of the "image" and disappear.

The final output of the floor shows that it is missing the top portion of the floor (in my case, missing 2 rooms).

It would be nice the mapping to scale, either dynamically, or set it via a variable, so that the entire floor is displayed.

mapf90dw4ls

Not quite working with new Roomba S9

After the latest change to fix the SSL Connection error, everything is nearly (or at least closer to) working with the new Roomba S9. However, when trying to do an initial setup using Python 2.7, I get the below error messages. I also tried to do a roomba.connect() and roomba.send_command("start") with the information that the script retrieved before erroring out, but roomba.master_state stays null and the Roomba does not start.

Received: {
"robotname": "Test,
"sku": "s915020",
"nc": 0,
"ver": "3",
"proto": "mqtt",
"ip": "192.168.1.165",
"hostname": "iRobot-B66559F1D21E445E9C785DA092FFDE6B",
"sw": "soho+3.0.11+soho-release-rt319+13",
"robotid": "B66559F1D21E445E9C785DA092FFDE6B",
"mac": "50:14:79:13:A0:B3",
"cap": {
"pmaps": 1,
"carpetBoost": 1,
"pp": 0,
"pose": 1,
"sched": 1,
"log": 2,
"ota": 2,
"dockComm": 1,
"binFullDetect": 1,
"prov": 3,
"area": 1,
"eco": 1,
"svcConf": 1,
"maps": 3,
"edge": 0,
"team": 1,
"multiPass": 2,
"5ghz": 1
}
}
Roomba (Test) IP address is: 192.168.1.165
blid is: None
Password=> :1:1570151115:8iV7hZGiYIyi6e9q <= Yes, all this string.
Use these credentials in roomba.py
Traceback (most recent call last):
File "/home/cthulu/.local/bin/roomba", line 10, in
sys.exit(main())
File "/home/cthulu/.local/lib/python2.7/site-packages/roomba/main.py", line 482, in main
Password(file=arg.configfile)
File "/home/cthulu/.local/lib/python2.7/site-packages/roomba/password.py", line 34, in init
self.get_password()
File "/home/cthulu/.local/lib/python2.7/site-packages/roomba/password.py", line 174, in get_password
Config.set(addr,'blid', blid)
File "/usr/lib/python2.7/dist-packages/backports/configparser/init.py", line 1236, in set
_, option, value = self._validate_value_types(option=option, value=value)
File "/usr/lib/python2.7/dist-packages/backports/configparser/init.py", line 1223, in _validate_value_types
raise TypeError("option values must be strings")
TypeError: option values must be strings

No handlers could be found for logger "roomba.__main__"

I am getting this error in testing the simple program example with Pyhton 2.7.16 on Debian Buster
No handlers could be found for logger "roomba.main"
Here is the test
from roomba import Roomba

address = "192.168.1.1.."
blid = "my blid"
roombaPassword = "my password"

myroomba = Roomba(address, blid, roombaPassword)

import json, time
for i in range(5):
print json.dumps(myroomba.master_state, indent=2)
time.sleep(1)
myroomba.disconnect()`

Connectionrefused error

[I 2018-12-20 13:25:12,184] *******************
[I 2018-12-20 13:25:12,186] * Program Started *
[I 2018-12-20 13:25:12,186] *******************
[I 2018-12-20 13:25:12,187] Roomba.py Version: 1.2.3
[I 2018-12-20 13:25:12,187] Python Version: 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:40:30) [MSC v.1500 64 bit (AMD64)]
[I 2018-12-20 13:25:12,187] Paho MQTT Version: 1.2.3
[I 2018-12-20 13:25:12,188] CV Version: 3.4.4
[I 2018-12-20 13:25:12,190] PIL Version: 5.3.0
[I 2018-12-20 13:25:12,190] to Exit
[I 2018-12-20 13:25:12,190] Roomba 980 MQTT data Interface
[I 2018-12-20 13:25:12,191] reading info from config file ./config.ini
[I 2018-12-20 13:25:12,191] Creating Roomba object 192.168.88.55
[I 2018-12-20 13:25:12,193] CONTINUOUS connection
[I 2018-12-20 13:25:12,193] connecting Roomba 192.168.88.55
[I 2018-12-20 13:25:12,194] Posting DECODED data
[I 2018-12-20 13:25:12,197] MAP: Maps Enabled
[I 2018-12-20 13:25:12,203] MAP: openening existing map no text image
[W 2018-12-20 13:25:12,204] MAP: map no text image problem: [Errno 2] No such file or directory: u'./Dustin Beiber 2map_notext.png': set to None
[W 2018-12-20 13:25:12,265] error loading font: cannot open resource, loading default font
[I 2018-12-20 13:25:12,279] MAP: home_pos: (400,750)
[I 2018-12-20 13:25:12,289] MAP: Initialisation complete
[I 2018-12-20 13:25:12,290] Connecting Dustin Beiber 2
[I 2018-12-20 13:25:12,292] Setting TLS
[E 2018-12-20 13:25:12,293] Error: global name 'FileNotFoundError' is not defined
Traceback (most recent call last):
File "C:\Python27\Scripts\roomba-script.py", line 9, in
load_entry_point('Roomba980-Python==1.2.3', 'console_scripts', 'roomba')()
File "C:\Users\wayne\Desktop\Roomba980-Python\roomba_main_.py", line 572, in main
myroomba.connect()
File "C:\Users\wayne\Desktop\Roomba980-Python\roomba\roomba.py", line 290, in connect
if not self._connect():
File "C:\Users\wayne\Desktop\Roomba980-Python\roomba\roomba.py", line 320, in _connect
if exc_type == socket.error or exc_type == ConnectionRefusedError:
NameError: global name 'ConnectionRefusedError' is not defined

Having some issues

I tried following the instructions. I got the following error:

C:\Users\Jeremy>pip install https://github.com/NickWaterton/Roomba980-Python.git
Collecting https://github.com/NickWaterton/Roomba980-Python.git
Downloading https://github.com/NickWaterton/Roomba980-Python.git
| 235kB 936kB/s
Cannot unpack file C:\Users\Jeremy\AppData\Local\Temp\pip-sdzhqxv3-unpack\Roomba980-Python.git (downloaded from C:\Users\Jeremy\AppData\Local\Temp\pip-ws0sm3am-build, content-type: text/html; charset=utf-8); cannot detect archive format
Cannot determine archive format of C:\Users\Jeremy\AppData\Local\Temp\pip-ws0sm3am-build

Any idea of what the problem is?

Roomba Map not working properly

I have just set this up to control my Roomba, but the map thing doesn't seem to work properly.

I started it with the command $ roomba -R 10.0.xxx.xxx -u xxxxxxxxxxxxxxxx -w ":1:xxxxxxxxxx:xxxxxxxxxxxxxxxx" -b 10.0.xxx.xxx -p 1884 -U xxx -P xxx --drawmap --mapSize "(800,1500,0,0,0,0)" --roomOutline, and it writes a map.png file and all the HTML files, but that isn't updated.

The tool seems to initialize MAP writing:

[W 2018-12-22 13:21:46,103] html file not found, creating ./roomba_map.html
[I 2018-12-22 13:21:46,103] Posting DECODED data
[I 2018-12-22 13:21:46,103] MAP: Maps Enabled
[I 2018-12-22 13:21:46,103] MAP: Not drawing Room Outline
[I 2018-12-22 13:21:46,106] MAP: openening existing map no text image
[W 2018-12-22 13:21:46,107] MAP: map no text image problem: [Errno 2] No such file or directory: './map_notext.png': set to None
[I 2018-12-22 13:21:46,111] MAP: home_pos: (400,750)
[I 2018-12-22 13:21:46,125] MAP: Initialisation complete

but then, MAP data is only received when the state of the robot changes:

[I 2018-12-22 13:22:11,840] updated state to: Running
[I 2018-12-22 13:22:11,840] MAP: received: new_co_ords: {'x': 0, 'y': 0, 'theta': 180} old_co_ords: {'x': 0, 'y': 0, 'theta': 180} phase: run, state: Running
[I 2018-12-22 13:22:11,840] MAP: old x,y: (400, 750) new x,y: (400, 750) theta: 90 roomba pos: [375, 725, 425, 775]
[I 2018-12-22 13:22:11,841] MAP: drawing roomba: pos: [375, 725, 425, 775], theta: 90
[I 2018-12-22 13:22:11,846] MAP: checking room outline
[I 2018-12-22 13:22:11,851] MAP: perimeter/outline match is: 0.0000
[I 2018-12-22 13:22:11,898] MAP: writing text: pos: (0, 0), text: Running Time: 8m, Bat: 100%

Also, it always contains the 0,0 coordinate so the robot on the map never moves from its start position. Does th iRobot 895 not support continuous position sending?

EDIT: Even with debug mode -D, I don't see map entries in the log file, only when the robot stops or starts, and then only with coordinates 0,0.

Always "ImportError: No module named password"

Hi
i tried to follow the hoe to do now several time on serveral systems. But all of them was debian on a raspberryPI3 Hardware. Maybe someknow the issue or can support me, or maybe a generel failure now?

I tried the pip installtion and as well the git, after executing the script i always getting some errrors connected to a password module.

> python roomba.py`
Traceback (most recent call last):
File "roomba.py", line 25, in <module>
from roomba.password import Password
File "/root/Roomba980-Python/roomba/roomba.py", line 25, in <module>
from roomba.password import Password
ImportError: No module named password
> python getpassword.py
Traceback (most recent call last):
File "getpassword.py", line 12, in <module>
from roomba import Password
File "/root/Roomba980-Python/roomba/roomba.py", line 25, in <module>
from roomba.password import Password
ImportError: No module named password

Had somebody the same issue and fixed it?

Thanks

The handshake operation timed out

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.

Final map draw only happens when roomba docks after mission.

I have multiple floors, so i move my roomba to a new floor by hand and let it run there.

This library follows the state of the run:

[roomba.roomba.Roomba] updated state to: Running
[roomba.roomba.Roomba] updated state to: End Mission
[roomba.roomba.Roomba] updated state to: Stopped

But the problem is that the final map draw is only triggered when the robot docks after a mission, so when i move the robot to the next floor and lets it run there, this library continues to draw on the same old map. I think that the final draw should also be triggered on the state change from End Mission to Stopped.

Error after executing roomba.py

Hi Nick,

i get an error when executing the ./roomba.py the first time:

florian@roomba-service:/Roomba980-Python$ sudo ./roomba.py
libdc1394 error: Failed to initialize libdc1394
[I 2017-06-24 16:45:44,411] *******************
[I 2017-06-24 16:45:44,411] * Program Started *
[I 2017-06-24 16:45:44,412] *******************
Traceback (most recent call last):
File "./roomba.py", line 1598, in
log.info("Paho MQTT Version: %s" % mqtt.VERSION_NUMBER)
AttributeError: 'module' object has no attribute 'VERSION_NUMBER'
florian@roomba-service:/Roomba980-Python$

Do you have any ideas?

Thanks and Best Regards,
Florian

Too verbose logging in INFO level

Home Assistant (HA) is using this library and due to too verbose logging in INFO level the console is full of roombapy logs. Here is related issue in HA.

As I can see in roomba.py, most of log.info can be converted to log.debug, because these logs are not user-friendly and intended for developers.

@pschmitt I see you maintain roombapy package, so this issue is related to your fork too.

Itegration with Home Assistant

Hello, have you ever considered doing this to Home Assistant. If I have the process running, I can't access it from Home Assistant, and vice versa. It would be great to have live maps in Home Assistant and the drawings in the end.

Thank You and great work

DISCUSSION: Rename this project

Hi,

since this library should work with any of the Wi-Fi enabled Roombas (980, 960, 890, 690) - except the mapping feature for the 890 and 690 - wouldn't it make sense to rename to something more general like roombapy or wroomba before releasing it to Pypi (ping for #3 o:))?

Errno 32 and 111

I have 3 Roombas (S9+, Braava Jet M6, and a wifi connected one that doesn't do mapping). This is the output I get when I start the program on Ubuntu. I've also tried this on Windows.

[I 2019-11-17 23:25:30,487] * Program Started *
[I 2019-11-17 23:25:30,487] *******************
[I 2019-11-17 23:25:30,487] Roomba.py Version: 1.2.1
[I 2019-11-17 23:25:30,487] Python Version: 2.7.15+ (default, Oct  7 2019, 17:39:04) [GCC 7.4.0]
[I 2019-11-17 23:25:30,487] Paho MQTT Version: 1.5.0
[I 2019-11-17 23:25:30,487] CV Version: 4.1.1
[I 2019-11-17 23:25:30,487] PIL Version: 6.2.1
[I 2019-11-17 23:25:30,487] <CNTRL C> to Exit
[I 2019-11-17 23:25:30,488] Roomba 980 MQTT data Interface
[I 2019-11-17 23:25:30,488] reading info from config file ./config.ini
[W 2019-11-17 23:25:30,488] No roomba or config file defined, I will attempt to discover Roombas, please put the Roomba on the dock and follow the instructions:
[I 2019-11-17 23:25:30,488] Using Password version 1.2.2
waiting on port: 5678 for data
[W 2019-11-17 23:25:30,576] supplied address 255.255.255.255 does not match discovered address 10.84.3.42, using discovered address...
[W 2019-11-17 23:25:30,576] supplied address 255.255.255.255 does not match discovered address 10.84.3.196, using discovered address...
found 2 Roomba(s)
Make sure your robot (Lower Roomba) at IP 10.84.3.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": "Lower Roomba",
  "sku": "R960020",
  "nc": 1,
  "ver": "3",
  "proto": "mqtt",
  "ip": "10.84.3.42",
  "hostname": "Roomba-3108871C81807750",
  "sw": "v2.4.6-3",
  "mac": "74:C6:3B:3F:7E:20",
  "cap": {
    "pp": 1,
    "multiPass": 2,
    "binFullDetect": 1,
    "ota": 2,
    "maps": 1,
    "pose": 1,
    "eco": 1,
    "langOta": 1,
    "edge": 1,
    "svcConf": 1
  }
}
Roomba (Lower Roomba) IP address is: 10.84.3.42
Connection Error [Errno 111] Connection refused
Traceback (most recent call last):
  File "/usr/local/bin/roomba", line 11, in <module>
    load_entry_point('Roomba980-Python==1.2.3', 'console_scripts', 'roomba')()
  File "/usr/local/lib/python2.7/dist-packages/roomba/__main__.py", line 482, in main
    Password(file=arg.configfile)
  File "/usr/local/lib/python2.7/dist-packages/roomba/password.py", line 34, in __init__
    self.get_password()
  File "/usr/local/lib/python2.7/dist-packages/roomba/password.py", line 131, in get_password
    wrappedSocket.send(packet)
  File "/usr/lib/python2.7/ssl.py", line 725, in send
    v = self._sslobj.write(data)
socket.error: [Errno 32] Broken pipe

Tested with Roomba 691 - works

Just wanted to report that I tested it with my Roomba 691 and it works.

  1. Downloaded and installed the python module via pip.
  2. Ran roomba to get the ip + credentials.
  3. Used the credentials to configure the Home Assistant component.
  4. Succesfully started the robot and sent it home.

OpenHab + Roomba not listening to commands

Hello, this is more like the question than a bug, but honestly, I don´t know where to post it elsewhere. I am interested in connecting my Roomba 960 with OpenHab instance. I´ve downloaded your script and successfully initialized it. So when I run "roomba" it connects to my Roomba and provides me with some feedback about configuration, and that wifi is on and Roomba is in dock etc. But when I try to send a command to my Roomba, either by roomba -C "start" or by trying your simple Python script example, nothing happens.

Secondly, I cannot figure out, how to set up OpenHab to support Roomba. Particularly, how to set up a connection to the MQTT broker. Right now, in my mqtt.cfg I have:

proliant.url=ssl://10.10.64.127:8883 // Roomba IP
proliant.clientId=3165010C82110820
proliant.user=3165010C82110820
proliant.pwd=:1:1539180234:X5DYZpWd7DPcGFvB

but OpenHab fails to connect to the Roomba. Could you please provide me with an example of mqtt.cfg? I was unable to find it in your GIT store.

Thanks in advance.
George

CentOS: wrong default certificate file, unclear error message

Hi.

I have a CentOS 7 system.
When running roomba it fails with:

    [I 2018-06-12 21:00:26,612] Seting TLS
    [E 2018-06-12 21:00:26,614] Error: [Errno 2] No such file or directory 
    Traceback (most recent call last):
      File "/home/zvika/miniconda2/envs/roomba/bin/roomba", line 11, in <module>
        sys.exit(main())
      File "/home/zvika/miniconda2/envs/roomba/lib/python2.7/site-packages/roomba/__main__.py", line 572, in main
        myroomba.connect()
      File "/home/zvika/miniconda2/envs/roomba/lib/python2.7/site-packages/roomba/roomba.py", line 286, in connect
        if not self._connect():
      File "/home/zvika/miniconda2/envs/roomba/lib/python2.7/site-packages/roomba/roomba.py", line 316, in _connect
        if exc_type == socket.error or exc_type == ConnectionRefusedError:
    NameError: global name 'ConnectionRefusedError' is not defined

Which is not a very clear error message...
I recommend giving a better error message here, that will explain the real problem.

After debugging it, I found that the problem was due to self.cert_name having a default value of "/etc/ssl/certs/ca-certificates.crt" which is probably good for Debian/Ubuntu distros, but in CentOS (and maybe other distros) that file doesn't exist.

I wasn't sure what's the correct value, but simple find gave me the files:

/etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt
/etc/pki/ca-trust/source/ca-bundle.legacy.crt

The first one sounded better, so I run the command:

roomba --cert /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt

Which indeed worked well.

Therefore, I recommend changing :

    if not cert_name:
        self.cert_name = "/etc/ssl/certs/ca-certificates.crt"
    else:
        self.cert_name = cert_name

To code that will check if that path exists, and if not, will check if the path I supplied exists, and if not - fail there with an error message recommending using --cert flag, and request to open an issue describing the new path, for the benefit of future users of that distro.

Thanks!

movie generation - feature request

In addition to creating png files that we can watch in real time, it would be nice if you captured the files in directory with sequential numbers so we can watch them as a movie later.

Connection issue

I have been using rest980 and dorita980 with no issues. I wanted to switch to a Python based solution and I am having an issues with connecting to my 980.

The getpassword.py script worked fine and a config.ini created with the correct blid, password and ip options. When executing roomba.py (with no command line params) I get the following error. As I mentioned I am able to connect fine with rest980 and the blid and password are correct. I am using Python 2.7.12 (tried with Python3 but got a different error) and my 980 is running firmware v2.2.9-1.

CV or numpy module not found, falling back to PIL
[I 2017-07-01 13:14:50,674] *******************
[I 2017-07-01 13:14:50,674] * Program Started *
[I 2017-07-01 13:14:50,674] *******************
[I 2017-07-01 13:14:50,675] Paho MQTT Version: 1.1
[I 2017-07-01 13:14:50,675] to Exit
[I 2017-07-01 13:14:50,675] Roomba 980 MQTT data Interface
[I 2017-07-01 13:14:50,676] reading info from config file ./config.ini
[I 2017-07-01 13:14:50,677] Creating Roomba object 10.0.1.143
[I 2017-07-01 13:14:50,677] CONTINUOUS connection
[I 2017-07-01 13:14:50,678] connecting Roomba 10.0.1.143
[I 2017-07-01 13:14:50,678] Posting DECODED data
WARNING: PIL version is 3.1.2, this is not the latest! you can get bad memory leaks with old versions of PIL
run: 'pip install --upgrade pillow' to fix this
[I 2017-07-01 13:14:50,678] MAP: Maps Enabled
[I 2017-07-01 13:14:50,679] MAP: openening existing line image
[W 2017-07-01 13:14:50,684] MAP: line image problem: [Errno 2] No such file or directory: u'.//Dustylines.png': created new image
[I 2017-07-01 13:14:50,684] MAP: openening existing problems image
[W 2017-07-01 13:14:50,689] MAP: problems image problem: [Errno 2] No such file or directory: u'.//Dustyproblems.png': created new image
[I 2017-07-01 13:14:50,689] MAP: openening existing map no text image
[W 2017-07-01 13:14:50,690] MAP: map no text image problem: [Errno 2] No such file or directory: u'.//Dustymap_notext.png': set to None
[I 2017-07-01 13:14:50,694] MAP: home_pos: (400,750)
[I 2017-07-01 13:14:50,747] MAP: Initialisation complete
[I 2017-07-01 13:14:50,747] Connecting Dusty
[I 2017-07-01 13:14:52,834] Roomba Data: {}
[I 2017-07-01 13:14:52,951] Roomba Connected Dusty
[E 2017-07-01 13:14:52,952] Roomba Connected with result code 1
[E 2017-07-01 13:14:52,953] Please make sure your blid and password are correct Dusty
[I 2017-07-01 13:14:57,840] Roomba Data: {}

NO module named password

Hi Nick,

Thanks for the great work here. You have an idea on why I might be getting the below error? Im trying to just get the bld and pw for the roomba. I cloned the repo and when i run python roomba.py I get the below..

Traceback (most recent call last):
File "roomba.py", line 25, in
from roomba.password import Password
File "/home/pi/roomba_pw/Roomba980-Python/roomba/roomba.py", line 25, in
from roomba.password import Password
ImportError: No module named password

Raise an Exception on connection error

Hi

would it possible to have an exception thrown when the provided credentials are wrong? Right now users of the library are not able to aptly detect whether the connection has been established correctly, other than by looking at the logger output.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.