homebridge/homebridge-syno-spk

HomeKit cannot connect to Homebridge Accessory

regan-karlewicz opened this issue · 18 comments

Current Situation

Hello! I am trying to migrate my Homebridge instance from my Raspberry Pi Model 3B to a Synology DS923+ NAS.

I've followed all the instructions for installing Homebridge using the Synology package, and migrated my configuration using the Export / Import functionality provided by Homebridge.

The Homebridge instance on the Synology NAS is running and functional. I can access the UI and my devices via the UI. At this point, I was expecting everything to be functioning, but I was getting “No response” in HomeKit.

I googled around and found that some people suggested removing the accessory from HomeKit, resetting the Homebridge accessory, and reconnecting. I tried this, and am now consistently getting the error “Accessory not found: Make sure your accessory is powered on and connected to your router with an ethernet cable, then try again.” This message shows after being stuck on “Connecting” until it times out.

As a sanity check, I tried to re-connect HomeKit to my Raspberry Pi Homebridge, and it instantly found the Bridge accessory and connected.

After some further debugging, I discovered that the Synology Homebridge instance isn’t appearing in _hap._tcp in mDNS, while the Raspberry Pi instance shows up always. I tried switching to each different mDNS advertiser provided by Homebridge with no luck. There are no errors in the Homebridge logs when each of these mDNS providers starts.

Things I’ve tried with both the official Homebridge synology package and Docker images:

  • Restarting my router
  • Restarting my NAS
  • Restarting my iOS device
  • Ciao mDNS advertiser
  • Bonjour mDNS advertiser
  • Avahi mDNS advertiser
  • Disabling tailscale on all devices
  • Disabling Bonjour service on DSM
  • Disabling all plugins
  • Adding DSM_HOSTNAME environment variable (Docker only)
  • Naming the Homebridge instances differently
  • Using different ports for Homebridge

The NAS has a wired connection to my modem / router (Arris G36). My iOS device is on the Wifi network provided by the same router. I can confirm that I have no firewall on the NAS.

Does anyone have any ideas on how to debug this further? I'm not sure where to go from here as I've exhausted the documentation and Google results.

Logs

