JosefJantzen / MMM-AlexaControl

Control your MagicMirror with Alexa
MIT License
45 stars 10 forks source link

Error: bind EADDRINUSE 0.0.0.0:1900 #35

Closed susl192 closed 2 years ago

susl192 commented 3 years ago

Hi,

I am getting the error message in the mm-error.log and alexa is not able to find device. What can I do? Thanks for help.

[2021-01-30 16:11:00.788] [ERROR] Error: bind EADDRINUSE 0.0.0.0:1900 at dgram.js:321:18 at processTicksAndRejections (internal/process/task_queues.js:84:9) { errno: 'EADDRINUSE', code: 'EADDRINUSE', syscall: 'bind', address: '0.0.0.0', port: 1900 } [2021-01-30 16:11:00.801] [ERROR] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? [2021-01-30 16:11:00.802] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues

JosefJantzen commented 3 years ago

Hi, The problem here is that the port 1900 is still used. This port is used by the library I use for the device emulation for the discovering service. It seems to be that another program or module uses this port. Maybe it works if you change it. For that navigate in MMM-AlexaControl/node-modules/node-fauxmo/src and open the file SSDPService.js. In line 141 the port is defined. Then increase it to 1901. I hope that works because I can't test it and I'm not sure if this is generally working.

susl192 commented 3 years ago

Hi,

thanks for your prompt answer. To change the port manually helped to remove the error message but know alexa can't connect with raspberry pi because the device is not found. Is the discovery process still possible when the port is not 1900? I found out the the port 1900 is used by electron.js which is part of magic mirror itself. Do you know if it is possible to change the port of electron in order to leave the port for the discovery service on 1900?

JosefJantzen commented 3 years ago

Hi, I didn't really know that but now I think to change the port of the SSDPService couldn't work. I found out that the port 1900 is a standard UDP port that I think shouldn't be changed. So it's the same for electron I think. Maybe my module is the part of electron that use the port because it's not a standalone program. So there must be a different reason. Maybe there is another module that uses it. You could try to run the mirror only with my module and then you know if another module causes the problem or another program. I'm not sure what we could try otherwise.

sdetweil commented 3 years ago

Spotify app also uses port 1900.. to locate its clients