Error connecting to ddwrt: Am I doing something dumb here?

Hi all,

Having some hassle setting up my router at the mo.
Home Assistant: 0.30.2
DD-WRT v3.0-r30700M kongac Release: 09/27/16

I have HA installed on Ubuntu 16.04 on an Intel NUC. It is wired back to my switch, which is in turn wired to the router. Dumb question time, will HA try use the wireless interface (disabled) on the NUC rather than the wired?

SSH is enabled on the router, telnet disabled. I have the id_rsa.pub from the NUC on the router and the username and password work via the web gui for the router.

My config in configuration.yml is as follows:

   device_tracker:
  - platform: ddwrt
    host: 192.168.xx.xx
    username: user
    password: pass
    track_new_devices: yes
    interval_seconds: 10
    consider_home: 180

Log file as follows:

16-10-13 22:10:13 homeassistant.components.device_tracker: Error setting up platform ddwrt
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connection.py", line 142, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
  File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/util/connection.py", line 98, in create_connection
raise err
  File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/util/connection.py", line 88, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connectionpool.py", line 595, in urlopen
chunked=chunked)
  File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connectionpool.py", line 363, in _make_request
conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.5/http/client.py", line 1106, in request
self._send_request(method, url, body, headers)
  File "/usr/lib/python3.5/http/client.py", line 1151, in _send_request
self.endheaders(body)
  File "/usr/lib/python3.5/http/client.py", line 1102, in endheaders
self._send_output(message_body)
  File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
  File "/usr/lib/python3.5/http/client.py", line 877, in send
self.connect()
  File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connection.py", line 167, in connect
conn = self._new_conn()
  File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connection.py", line 151, in _new_conn
self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0x7f16a808b048>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 423, in send
timeout=timeout
  File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connectionpool.py", line 640, in urlopen
_stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/util/retry.py", line 287, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.33.1', port=80): Max retries exceeded with url: /Status_Wireless.live.asp (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f16a808b048>: Failed to establish a new connection: [Errno 111] Connection refused',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/device_tracker/__init__.py", line 139, in setup_platform
scanner = platform.get_scanner(hass, {DOMAIN: p_config})
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/device_tracker/ddwrt.py", line 38, in get_scanner
scanner = DdWrtDeviceScanner(config[DOMAIN])
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/device_tracker/ddwrt.py", line 61, in __init__
data = self.get_ddwrt_data(url)
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/device_tracker/ddwrt.py", line 146, in get_ddwrt_data
timeout=4)
  File "/usr/local/lib/python3.5/dist-packages/requests/api.py", line 70, in get
return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/requests/api.py", line 56, in requestPreformatted text
return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 596, in send
r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 487, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.33.1', port=80): Max retries exceeded with url: /Status_Wireless.live.asp (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f16a808b048>: Failed to establish a new connection: [Errno 111] Connection refused',))

Any assistance appreciated!
Ronan

Your router is refusing connections on port 80, at least on the interface that your NUC is attached to:

ConnectionRefusedError: [Errno 111] Connection refused

requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.33.1', port=80): Max retries exceeded with url: /Status_Wireless.live.asp (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f16a808b048>: Failed to establish a new connection: [Errno 111] Connection refused',))

Try “nmap 192.168.33.1 -p 80” from the NUC to test if the port is open.
Unless you get this:

PORT   STATE SERVICE
80/tcp open  http

you need to figure out why your router does not accept connections.

Sebastian

1 Like

Cheers Sebastian,

I don’t recall explicitly disabling access over http, unless it happened when I enabled https. I’d normally just ssh to the router rather than use the gui.
Stepping back a bit, if I’d just read the error message in it’s entirety there would have been no need for the post. So looks like I was doing something dumb after all, just not the dumb thing I thought I was.

In the end I set up Owntracks and have an MQTT broker running on the box. So that’s presence sorted.

Thanks once more.
R.