Giter VIP home page Giter VIP logo

Comments (15)

ebaauw avatar ebaauw commented on June 21, 2024

For comparison, here's the log output in Homebridge v1.5.9:

[12/14/2022, 10:41:28 PM] [HB Supervisor] Restarting Homebridge...
[12/14/2022, 10:41:28 PM] [HB Supervisor] Starting Homebridge with extra flags: -P /volume1/homebridge/node_modules -D --strict-plugin-resolution
[12/14/2022, 10:41:28 PM] [HB Supervisor] Starting Homebridge with custom env: {"DEBUG":"HAP-NodeJS:Advertiser","NODE_OPTIONS":"--trace-warnings"}
[12/14/2022, 10:41:28 PM] [HB Supervisor] Started Homebridge v1.5.1 with PID: 27264
2022-12-14T21:41:29.027Z HAP-NodeJS:Advertiser Initializing HAP-NodeJS v0.10.4 ...
[12/14/2022, 10:41:29 PM] Loaded config.json with 0 accessories and 1 platforms.
[12/14/2022, 10:41:29 PM] Loaded 0 cached accessories from cachedAccessories.
[12/14/2022, 10:41:29 PM] ---
[12/14/2022, 10:41:29 PM] No plugins found.
[12/14/2022, 10:41:29 PM] Loading 1 platforms...
[12/14/2022, 10:41:29 PM] Publishing bridge accessory (name: ds2, publishInfo: {
  username: 'CC:22:3D:E3:C7:3D',
  port: 51826,
  pincode: '***-**-***',
  category: 2,
  bind: undefined,
  mdns: undefined,
  addIdentifyingMaterial: true,
  advertiser: 'avahi'
}).
Setup Payload:
X-HM://00253QFZSWX86
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:
                       
    ┌────────────┐     
    │ 987-65-432 │     
    └────────────┘     
                       
[12/14/2022, 10:41:29 PM] Homebridge v1.5.1 (HAP v0.10.4) (ds2) is running on port 51826.
2022-12-14T21:41:29.317Z HAP-NodeJS:Advertiser Detected Avahi over DBus interface running version 'avahi 0.7'.
2022-12-14T21:41:29.320Z HAP-NodeJS:Advertiser Preparing Advertiser for 'ds2 0BBB' using Avahi backend!
2022-12-14T21:41:29.326Z HAP-NodeJS:Advertiser Starting to advertise 'ds2 0BBB' using Avahi backend!

from hap-nodejs.

Supereg avatar Supereg commented on June 21, 2024

Reading the logs there are two important lines here:

2022-12-14T21:39:21.484Z HAP-NodeJS:Advertiser Detected Avahi over DBus interface running version 'avahi 0.7'.
[...]
Could not create mDNS advertisement. The HAP-Server won't be discoverable: Error: No such interface found

The last line refers to a feature failing introduced with PR #970 which registers to the Server.StateChanged interface to be notified about avahi server restarts.
Secondly, you/Synology are/is running avahi version 0.7 a 6 year old release of avahi. My test environment runs avahi 0.8 so I assume there is some issues with the exposed dbus interface that was updated in the avahi 0.8 release.
Within hap-nodejs, we are using the legacy org.freedesktop.Avahi.Server instead of the org.freedesktop.Avahi.Server2 interface that got introduced with 0.8. So I'm not sure if there are changes within the "legacy" interface that weren't properly communicated.

That's my currently analysis of the problem. I will investigate further. One possibility is to just gracefully continue if the dbus interface is not found, see:

this.avahiServerInterface = await AvahiAdvertiser.avahiInterface(this.bus, "Server");
this.avahiServerInterface.on("StateChanged", this.stateChangeHandler);
.

But ideally we find a solution that enables restart detection also for < avahi 0.8 daemons.

Thanks for reporting this issue 🚀

from hap-nodejs.

Supereg avatar Supereg commented on June 21, 2024

Looking at the diff between 0.7 and 0.8, there are now changes in regard to the dbus interface used: avahi/avahi@v0.7...v0.8#diff-cda9c20b8570353458c309abfcddcac2c9be7b6fca607ef7b702a7d489ed1648

from hap-nodejs.

ebaauw avatar ebaauw commented on June 21, 2024

Your test in the PR also uses avahi 0.7? See #970 (comment)

from hap-nodejs.

Supereg avatar Supereg commented on June 21, 2024

You are indeed right. I was probably still running ubuntu 20.04 back then.

Is there anyway to replicate the synology environment, is there a docker image or something?

from hap-nodejs.

Supereg avatar Supereg commented on June 21, 2024

For reference, the error comes from here within dbus-native:
https://github.com/homebridge/dbus-native/blob/fc1a5bf07b448f473923a64e707110e48f0272f6/lib/introspect.js#L33

It is called by introspectBus which is called by DBusService.getInterface(...)

from hap-nodejs.

Supereg avatar Supereg commented on June 21, 2024

You could try to manually debug, by adding a console.log(result); before that line, maybe (file node_modules/@homebridge/dbus-native/lib/introspect.ts).

from hap-nodejs.

ebaauw avatar ebaauw commented on June 21, 2024

I think Synology supports multiple DSM installations on the same DiskStation through virtualisation, but I never looked into that. I doubt DSM will run on non-Synology hardware.

In my experience, Synology tends to modify standard software, e.g. they run their own build of nut.

So “interface” in the error message refers to the dbus endpoint, not to the network interface.

from hap-nodejs.

Supereg avatar Supereg commented on June 21, 2024

So “interface” in the error message refers to the dbus endpoint, not to the network interface.

Exactly. And the issue also only evolves around the org.freedesktop.Avahi.Server interface of the org.freedesktop.Avahi service. We use that to subscribe to the StateChanged signal.

For our other commands we use the org.freedesktop.Avahi.Server (to check the version and create a new entry group) and org.freedesktop.Avahi.EntryGroup (adding the mDNS service and advertising it) interfaces. Though, in those instances we only do a request-response style of communication (in hap-nodejs this is implemented in AvahiAdvertiser.avahiInvoke). The StateChanged signal is the only occurrence where we actually subscribe to signals of an interface (implemented via AvahiAdvertiser.avahiInterface.

from hap-nodejs.

ebaauw avatar ebaauw commented on June 21, 2024

The result is just a newline. The xml reads:

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
</node>

from hap-nodejs.

Supereg avatar Supereg commented on June 21, 2024

Hm. I mean, we could incorporate a workaround where we just don't care about hooking the StateChanged listener, maybe printing a little warning if we can't explaining that we won't be able to detect restarts.
But I would really interested why this doesn't work on Synology.
It's not about dbus itself is it (idk difference in version etc)? Maybe there is some issue within dbus-native? But the response is completely empty, so something must be going wrong even before that.

from hap-nodejs.

ebaauw avatar ebaauw commented on June 21, 2024
$ dbus-daemon --version
D-Bus Message Bus Daemon 1.12.16
Copyright (C) 2002, 2003 Red Hat, Inc., CodeFactory AB, and others
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

That's an old one, my Raspberry Pi servers running bullseye report 1.12.24 (with the same 2002, 2003 copyright message).

$ avahi-daemon --version
avahi-daemon 0.7

Nothing here that we didn't already know.

from hap-nodejs.

Supereg avatar Supereg commented on June 21, 2024

ping @adriancable, any ideas on this?

from hap-nodejs.

github-actions avatar github-actions commented on June 21, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from hap-nodejs.

Supereg avatar Supereg commented on June 21, 2024

I installed a workaround in the latest beta release of hap-nodejs 0.11.1 and homebridhe 1.6.1.
See #1003.

from hap-nodejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.