Problem accessing PI from external network

Hi, I’ve recently come to HASS (and home automation in general) I’m trying to setup access from external network but running into problems. I’m running Hassbian on a Pi3

I’ve forwarded port 8123 on my router to the Pi’s IP

when I try to access my public IP, “118.149.XXX.XXX:8123”, I just get a cannot connect page. I have tired both on and off the local network (i.e. cellphone)

When I use a site like http://canyouseeme.org/ it says the port is open. When I try Telnet to that port it just sits there and neither fails nor connects.

Does anyone know what else I could do to try and solve this problem, any help would be appreciated. Thanks :slight_smile:

Not sure if this makes a difference but on my FiOS router I had to forward both TCP and UDP protocols.

Also, if you are exposing this to the outside world you should really read this first:

2 Likes

Hey, thanks for the suggestion, I’ve tried TCP/UDP and just TCP being forwarded with no difference :frowning:

Yeah read that and a few other guides, the plan was to LetsEncrypt/DDNS and all that but so far stuck at the first step.

******I’ve just gone though the complete process and no luck (at least I have a secure local connection to HA lol), I can access HA using https/local IP but not through duckdns/publicIP etc

I’ve never had any trouble port forwarding on this router before so that makes me think maybe its something more to do with the Pi itself causing the problem…

To make sure it is really at the low network level where the problem is happening, you could do the folowing:

  • Stop HASS (to free the port 8123)
  • Run the command nc -l 8123 on the HASS machine
  • Use telnet or another machine that has natcat installed and connect to the HASS machine unsing the command telnet yourpublicip 8123 or nc yourpublicip 8123.

When a connection is successfully established, you can type any text at any side and it will appear on the boths side, looking a bit like a chat.
If this doesn’t work as well you can at least be 100% sure it’s not related to HASS or SSL, but instead it’s either the port forwarding that’s not working for some reason, or there might be some firewall that’s blocking the connection.

From what you describe it actually sound like the port forwarding is either pointing at a host that is not online or has connections dropped by a firewall.

1 Like

Also possible if the Pi hasn’t been assigned a static IP and has renewed it’s lease.

Let’s start with the simple stuff first:

First : confirm that the pi has an IP address of 192.168.1.80.
Second: Can you access 192.168.1.80:8123 from a computer (not the pi) inside your network?
If not, it’s likely that HASS is only listening on 127.0.0.1. or is not listening on 8123.
To fix any of that, you would use the HTTP component.

Hey guys thanks for the responses :slight_smile:

Pi has static IP set.

I can access it from a PC on the local network no trouble at 192.168.1.80:8123

When I follow danielperna84’s instructions I get a connect failed error.

I think I will try resetting my router and setting it up from scratch to make sure its nothing weird that’s happened in there.

Hi guys just checking in again.

I tried a new router and it worked perfect first time. The old router I was using was a Netcomm nb6plus4wn. I’m 100% sure that the port forwarding was done correctly and that all firewalls were off so there must be something in there that’s not playing nice with the Pi.

I’ll relegate the old one to a wifi extender and continue with the new one.

Thanks for all the help and suggestions though :smiley:

1 Like