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) => { … });
**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?