evandcoleman / node-appletv

A node module for interacting with an Apple TV (4th-generation or later) over the Media Remote Protocol.
https://evandcoleman.github.io/node-appletv/
MIT License
180 stars 48 forks source link

error on pairing #25

Closed darvin closed 5 years ago

darvin commented 5 years ago
bash-4.4# bin/appletv pair
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
⠙ Scanning for Apple TVs...events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo -3008
    at errnoException (/homebridge/node_modules/node-appletv/node_modules/mdns/lib/resolver_sequence_tasks.js:199:11)
    at getaddrinfo_complete (/homebridge/node_modules/node-appletv/node_modules/mdns/lib/resolver_sequence_tasks.js:112:10)
    at GetAddrInfoReqWrap.oncomplete (/homebridge/node_modules/node-appletv/node_modules/mdns/lib/resolver_sequence_tasks.js:120:9)
Emitted 'error' event at:
    at on_resolver_done (/homebridge/node_modules/node-appletv/node_modules/mdns/lib/browser.js:28:14)
    at next (/homebridge/node_modules/node-appletv/node_modules/mdns/lib/browser.js:100:7)
    at /homebridge/node_modules/node-appletv/node_modules/mdns/lib/resolver_sequence_tasks.js:160:11
    at getaddrinfo_complete (/homebridge/node_modules/node-appletv/node_modules/mdns/lib/resolver_sequence_tasks.js:112:7)
    at GetAddrInfoReqWrap.oncomplete (/homebridge/node_modules/node-appletv/node_modules/mdns/lib/resolver_sequence_tasks.js:120:9)

linux, latest sodium

htpc-helper commented 5 years ago

I'm having the same problem. Seems to be an issue with the mDNS lib:

https://github.com/agnat/node_mdns/issues/130

mschwartz commented 5 years ago

I saw that yesterday, but was able to get it working.

You have to have dbus and avahi-deamon installed and running. You also have to set up your nsswitch.conf file

 Name Service Switch configuration file.
# See nsswitch.conf(5) for details.

passwd: files mymachines systemd
group: files mymachines systemd
shadow: files

publickey: files

#hosts: files mdns4_minimal [NOTFOUND=return] resolve  [!UNAVAIL=return] dns mdns 
hosts:          files dns mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return]

#mymachines myhostname
networks: files

protocols: files
services: files
ethers: files
rpc: files

netgroup: files
mschwartz commented 5 years ago

also avahi-daemon.conf


[server]
#host-name=foo
domain-name=local
#browse-domains=0pointer.de, zeroconf.org
use-ipv4=yes
use-ipv6=yes
#allow-interfaces=eth0
#deny-interfaces=eth1
#check-response-ttl=no
#use-iff-running=no
enable-dbus=yes
#disallow-other-stacks=no
#allow-point-to-point=no
#cache-entries-max=4096
#clients-max=4096
#objects-per-client-max=1024
#entries-per-entry-group-max=32
ratelimit-interval-usec=1000000
ratelimit-burst=1000

[wide-area]
enable-wide-area=yes

[publish]
#disable-publishing=yes
#disable-user-service-publishing=no
#add-service-cookie=no
#publish-addresses=yes
#publish-hinfo=no
#publish-workstation=no
#publish-domain=yes
#publish-dns-servers=192.168.50.1, 192.168.50.2
#publish-resolv-conf-dns-servers=yes
#publish-aaaa-on-ipv4=yes
#publish-a-on-ipv6=no

[reflector]
#enable-reflector=no
#reflect-ipv=no

[rlimits]
#rlimit-as=
#rlimit-core=0
#rlimit-data=4194304
#rlimit-fsize=0
#rlimit-nofile=768
#rlimit-stack=4194304
#rlimit-nproc=3
darvin commented 5 years ago

works for me now