jstrausd / homebridge-simple-wled

Homebridge Plugin to control WLED LED-Strips
ISC License
63 stars 17 forks source link

Port listening / firewall issues? #33

Closed mnfctrdinitaly closed 2 years ago

mnfctrdinitaly commented 2 years ago

Hey, so I had a bit of an issue getting the homebridge accessory to show up in homekit. I noticed that the logs say:

[1/12/2022, 3:31:44 PM] [WLED] Setting up Accessory Kitchen Cabinet with Host-IP: XXX.XXX.XX.XXX Single WLED-Host configured [1/12/2022, 3:31:44 PM] [WLED] Adding effects: Fireworks 1D [1/12/2022, 3:31:45 PM] [WLED] WLED Strip finished initializing! [1/12/2022, 3:31:45 PM] Kitchen Cabinet 656F is running on port XXXXX. [1/12/2022, 3:31:45 PM] Please add [Kitchen Cabinet 656F] manually in Home app. Setup Code: XXX-XX-XXX

I have a firewall on my homebridge with all ports closed as it is was once accessible over the internet and I just like firewall security I guess. Any way, it took me forever to figure this out because EVERY restart of the homebridge cause the WLED plugin to pull a different port. (specifically in my case, a blocked port that needed to be allowed.)

Can I specify a single port? My homebridge has all its ports closed except for the ports I need open. I also noticed that this port changes on every restart of the homebridge.

Any help on this as I would only like one port open and no others and I would like it to stay static...

Thanks for reading and any help you have.

jstrausd commented 2 years ago

Due to limitations of homebridge, it is not possible for developers to specify a port for a acessory. But you can set a range of ports the accessories should use. For that just add this json-object to the config.json of your homebridge instance and there you can specify the start and the end range of the ports, which the accessories can use.

"ports": { "start": 52100, "end": 52150 },

So you can add a rule to your firewall to allow this range of ports. I hope this solves your question.

Best regards Jonathan

mnfctrdinitaly commented 2 years ago

Thanks! This worked perfectly!