dsandor / fauxmojs

Fake WeMo device ported to NodeJS. Allows Alexa (Amazon Echo) to make api calls.
56 stars 22 forks source link

Unable to start FauxMo because of UDP port binding #9

Closed Sawtaytoes closed 6 years ago

Sawtaytoes commented 6 years ago

When starting FauxMo using the example-updated method, this is what I see in the console:

started..
updated..
D:\Projects\Personal\FauxMo-Controller\node_modules\fauxmojs\lib\discoveryService.js:101
        throw err;
        ^

Error: bind EADDRINUSE 0.0.0.0:1900
    at Object._errnoException (util.js:1022:11)
    at _exceptionWithHostPort (util.js:1045:20)
    at _handle.lookup (dgram.js:242:18)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:611:11)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:578:3

I'm using Windows 10 64-bit.

This line is the issue in discoveryService.js:

udpServer.bind(1900);

I was able to temporarily fix it by changing 1900 to 1901.

What's causing this port to already be in use? Is it possible I already have an SSDP server running?

When I do netstat -anobp udp, I see these:

  Proto  Local Address          Foreign Address        State           PID
 [svchost.exe]
  UDP    0.0.0.0:1900           *:*                                    94576
 [svchost.exe]
  UDP    127.0.0.1:1900         *:*                                    5248
  SSDPSRV
Sawtaytoes commented 6 years ago

I believe this issue is resolved with this pull request: https://github.com/dsandor/fauxmojs/pull/8

Is there a reason it hasn't been pulled in yet?

dsandor commented 6 years ago

I merged it in. Sorry, wife had twins.. life happened.