[4/15/2024, 3:57:11 PM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[4/15/2024, 3:57:16 PM] [HB Supervisor] OS: Linux 4.4.302+ x64
[4/15/2024, 3:57:16 PM] [HB Supervisor] Node.js v20.9.0 /volume1/@appstore/Node.js_v20/usr/local/bin/node
[4/15/2024, 3:57:16 PM] [HB Supervisor] Homebridge Path: /volume1/homebridge/node_modules/homebridge/bin/homebridge
[4/15/2024, 3:57:16 PM] [HB Supervisor] UI Path: /var/packages/homebridge/target/app/lib/node_modules/homebridge-config-ui-x/dist/bin/standalone.js
[4/15/2024, 3:57:17 PM] [Homebridge UI] Homebridge UI v4.55.1 is listening on :: port 8581
[4/15/2024, 3:57:18 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /volume1/homebridge/node_modules -D --strict-plugin-resolution
[4/15/2024, 3:57:18 PM] [HB Supervisor] Started Homebridge v1.7.0 with PID: 7988
[4/15/2024, 3:57:18 PM] Loaded config.json with 0 accessories and 4 platforms.
[4/15/2024, 3:57:18 PM] Loaded 0 cached accessories from cachedAccessories.
[4/15/2024, 3:57:18 PM] ---
[4/15/2024, 3:57:18 PM] Disabled plugin: homebridge-dyson-pure-cool@2.7.5
[4/15/2024, 3:57:18 PM] ---
[4/15/2024, 3:57:18 PM] Disabled plugin: homebridge-govee@9.0.2
[4/15/2024, 3:57:18 PM] ---
[4/15/2024, 3:57:18 PM] Disabled plugin: @mattrick/homebridge-smartrent@1.0.1
[4/15/2024, 3:57:18 PM] ---
[4/15/2024, 3:57:18 PM] Loading 4 platforms...
[4/15/2024, 3:57:18 PM] Ignoring config for the platform "Govee" in your config.json as the plugin "homebridge-govee" has been disabled.
[4/15/2024, 3:57:18 PM] Ignoring config for the platform "SmartRent" in your config.json as the plugin "@mattrick/homebridge-smartrent" has been disabled.
[4/15/2024, 3:57:18 PM] Ignoring config for the platform "DysonPureCoolPlatform" in your config.json as the plugin "homebridge-dyson-pure-cool" has been disabled.
[4/15/2024, 3:57:18 PM] Publishing bridge accessory (name: Homebridge BEE8, publishInfo: {
  username: '0E:C2:34:C4:C1:C6',
  port: 51582,
  pincode: '***-**-***',
  category: 2,
  bind: [ 'eth0', [length]: 1 ],
  mdns: undefined,
  addIdentifyingMaterial: true,
  advertiser: 'bonjour-hap'
}).
Setup Payload:
X-HM://0023W0DL2YZ9Z
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:
                       
    ┌────────────┐     
    │ ***-**-*** │     
    └────────────┘     
                       
[4/15/2024, 3:57:18 PM] Homebridge v1.7.0 (HAP v0.11.2) (Homebridge BEE8) is running on port 51582.

Configuration

{
    "bridge": {
        "name": "Homebridge BEE8",
        "username": "0E:C2:34:C4:C1:C6",
        "port": 51582,
        "pin": "253-25-766",
        "advertiser": "bonjour-hap",
        "bind": [
            "eth0"
        ]
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "name": "Govee",
            "username": "REDACTED",
            "password": "REDACTED",
            "lightDevices": ["REDACTED"],
            "platform": "Govee"
        },
        {
            "email": "REDACTED",
            "password": "REDACTED",
            "platform": "SmartRent"
        },
        {
            "devices": [
                {
                    "ipAddress": "REDACTED",
                    "serialNumber": "REDACTED",
                    "credentials": "REDACTED",
                    "useFahrenheit": true,
                    "enableAutoModeWhenActivating": false,
                    "enableOscillationWhenActivating": false,
                    "enableNightModeWhenActivating": false,
                    "isNightModeEnabled": false,
                    "isJetFocusEnabled": false,
                    "isContinuousMonitoringEnabled": false,
                    "isTemperatureSensorEnabled": false,
                    "isTemperatureIgnored": false,
                    "temperatureOffset": 0,
                    "isHumiditySensorEnabled": false,
                    "isHumidityIgnored": false,
                    "humidityOffset": 0,
                    "isAirQualitySensorEnabled": false,
                    "isAirQualityIgnored": false,
                    "isSingleSensorAccessoryModeEnabled": false,
                    "isSingleAccessoryModeEnabled": false,
                    "isFullRangeHumidity": false,
                    "isHeatingDisabled": false,
                    "isHeatingSafetyIgnored": false
                }
            ],
            "updateInterval": 60000,
            "credentialsGeneratorPort": 48000,
            "platform": "DysonPureCoolPlatform"
        }
    ]
}

Environment

  • OS: Synology DSM
  • Software: Homebridge 1.7.0
  • Node: 20.9.0
  • npm: 10.1.0

Process Supervisor

hb-service

Additional Context

No response

Edit: posted cleaner logs

My initial theory for the cause of your issue is networking. Is your phone and homebridge on the same logical network ? For HomeKit to work, your iPhone and Hoembridge need to be on the same logical network. You could quickly determine this by looking at the IP address of your iPhone and the one in homebridge.

Thanks for the fast response! I wanted to say I really appreciate it.

My iPhone IP address is 192.168.0.163 with a subnet mask of 255.255.255.0

My Synology NAS IP address is 192.168.0.185 also with a subnet mask of 255.255.255.0

Edit: I should note the Raspberry Pi, which works properly, is set to 192.168.0.105 with subnet mask 255.255.255.0

I see in your config your binding to eth1 is that the correct interface ?

I've tried both eth0 and eth1 (after changing which port was plugged in on my NAS). Currently it is set to eth0, and that is the interface corresponding to 192.168.0.185

Screenshot 2024-04-15 at 4 28 21 PM

Not sure if this matters, but I did notice that both my iPhone and Raspberry Pi have been assigned IPv6 addresses by my router, while the Synology NAS has not.

From ifconfig on Raspberry Pi:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.105  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 2601:603:f7f:b3c0::eeda  prefixlen 128  scopeid 0x0<global>
        inet6 fe80::ec78:e2f0:9aba:7dd5  prefixlen 64  scopeid 0x20<link>
        inet6 fd9c:67b2:dcd9:1041:1e31:247a:3b42:57fd  prefixlen 64  scopeid 0x0<global>
        ether b8:27:eb:5b:32:a0  txqueuelen 1000  (Ethernet)
        RX packets 602271  bytes 238560739 (227.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 627908  bytes 248292958 (236.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

From ifconfig on Synology NAS:

eth0      Link encap:Ethernet  HWaddr 90:09:D0:58:16:77
          inet addr:192.168.0.185  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:65776 errors:0 dropped:0 overruns:0 frame:0
          TX packets:67544 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:9879104 (9.4 MiB)  TX bytes:34644797 (33.0 MiB)
          Interrupt:53 base 0xc000

ipv6 shouldn't matter

If the Discovery app on the iPhone doesn't see the mDNS traffic from the Synology, it appears that the Synology is blocking or not sending the broadcast. Do you see other mDNS traffic from your Synology. Trying each Advertiser setting may make a difference

PS I'm not a Synology SME, so kinda stumped.

Unfortunately I've tried all advertisers. On my Synology device, when I run tcpdump -np port 5353 I see this:

18:05:56.930110 IP 192.168.0.185.5353 > 224.0.0.251.5353: 0*- [0q] 5/0/0 PTR Homebridge BEE8 41FE._hap._tcp.local., (Cache flush) SRV 0E_C2_34_C4_C1_C6.local.:51582 0 0, (Cache flush) TXT "c#=3" "ff=0" "id=0E:C2:34:C4:C1:C6" "md=homebridge" "pv=1.1" "s#=1" "sf=1" "ci=2" "sh=hHGHiQ==", (Cache flush) A 192.168.0.185, PTR _hap._tcp.local. (379)

The traffic I'm seeing on the raspberry pi is also similar, but using IPv6

18:06:51.716528 IP6 fd9c:67b2:dcd9:1041:1e31:247a:3b42:57fd.5353 > ff02::fb.5353: 0*- [0q] 5/0/0 PTR Homebridge BEE7 3ABE._hap._tcp.local., (Cache flush) TXT "c#=4" "ff=0" "id=0E:BA:1A:16:2B:C2" "md=homebridge" "pv=1.1" "s#=1" "sf=0" "ci=2" "sh=yBa6LQ==", (Cache flush) SRV raspberrypi.local.:51545 0 0, (Cache flush) AAAA fd9c:67b2:dcd9:1041:1e31:247a:3b42:57fd, (Cache flush) AAAA 2601:603:f7f:b3c0::eeda (241)

I do see a lot more traffic on the Raspberry Pi from my other Apple devices.

It does sound right that the Synology server (or my router) is blocking the broadcast.

Or are your others devices ignoring ipv4 ?? ( I have never heard of that )

They should all be using ipv4. I haven't made any configuration changes except on my Windows machines, which I have disabled ipv6 on. I am stumped also, but I really appreciate your time and willingness to try and help. I'll post back here if I find any more details that are notable.

@regan-karlewicz #159 looks like the same symptoms

Any recent Synology updates ?

@NorthernMan54 The synology is brand new out of the box, I haven't updated it yet.

Here's uname -a: Linux karlewicz 4.4.302+ #69057 SMP Fri Jan 12 17:01:14 CST 2024 x86_64 GNU/Linux synology_r1000_923+.

Last night I enabled ipv6 on the Synology and was able to see the ipv6 broadcasts coming in from my other devices now, but mDNS broadcasts out still aren't making it to the network.

Just to confirm the network part of the equation, if you run Wireshark on another device on your network, and look for traffic on port 5353, do you see traffic coming from your synology ?

I'm wondering if another service on the synology has taken over the mDNS / Bonjour port and blocking Homebridge's usage

@NorthernMan54 I can't see any traffic from the Synology on 5353 from other devices on the network. I can run wireshark and capture port 5353 on my Macbook (192.168.0.27), and run tcpdump -np port 5353 on the Synology. I can see the traffic being broadcast from 192.168.0.185.5353 > 224.0.0.251.5353 in the tcpdump terminal, but none of it on wireshark.

I also had that thought, and tried disabling the Bonjour mDNS service on the Synology settings under File Services > Advanced > Bonjour, and tried all the different mDNS options again with no luck.

The symptoms described in that post sound very similar to what I am facing, the main differences being I am not using a mesh network, and restarting the wifi access point doesn't solve the issue.

I have my Synology and Raspberry Pi both connected via hardwire to my Arris G36, and the rest of my devices are connected to the Arris G36 wifi.

I can confirm that I can resolve raspberrypi.local (my raspberry pi) from my machines on the network, except not on the synology, where I get Could not resolve host: raspberrypi.local

I can't resolve the synology .local domain on any device (including the synology), I get Could not resolve host: karlewicz.local

Am think we use #159 to triage this, as both are likely the same trigger

Update: I switched my router to a Netgear RAX43 because my Arris G36 was having constant issues with dropped video calls, needing to be restarted every day. As soon as the new router was installed my Synology Homebridge showed up on my network. I'm guessing some internal firewall in the router was preventing the broadcast? I'm not sure if that makes sense since the Pi was also a wired connection to the router.

@regan-karlewicz Tks for sharing this update