# Homey App listening to a port: EADDRNOTAVAIL

**URL:** https://community.homey.app/t/homey-app-listening-to-a-port-eaddrnotavail/106048
**Category:** Developers
**Created:** [March 11, 2024, 1:46pm UTC](https://community.homey.app/t/homey-app-listening-to-a-port-eaddrnotavail/106048 "2024-03-11T13:46:06Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Ralf\_Peters](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ralf_peters/32/80106_2.png) [@Ralf\_Peters](https://community.homey.app/u/Ralf_Peters)
#### Post date: [March 11, 2024, 1:46pm UTC](https://community.homey.app/t/homey-app-listening-to-a-port-eaddrnotavail/106048/1 "2024-03-11T13:46:06Z")

</div>

I get an error ‘EADDRNOTAVAIL’ when I try to listen to a port on homey. I tried all addresses of homey (ip4,ip6), but ended up always with the same result.

error message:------------------------------------------------------------------------------------------------------------------------------ Error: listen EADDRNOTAVAIL: address not available 10.0.0.111:1025 at Server.setupListenHandle [as \_listen2] (node:net:1446:21) at listenInCluster (node:net:1511:12) at doListen (node:net:1660:7) at processTicksAndRejections (node:internal/process/task\_queues:84:21) Emitted ‘error’ event on Server instance at: at emitErrorNT (node:net:1490:8)  
at processTicksAndRejections (node:internal/process/task\_queues:83:21) {  
**code: ‘EADDRNOTAVAIL’, errno: -99, syscall: ‘listen’, address: ‘10.0.0.111’, port: 1025}**  
coding: ---------------------------------------------------------------------------------------------------------------------------------------  
const Homey = require(‘homey’);  
const net = require(‘node:net’);

// installation of a TCP/IP Server  
const server = net.createServer();

class MyApp extends Homey.App {  
async onInit() { // homey starts it, when app initialized  
this.log(‘App has been initialized’);  
// server.on(‘connection’,(sock) =\> { … });

```auto
 **server.listen(1025, '10.0.0.111', () => { //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<**
      console.log('server bound',server.address());
  });// server ---- listen -------------------------------

```

} // ----------On Init Homey.app  
}  
module.exports = MyApp;

* * *

## …

“platforms”: [“local”],  
“category”: [“tools”],  
“permissions”: ,  
…

I posted it on GitHub but got no answer. Maybe somebody here has got an idea, what the reason is?

---

<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: [March 11, 2024, 1:47pm UTC](https://community.homey.app/t/homey-app-listening-to-a-port-eaddrnotavail/106048/2 "2024-03-11T13:47:57Z")

</div>

Unless Homey’s IP address is 10.0.0.111, you will get that error.

Any reason why you’re explicitly setting a host?

---

<div class="post-metadata">

### Author: ![Ralf\_Peters](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ralf_peters/32/80106_2.png) [@Ralf\_Peters](https://community.homey.app/u/Ralf_Peters)
#### Post date: [March 11, 2024, 1:55pm UTC](https://community.homey.app/t/homey-app-listening-to-a-port-eaddrnotavail/106048/3 "2024-03-11T13:55:49Z")

</div>

My homey has got this LAN-address plus a Wifi Address. Both create the error. Homey should act as the receiver of smtp messages as a server because the devices are only able to send smtp. There is no cloud necessary.

---

<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: [March 11, 2024, 2:00pm UTC](https://community.homey.app/t/homey-app-listening-to-a-port-eaddrnotavail/106048/4 "2024-03-11T14:00:07Z")

</div>

> [@Ralf\_Peters](#):
>
> My homey has got this LAN-address plus a Wifi Address. Both create the error.

Are you running your app using `homey app run` or using `homey app run --remote`?

> [@](#):
>
> Homey should act as the receiver of smtp messages as a server because the devices are only able to send smtp. There is no cloud necessary.

That doesn’t answer my question though: why are you explicitly setting a host? Not setting one will fix your issue, and it’s unrelated to cloud.

---

<div class="post-metadata">

### Author: ![Ralf\_Peters](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ralf_peters/32/80106_2.png) [@Ralf\_Peters](https://community.homey.app/u/Ralf_Peters)
#### Post date: [March 11, 2024, 2:06pm UTC](https://community.homey.app/t/homey-app-listening-to-a-port-eaddrnotavail/106048/5 "2024-03-11T14:06:46Z")

</div>

I use “homey app run”. I tried already a version without setting a host-ip, but no connection to the my homey was possible.

---

<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: [March 11, 2024, 2:07pm UTC](https://community.homey.app/t/homey-app-listening-to-a-port-eaddrnotavail/106048/6 "2024-03-11T14:07:38Z")

</div>

> [@Ralf\_Peters](#):
>
> I use “homey app run”.

If you have a HP2023, that will run your app in a local Docker container (which would explain the error, since that container will not have the 10.0.0.111 address), not on your actual Homey.

---

<div class="post-metadata">

### Author: ![Ralf\_Peters](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ralf_peters/32/80106_2.png) [@Ralf\_Peters](https://community.homey.app/u/Ralf_Peters)
#### Post date: [March 11, 2024, 2:12pm UTC](https://community.homey.app/t/homey-app-listening-to-a-port-eaddrnotavail/106048/7 "2024-03-11T14:12:34Z")

</div>

Yes, that makes sense. Thank you for that hint. I am not familiar with docker containers. Is it possible to map to an external IP address?

---

<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: [March 11, 2024, 2:16pm UTC](https://community.homey.app/t/homey-app-listening-to-a-port-eaddrnotavail/106048/8 "2024-03-11T14:16:03Z")

</div>

> [@Ralf\_Peters](#):
>
> Is it possible to map to an external IP address?

You can try if you can access port 1025 of the machine you’re running Docker on, but I don’t know how the Homey command line tool sets up the container so it might not work.

If not, run the app directly on your Homey using `homey app run --remote`

---

<div class="post-metadata">

### Author: ![Ralf\_Peters](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ralf_peters/32/80106_2.png) [@Ralf\_Peters](https://community.homey.app/u/Ralf_Peters)
#### Post date: [March 11, 2024, 2:19pm UTC](https://community.homey.app/t/homey-app-listening-to-a-port-eaddrnotavail/106048/9 "2024-03-11T14:19:36Z")

</div>

Thanks a lot! You are great!!! I will test some things and I will come back hopefully with the solution. Take care!

---

<div class="post-metadata">

### Author: ![Ralf\_Peters](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ralf_peters/32/80106_2.png) [@Ralf\_Peters](https://community.homey.app/u/Ralf_Peters)
#### Post date: [March 11, 2024, 2:43pm UTC](https://community.homey.app/t/homey-app-listening-to-a-port-eaddrnotavail/106048/10 "2024-03-11T14:43:18Z")

</div>

Thanks again! “homey app run --remote” works perfect! 😀
