# Homeyduino behind a (NAT) repeater

**URL:** <https://community.homey.app/t/homeyduino-behind-a-nat-repeater/18091>\
**Category:** Devices\
**Created:** [September 13, 2019, 4:34pm UTC](https://community.homey.app/t/homeyduino-behind-a-nat-repeater/18091 "2019-09-13T16:34:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jan\_Pathuis](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jan_pathuis/32/15546_2.png) [@Jan\_Pathuis](https://community.homey.app/u/Jan_Pathuis)\
**Post date:** [September 13, 2019, 4:34pm UTC](https://community.homey.app/t/homeyduino-behind-a-nat-repeater/18091/1 "2019-09-13T16:34:46Z")

</div>

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!!

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [September 13, 2019, 5:39pm UTC](https://community.homey.app/t/homeyduino-behind-a-nat-repeater/18091/2 "2019-09-13T17:39:50Z")

</div>

I assume that you’re using [https://github.com/martin-ger/esp\_wifi\_repeater](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](https://github.com/martin-ger/esp_wifi_repeater#port-mapping).

~~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](https://github.com/martin-ger/esp_wifi_repeater#static-routes) shows that the repeater will act as a gateway for the devices behind it.

---

<div class="post-metadata">

**Author:** ![Jan\_Pathuis](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jan_pathuis/32/15546_2.png) [@Jan\_Pathuis](https://community.homey.app/u/Jan_Pathuis)\
**Post date:** [September 13, 2019, 7:37pm UTC](https://community.homey.app/t/homeyduino-behind-a-nat-repeater/18091/3 "2019-09-13T19:37:00Z")

</div>

Thanks Robert. Yes, the one from Martin Ger. I carefully (tried to) read his documentation. In my router I added this route:  
 ![Routing](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/5/553ff0b3adefb60a890ed753d94f76799143bc9e.jpeg) Than I was able to ping from and to everywhere.  
I defined a port forward for UDP and then for TCP. ![portmap](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/b/b81f07f28adee52abf9458dbffad693d1251ba5d.jpeg)  
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](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/2/235514472a48dd13047dcad37a58603ffac9e8aa.jpeg)

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [September 14, 2019, 8:01am UTC](https://community.homey.app/t/homeyduino-behind-a-nat-repeater/18091/4 "2019-09-14T08:01:38Z")

</div>

> [@Jan\_Pathuis](#):
>
> Only the repeater itself is visible (on it’s own local ip)

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/](http://10.14.162.124:46639/) (i.e. via the IP-address of the repeater).

---

<div class="post-metadata">

**Author:** ![Jan\_Pathuis](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jan_pathuis/32/15546_2.png) [@Jan\_Pathuis](https://community.homey.app/u/Jan_Pathuis)\
**Post date:** [September 14, 2019, 1:29pm UTC](https://community.homey.app/t/homeyduino-behind-a-nat-repeater/18091/5 "2019-09-14T13:29:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [September 14, 2019, 1:44pm UTC](https://community.homey.app/t/homeyduino-behind-a-nat-repeater/18091/6 "2019-09-14T13:44:33Z")

</div>

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)?

---

<div class="post-metadata">

**Author:** ![Jan\_Pathuis](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jan_pathuis/32/15546_2.png) [@Jan\_Pathuis](https://community.homey.app/u/Jan_Pathuis)\
**Post date:** [September 16, 2019, 7:18pm UTC](https://community.homey.app/t/homeyduino-behind-a-nat-repeater/18091/7 "2019-09-16T19:18:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jan\_Pathuis](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jan_pathuis/32/15546_2.png) [@Jan\_Pathuis](https://community.homey.app/u/Jan_Pathuis)\
**Post date:** [October 30, 2019, 9:05pm UTC](https://community.homey.app/t/homeyduino-behind-a-nat-repeater/18091/8 "2019-10-30T21:05:25Z")

</div>

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.
