Homeyduino behind a (NAT) repeater

Hallo Homey enthusiasts.
I created a Homeyduino esp-based device controlling window shutters. Pairing them was no issue. Now I added a unit that is connecting via an esp-based repeater. I added a static route in my router to the net behind the repeater. Then I can ping to the unit. But it cannot be paired: unknown error. Also adding de IP manually in the pairing tool does have no effect.
I tried to test the port access, but all blocked. It seems a network issue as other devices behind the repeater behave the same. I added a port forward (46639) in the repeater but no result.
Is there any network specialist who can help me? Thanks!!

I assume that you’re using https://github.com/martin-ger/esp_wifi_repeater ?

Did you add a port forward for both UDP and TCP? Also, I assume that you’re trying to access the device from the “external” IP-address of the repeater (the IP-address that the repeater gets from your regular router)? You should be able to access the Homeyduino device through a regular HTTP request on port 46639. EDIT: also, for persistent portmapping, read this.

I’m not sure what you mean by “added a static route in my router to the net behind the repeater”, because I don’t think (although I could be mistaken) that the repeater will act as a gateway from the “outside”.

The documentation shows that the repeater will act as a gateway for the devices behind it.

Thanks Robert. Yes, the one from Martin Ger. I carefully (tried to) read his documentation. In my router I added this route:
Routing Than I was able to ping from and to everywhere.
I defined a port forward for UDP and then for TCP. portmap
I assume both are applied for the port than. I will check the http (just entering ip in my browser is ok?) Only the repeater itself is visible (on it’s own local ip)
onbereikbaar

If you’re using port mapping, you shouldn’t need a static route.

If the repeater has IP-address 10.14.162.124 in your local network, and you’re using that port mapping, you should be able to reach the Homeyduino device via http://10.14.162.124:46639/ (i.e. via the IP-address of the repeater).

1 Like

Yes, I am getting the json string back now! So it is not possible to have more than one homeydiono behind a repeater?
In de pairing tool the unit is still not visible. When entering the (repeater) ip manually, I get a time-out. Note that without port fw (no json reply) the pairing reacts almost immediately with “unknown error”. So the pairing is getting somewhere, but not to the end.

I don’t know if the app will allow using a different port than 46639 when manually configuring a device. If not, I don’t think it’ll be possible to support more than one Homeyduino device behind a single repeater.

I would imagine that the time out is caused by UDP access, because TCP access already works as you have tested. I don’t know how to solve that.

Alternatively, you could revert back to using a static route, but perhaps that won’t work together well with the port mapping. You wrote that after adding the route, you were able to ping from and to everywhere; does that mean that you were able to ping the Homeyduino IP address (10.24.1.3) from your local netwerk (10.24.XXX.YYY)?

Thanks. And no, the Homeyduino app only allows entering an IP, not a port. But so far I will use only one unit behind the repeater, so no issue (yet).

As a newbee in network aspects I thought, thanks to your help, I started to understand what static routing and port forwarding does and what not. So I agreed with you that the static routing I added in the router was not needed when a port forward is active in the esp. So I removed the route. But look, no port is found anymore. How is that possible? I need to carefully redo the tests, I think.

It seems that the pairing does not work when the unit is behind the repeater. However a funny thing with Homeydoino is that it’s IP can be changed after pairing. So I can do the pairing in the local network (Homeyduino will find the triggers and actions) and than I change the IP to the network behind the router. At least, that is what I will try.

I have to pause testing and updating this thing, but will come back on it later. Thanks so far.

Although it is possible to change name and the IP-address of a unit after pairing, it seemed not possible to me to use a unit properly without a pairing with the device itself. So pairing with the device connected to the net behind the NAT-repeater is a need. Finally a managed that.
Situation changed to:

  • No static route in the router.
  • Port 46639 (used by the pairing routine) mapped in the NAT-repeater (using portmap add [TCP|UDP] external_port internal_ip internal_port ). Note that internal_ip is the IP of the Homeyduino. I created a portmap for both UDP and TCP (I don’t know if that is really needed).
  • A second port is used as well. The portnumber is given by the Homeyduino to the Homey in the JSON document (that can be called with repeater_IP:46639 in a browser). Also this port forward is defined for UDP and TCP.

Now a successful pairing can be performed. After sending all trigger action once, flows can be created to listen to and to activate the Homeyduino.

1 Like