Roomba980-Python icon indicating copy to clipboard operation
Roomba980-Python copied to clipboard

Errno 32 and 111

Open nellering opened this issue 4 years ago • 3 comments

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

nellering avatar Nov 18 '19 05:11 nellering

You have a very old version, the latest version of Password is 1.2.6. (yours Using Password version 1.2.2)

Also, make sure you have no other connection to the Roomba at all (ie the app), Roomba only allows one MQTT connection at a time.

NickWaterton avatar Nov 18 '19 17:11 NickWaterton

I'm getting the same error. Not sure what the relationship is between MQTT and the app, but I force closed the app on my phone and I still get the error.

pi@pi1:~$ roomba
CV or numpy module not found, falling back to PIL
CV or numpy module not found, falling back to PIL
[I 2019-12-21 15:00:47,333] *******************
[I 2019-12-21 15:00:47,336] * Program Started *
[I 2019-12-21 15:00:47,337] *******************
[I 2019-12-21 15:00:47,338] Roomba.py Version: 1.2.6
[I 2019-12-21 15:00:47,340] Python Version: 3.7.3 (default, Apr  3 2019, 05:39:12) [GCC 8.2.0]
[I 2019-12-21 15:00:47,341] Paho MQTT Version: 1.5.0
[I 2019-12-21 15:00:47,342] PIL Version: 5.4.1
[I 2019-12-21 15:00:47,344] <CNTRL C> to Exit
[I 2019-12-21 15:00:47,345] Roomba 980 MQTT data Interface
[I 2019-12-21 15:00:47,348] reading info from config file ./config.ini
[W 2019-12-21 15:00:47,350] 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-12-21 15:00:47,351] Using Password version 1.2.6
waiting on port: 5678 for data
[W 2019-12-21 15:00:47,354] supplied address 255.255.255.255 does not match discovered address 192.168.1.21, using discovered address...
[W 2019-12-21 15:00:47,464] supplied address 255.255.255.255 does not match discovered address 192.168.1.172, using discovered address...
found 1 Roomba(s)
Make sure your robot (US-Roomba) at IP 192.168.1.172 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-...",
  "robotname": "US-Roomba",
  "ip": "192.168.1.172",
  "mac": "...",
  "sw": "3.3.47",
  "sku": "R677020",
  "nc": 1,
  "proto": "mqtt",
  "cap": {
    "ota": 1,
    "eco": 1,
    "svcConf": 1
  }
}
Roomba (US-Roomba) IP address is: 192.168.1.172
Connection Error [Errno 111] Connection refused
Traceback (most recent call last):
  File "/home/pi/.local/bin/roomba", line 10, in <module>
    sys.exit(main())
  File "/home/pi/.local/lib/python3.7/site-packages/roomba/__main__.py", line 485, in main
    Password(file=arg.configfile)
  File "/home/pi/.local/lib/python3.7/site-packages/roomba/password.py", line 41, in __init__
    self.get_password()
  File "/home/pi/.local/lib/python3.7/site-packages/roomba/password.py", line 138, in get_password
    wrappedSocket.send(packet)
  File "/usr/lib/python3.7/ssl.py", line 986, in send
    return super().send(data, flags)
BrokenPipeError: [Errno 32] Broken pipe

giwleb avatar Dec 21 '19 20:12 giwleb

The relationship between MQTT and the app is that the app will try to connect to the Roomba locally via MQTT to control it. If it can't connect via MQTT, it falls back to using a remote connection via AWS - you can tell it's done this because the app displays a "globe" icon in the top right corner.

The Roomba only allows one connection via MQTT. Once the Roomba believes that an MQTT connection has been established, it refuses all other connections.

If you run Roomba980-Python in this case, you get the:

Connection Error [Errno 111] Connection refused

Message.

Even if the app is closed, the Roomba may still believe that the MQTT connection is present. You may have to reset the Roomba, and reconnect WiFi. Hopefully this will clear the MQTT connection.

Once Roomba980-Python successfully connects, you can then connect via the app, and you should get the "globe" icon to show it's connected remotely.

NickWaterton avatar Dec 23 '19 16:12 NickWaterton