Connecting to router - Telnet

Hi,

I need help (again :wink: )

I have a Technicolor TG799vac Xtream router and I am trying to connect to it to use it as a device tracker.

I have the following in my configuration.yaml:

device_tracker:
  - platform: thomson
    host: 192.168.1.1
    username: !secret router_username
    password: !secret router_password

I get the following error message:

Connection refused by router. Telnet enabled?
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/device_tracker/thomson.py”, line 93, in get_thomson_data
telnet = telnetlib.Telnet(self.host)
File “/usr/local/lib/python3.6/telnetlib.py”, line 218, in init
self.open(host, port, timeout)
File “/usr/local/lib/python3.6/telnetlib.py”, line 234, in open
self.sock = socket.create_connection((host, port), timeout)
File “/usr/local/lib/python3.6/socket.py”, line 724, in create_connection
raise err
File “/usr/local/lib/python3.6/socket.py”, line 713, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

As a technical noob I do not know whether Telnet should be set up in HA och on my router. Checked the router for any Telnet settings and found none.

An help appreciated!!!

Sounds like you need to turn on telnet on your router. See the manual.

Sadly, I have reviewed the manual and there is no reference to Telnet.

Perhaps your model doesn’t support telnet? Some googling reveals a lot of discussion over hacking and alternative firmwares.

What ports are open on the router? Nmap is your friend.

Thanks. Yes, I routed the problem by turning to Nmap.

Sorry to reopen this. Facing the exact same issue with a DGA0122. Can you elaborate a bit on the Nmap solution please?

nmap is a tool to explore what ports are open on a host. Example

nmap -p0-65535 host

I really cannot find anything about enabling Telnet on my Thomson. And do not understand how Nmap relates to it.
I set up a port forwarding rule from port 23 to 23 (which is labelled Telnet) but that didn’t do the trick. Can you help?

nmap will tell you if the telnet port is open.

Maybe your router doesn’t have a telnet option.

This is what I did but it doesn’t seem to work. :S

That is wrong in so many ways.

You better hope telnet is not running on your router, because it is very insecure. Telnet is very old fashioned and, well, insecure. You have opened an insecure service to the world at large.

But even if you are crazy enough to want to run telnet over the internet, simply opening the port does not start telnet. It allows someone out there to access telnet on your router if telnet is already running.

Remove that port forward.

Then tell us this: what makes you think your router even has telnet capabilities.

Ok, I removed it.

I assumed it was standard, and since HA was asking for it, that it was a matter of enabling it.
And then, since I also saw the port existed in the port forwarding and it was labelled Telnet, I guessed it had that capability too.

I just want to use the router as device_tracker.

Then look at it’s manual!

Have you run nmap as suggested?

Here it is. Not sure how that helps.

Tbh, there’s absolutely no manual in Google I can see. Only a quick start guide that’s not useful.
And this: All Topics • DGA0122 Wi-Fi Router • Simulator • Help & Support • SSE which doesn’t seem useful either.

Using NMAP doesn’t require to do anything on the router, that’s why it’s a good fallback:

See the Home Assistant documentation here.

Oh damn! I didn’t even know there were alternative integrations as device_trackers! Perfect, thanks. I have set up Nmap now and it detected the new entities. Now I’m struggling a bit how to use Nmap as device_tracker, since the documentation uses a router as example.

Go to Settings > Devices & Services > Integrations.

Find the Nmap integration, click on ‘x entties’ to see what you have (I have 5 in total).

Untitled

There you can click on a tracked device, and on the ‘Settings’ tab of the pop-up you can change the names to something you would recognise e.g “Chaos Control Phone Nmap” (assuming it’s a phone you are tracking). I would also change the entity_id at this point e.g. device_tracker.chaos_control_phone_nmap.

Now go to Settings > People. Click on the person which you want to connect the device to. A pop-up should appear with a dropdown ‘Pick device to track’. Select your Nmap device.

1 Like

Thank you very much! I just figured it on my own, but it was just what you said. Just did it. It turns out it was much easier than the device_tracker route in the yaml.

Tiny question. Why is it that Nmap recognizes some things as devices and others as entities? For example, my router and my smart heating system are detected as devices. However my phones and laptops don’t, they only get an entity. I thought it would be because devices are connected through another integration (they are), but then my phone also is integrated through the app and still not recognized as device.

Many thanks.

1 Like

Sorry, can’t help you there. I’m only seeing entities for the Nmap integration

1 Like

As I said it tells you that port 23 is not open, and therefore telnet is not running.