Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help needed]: bind EADDRINUSE <someIP>:5353 on macOS #504

Open
Tazintosh opened this issue Oct 18, 2022 · 7 comments
Open

[Help needed]: bind EADDRINUSE <someIP>:5353 on macOS #504

Tazintosh opened this issue Oct 18, 2022 · 7 comments
Assignees
Labels
question Further information is requested

Comments

@Tazintosh
Copy link

Your Current NRCHKB Plugin Version

1.4.3

Operating System

macOS Big Sur

How can we help?

Hello everyone.

Here's the situation:

When setting up the custom mDNS fields of NRCHKB, Node-RED complains about Error: bind EADDRINUSE 10.80.10.2:5353. I guess the reason is that macOS is running is own instance of mDns. Anyway to workaround this?

Here are more informations about the setting:

  • I've recently upgraded my whole network with UniFi devices. I've also rethought my LAN and rather than one unique network, I now have 4 (Management for UniFi devices, Local (my main), Services (all IoT devices, including HomeKit hubs) and Guest.
  • I own a server (Mac mini M1) which runs Node-RED and NRCHKB.
  • The server is plugged into a Switch Flex Mini (which itself is plugged into the UDM) and because of some limitations with this device, the native network (VLAN1) provided to the ethernet interface of the Mac mini is "Management". I've added two other interfaces to the mini: VLAN Services and VLAN Local.

With this setting, my issue is that all NRCHKB created HomeKit devices are in "no response" mode.
Whatever the priority order I set for the interfaces (even if I place the Services VLAN topmost), the broadcast won't work.

I found two solutions to my problem, none are very good for me:

  • I change my network setup so the native network (VLAN1) provided by the switch is "Services", thus, my server default ethernet interface will get a service network and all work fine. But this has other drawbacks (not interesting to discuss here) and for this reason, I would like to avoid it.
  • I literarily disable (see capture) the ethernet interface, make sure Services VLAN is first on the list, and boom, working again. The reason I don't like this solution is if for any reason I need to plug my server to whatever other network, it won't get any IP, because default interface is disabled and no corresponding VLANs will be available. Also, the server is running without screen attached.
    Capture d’écran 2022-10-17 à 10 15 06

So, I digg around and found this topic and the NRCHKB option to specify the mDNS info. I did the following settings: (10.80.10.2 is my server IP set on the Services VLAN interface). For the test I obviously enabled back the native interface.
Saving such a setting will prevent Node-RED to start with error:
Error: bind EADDRINUSE 10.80.10.2:5353
I guess the reason is that macOS is running is own instance of mDns.
Capture d’écran 2022-10-17 à 10 13 59

I'm not super tech in network thingy, so if ever you would have ideas on how to make Node-RED up and running when my native ethernet is enabled and still broadcast to the Services VLAN, I would immensely appreciate.
I'm of course opened to other suggestions.

Thanks a lot in advance.

Any more details?

If this is specific to some hardware or specific software version, please explain here.

Any code or functions to add?

No response

@Tazintosh Tazintosh added the question Further information is requested label Oct 18, 2022
@Shaquu
Copy link
Member

Shaquu commented Oct 20, 2022

First of all, are you using any different apps for HomeKit on the same server?

@Tazintosh
Copy link
Author

Hi @Shaquu and thanks for the answer.
No, I'm not using any other apps for HomeKit.
The server is running standard macOS Big Sur + Node-RED + NRCHKB. It's also running Mosquito, a webserver, a database, etc., but nothing related to HomeKit directly as far as I know.

@Shaquu
Copy link
Member

Shaquu commented Oct 20, 2022

It will be tough since I do not know many people using vlan.

You could try to look for solution for HapNodeJS or homebridge.
If it works there it should also work for us (both we and homebridge are based on HapNodeJS).

Also, have a look here
https://medium.com/@gepeto42/using-homekit-devices-across-vlans-and-subnets-aa5ae1024939

@caitken-com
Copy link

Hi @Tazintosh where did you get with this?

@Tazintosh
Copy link
Author

@caitken-com Nowhere, my native ethernet interface is maintain as inactive.
settings.js is set with uiHost: "10.80.10.2"

@caitken-com
Copy link

Did the article Shaquu posted help any?
https://recyclebin.zip/posts/medium-posts-homekit-vlans/

@Tazintosh
Copy link
Author

Well, this article seems only about setting up the right firewall rules on your router.
In my case, my Management network has access to all my RFC 1918 so I don't see why it would be blocked.
Also, all my Local Network devices can access HomeKit (sitting on Service Network).
Based on this two points, I don't yet understand why I get "no response" if I set the mDNS of Node-RED to my service network while my native ethernet interface with Management is enable.

Capture d’écran 2023-09-26 à 08 44 01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants