Open C-Duv opened 10 years ago
It should work without issues but I can see where it could be failing.
Can you please install dns-sd
and run dns-sd -Z _airplay._tcp
to see what it's being broadcasted?
Couldn't find a gem named dns-sd
(nor a Debian package) but if you refer to MOX/Darwin's dns-sd I might have found the GNU/Linux equivalent: avahi-browse
from avahi-utils:
root@debian:~# avahi-browse _airplay._tcp
+ eth0 IPv6 atv _airplay._tcp local
+ eth0 IPv4 atv _airplay._tcp local
^CGot SIGINT, quitting.
root@debian:~#
atv is indeed the network name of my AppleTV (FQDN is atv.domicile.local).
@C-Duv I've seen this happen with other libraries before as a result of:
/etc/hosts
/etc/resolv.conf
So check those two files just to be safe.
You could try replacing your current dns settings with Google DNS or Open DNS for your /etc/resolv.conf
Finally, you could try opening an irb
or pry
session and running this code:
require 'net/http'
Socket.getaddrinfo('www.youtube.com', 'http')
If all is good you will get a bunch of arrays with ip addresses. This means your computer was probably possessed for that moment and couldn't resolve the name to its ip address. Let us know if some of this helped, thanks :cat:
Had no wildcards in /etc/hosts
, put 8.8.8.8
in /etc/resolv.conf
and got arrays of IP with given code...
However, installed ruby
, ruby-dev
, avahi-daemon
, avahi-utils
, libavahi-compat-libdnssd1
, libavahi-compat-libdnssd-dev
on a non-VM Debian 7.3 and got air list
(+air play
and air view
) running at first try.
Problem is not really solved but since my goal was to first try on the VM before installing it on the production server... I'm fine.
I'm gonna compare installed package list of both Debian and try to find a explanation...
Thank you for the feedback @C-Duv! :fist: . I'll add some of this information to the README
First really quick analysis shows that:
root@debian-NOTWORKING:~# gem list | grep -e air -e net-ptth
airplay (1.0.2, 0.2.9)
airplay-cli (1.0.1)
airstream (0.4.4)
net-ptth (0.0.17)
root@debian-WORKING:~# gem list | grep -e air -e net-ptth
airplay (1.0.2)
airplay-cli (1.0.1)
net-ptth (0.0.17)
It is true that I had stumbled upon airstream
gem (before airplay
), and installed. It seems to have (on the not working server) required an older version of airplay
: 0.2.9.
Uninstalling the 0.2.9 and keeping 1.0.2 didn't solved the problem though.
Sorry but I couldn't narrow down the problem. I did had the following packages installed on not-working server but absent of working server:
ruby-dev
v1.9.3ruby1.8 v1.8.7.358
ruby1.8-dev
1.8.7.358
But removing them and re-installing airplay didn't made it work...I had exactly this problem today. After adding some debugging prints, I have found that .local seems to be appended to the found device. So in your example the problem could possibly be resolved either by adding atv.local to /etc/hosts or even better by installing the nss-mdns4 module and changing the line "hosts: files dns" to "hosts: files mdns4_minimal dns" /etc/nsswitch.conf.
To confirm @arda2012's comment, here is the content of my /etc/nsswitch.conf
file:
Non-working: hosts: files dns
Working box : hosts: files dns mdns mdns4_minimal [NOTFOUND=return] mdns4
The lack of mdns* seems to be the cause. I've changed hosts line to hosts: files mdns dns
and air list
worked right away afterwards.
Hi. I wanted to try out airplay.rb today and I've added those lines to the /etc/nsswitch.conf file but still get the same error stated above. Can I try something else? Thanks.
The problem is that local (not global) domains could not be resolved. To enable is in Arch Linux nss-mdns package is required. In Debian there should be something similar (rdnssd, I assume).
Same error on ubuntu 16.04.
Local Domain is resolvable, and airplay service is found vy avahi:
--- airplay/airplayer ‹master* ⁇› » ping osmc.local
PING osmc.local (192.168.8.8) 56(84) bytes of data.
64 bytes from osmc (192.168.8.8): icmp_seq=1 ttl=64 time=2.64 ms
^C
--- osmc.local ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.643/2.643/2.643/0.000 ms
--- airplay/airplayer ‹master* ⁇› » avahi-browse _airplay._tcp
+ wlan0 IPv4 osmc _airplay._tcp local
What else can i try ?
On a freshly installed Debian VM I can't get to list AirPlay devices as I get:
ERROR persistent: Net::PTTH crashed! SocketError: getaddrinfo: Name or service not known
Is there something trivially forgotten when running airplay on a fresh Debian install?
Here is full output:
Versions used: ruby v1.9.3p194 airplay gem v1.0.2, 0.2.9 airplay-cli gem v1.0.1 net-ptth gem v0.0.17 Debian v7.3