Closed martynaskre closed 5 years ago
The scanning works by sending a broadcast packet to all devices in your network, which causes the controllers to send an answer back to you. Sometimes this broadcast packet gets lost or the answer arrives too late (default timeout is 500ms), so you could either try the discovery multiple times or increase the timeout or both.
I think if you're running on Windows, there might also be some problems sending UDP broadcasts in some cases, but since I don't use Windows, I can't help you with that.
Yea, scanning works on MacOS. I'll check whats wrong on Windows and maybe I'll create some sort of fix.
You may take a look at this issue and the linked ServerFault thread. Apparently you can't send an UDP packet on the 255.255.255.255
broadcast address on windows.
You probably have to do some workaround, by working with the output of os.networkInterfaces() and replacing the last bytes of the IP addresses or something. If you want to write an OS-specific workaround feel free to send a PR, but I would personally consider this low-priority or even a non-issue, since it's just Windows being Windows. Simply running node in the WSL might even fix your problem on Windows without writing any additional code.
I implemented a fix in the new_features branch. Please check if the discovery works now, in which case I would merge it into the master branch and release it.
Everything works now. Nice 👍
I have a Magic Home led controller, but scanning does not work. If I specify correct IP address I can control LEDs with this package, but scanning somehow does not work.