home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.6k stars 29.92k forks source link

asuswrt - Connection refused or no route to host - 0.27.0-DEV #2978

Closed frelev closed 8 years ago

frelev commented 8 years ago

Make sure you are running the latest version of Home Assistant before reporting an issue.

You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:

Home Assistant release (hass --version): 0.27.0-DEV

Python release (python3 --version):

Component/platform: device tracker

Description of problem: 16-08-25 19:17:18 homeassistant.components.device_tracker.asuswrt: Connection refused or no route to host

Expected: HASS to login

Connection to router is working using Putty both with SSH and telnet.

Router: ASUSWRT-Merlin RT-AC87U 380.61-0

device_tracker:
  - platform: asuswrt
    host: 192.168.1.1
    username: admin
    password: 12345
pancho-villa commented 8 years ago

I see the same log entry when I first start it up, but no errors after that. In the rest of the log it appears it's working fine for me. I'm on version 0.26.3

frelev commented 8 years ago

I have it only at startup too but why? Should there be some delay?

kerber commented 8 years ago

I'm running 0.27.1 with an RT-N66u and am still having this issue.

kellerza commented 8 years ago

I don't see it on my RT-AC66U with Merlin FW

If you don't mind testing, can you change line 181-182 in asuswrt.py to:

        except exceptions.EOF as err:
            _LOGGER.error('Connection refused or no route to host: %s', str(err))

It won't fix it but will show more information

kerber commented 8 years ago

No problem at all! I'm using the stock firmware on my RT-N66U

16-09-03 12:01:24 homeassistant.components.device_tracker.asuswrt: Checking ARP
16-09-03 12:01:24 homeassistant.components.device_tracker.asuswrt: Connection refused or no route to host: End Of File (EOF). Exception style platform.
<pexpect.pxssh.pxssh object at 0x7f54b465db70>
command: /usr/bin/ssh
args: ['/usr/bin/ssh', '-q', '-l', 'admin', '192.168.1.1']
searcher: None
buffer (last 100 chars): b''
before (last 100 chars): b''
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: None
flag_eof: True
pid: 12729
child_fd: 16
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
kellerza commented 8 years ago

If it persists & it started after you upgraded your Merlin FW then it is most likely a known host issue.

Test using the HASS user account: Does /usr/bin/ssh -l admin 192.168.1.1 complain?

To fix known hosts you can remove a line from ~/.ssh/known_hosts or /home/hass/.ssh/known_hosts

kellerza commented 8 years ago

But with stock FW its probably not known hosts. It could also have started after you swapped routers?

kerber commented 8 years ago

After testing, it looks like my issue was the changing of the default of the component from telnet to ssh. As soon as I changed it to 'protocol: telnet', it started working.

kellerza commented 8 years ago

Glad one is fixed :+1:

hass --script check_config --info device_tracker will show you what the device tracker config loads (with defaults filled in)