Stokestack
Posts: 45
Joined: Wed Aug 15, 2012 1:00 am

Making Pi discoverable to Macs with Avahi isn't working.

Mon Jul 22, 2013 10:12 am

Hi all.

I've installed avahi-daemon and verified that it's installed. I also verified that nss-mdns is installed. I've set Avahi to auto-start, and verified that it did on reboot.

I followed the instructions here: http://gettingstartedwithraspberrypi.tu ... th-bonjour

Which means I set up a service file under /etc/avahi/services containing the following.

Code: Select all

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
   <name replace-wildcards="yes">%h</name>
   <service>
      <type>_afpovertcp._tcp</type>
      <port>548</port>
   </service>
</service-group> 
But attempting to ping the [name of my pi].local from my Mac or connect to it in Finder doesn't work. I've verified that name in /etc/hostname. Both computers are connected to the same router. I can ping the Pi by IP address.

I've seen a lot of articles claiming that all you need to do is install avahi-daemon. None of this works so far. Any ideas?

Thanks!

Gavin

User avatar
Mortimer
Posts: 928
Joined: Sun Jun 10, 2012 3:57 pm

Re: Making Pi discoverable to Macs with Avahi isn't working.

Mon Jul 22, 2013 11:31 am

When I installed Netatalk onto my Raspberry Pi last week, it showed up straight away in the Mac OS X Finder, without any additional software. In fact the site you linked to says (in paragraph 4) that all the stuff from about paragraph 5 onwards shouldn't be needed, which includes installing Avahi.
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Making Pi discoverable to Macs with Avahi isn't working.

Mon Jul 22, 2013 11:53 am

I've found that avahi works quite well, some of the time. (Joke)

That is, about half the time when I try to ping "raspi.local" from my Mac, it works; the other half of the time, I get an "No such node name" type error message.

The point, of course, is that a service like this that works about half the time, isn't very useful.

But I still think it is cool. It is so cool - when it works.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

chris57100
Posts: 522
Joined: Wed Sep 12, 2012 7:23 pm
Location: Thionville
Contact: Website

Re: Making Pi discoverable to Macs with Avahi isn't working.

Mon Jul 22, 2013 11:55 am

Hi,
It seems that you have to install the 2.2 release and not the latest one in order to make your system viewable from other Apple devices.

I guess that you restarted your system once the configuration updated ?

I will check mine at home this evening, i have it installed for the timemachine backups
Raspberry Pi Home Server : http://www.pihomeserver.fr
Software and electronic tutorials : Samba, Airplay, CUPS, Time machine, Nginx, Owncloud, rTorrent, Wordpress, etc.
Full Wi-Fi hotspot installation on a RPi 3 including a captive portal and freeradius management: https://github.com/pihomeserver/Kupiki-Hotspot-Script

Stokestack
Posts: 45
Joined: Wed Aug 15, 2012 1:00 am

Re: Making Pi discoverable to Macs with Avahi isn't working.

Tue Jul 23, 2013 12:49 am

Thanks for the responses.
Mortimer wrote:When I installed Netatalk onto my Raspberry Pi last week, it showed up straight away in the Mac OS X Finder, without any additional software. In fact the site you linked to says (in paragraph 4) that all the stuff from about paragraph 5 onwards shouldn't be needed, which includes installing Avahi.
Actually, it says you don't need Netatalk:

"This is supported under Netatalk 2.2.3 but not in the version we’ve installed. Avahi can do this for us, but requires a bit more work"

I did that work (as described) because I need Avahi for something else anyway and don't want a bunch of redundant stuff running on such a limited system.

User avatar
Mortimer
Posts: 928
Joined: Sun Jun 10, 2012 3:57 pm

Re: Making Pi discoverable to Macs with Avahi isn't working.

Tue Jul 23, 2013 7:24 am

Sorry I don't agree. Yes you might want Avahi for something else, but Avahi on it's own is just a network discovery tool isn't it? It does nothing to install an AFP protocol stack, which is what Netatalk does. What the linked article says is that with version 2.2.3 of Netatalk, Avahi is not needed for basic network discovery. My Raspberry Pi has Netatalk v2.2.2 install, this has a dependency on Avahi, so ensured Avahi was installed anyway. This is what I think the article is saying:

The blog says that the bulk of the description is based on Netatalk 2.1.2. At that time, there was probably no dependancy on Avahi, so by installing Netatalk, Avahi wasn't installed Automatically. So the blog described how to install it manually.

Later they discovered that the current version is 2.2.3, and that installing that alone does the whole job. So the original blog is not below a line that says:
EDIT: The remainder of this post is now outdated and should not be required once you have installed netatalk.
The replacement blog entry is above this line, and simply states to install Netatalk.

As I said, mine worked and I only installed Netatalk. It maybe that in following the old blog entry you have created an inconsistency or incompatibility.
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

Stokestack
Posts: 45
Joined: Wed Aug 15, 2012 1:00 am

Re: Making Pi discoverable to Macs with Avahi isn't working.

Wed Jul 24, 2013 11:05 am

So I installed Netatalk as described at the top of that post, and rebooted.

Still doesn't work. The Mac can't see the Pi.

User avatar
Mortimer
Posts: 928
Joined: Sun Jun 10, 2012 3:57 pm

Re: Making Pi discoverable to Macs with Avahi isn't working.

Wed Jul 24, 2013 12:21 pm

I'll have a closer look tonight if I get the chance.
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Making Pi discoverable to Macs with Avahi isn't working.

Wed Jul 24, 2013 1:06 pm

Stokestack wrote:So I installed Netatalk as described at the top of that post, and rebooted.

Still doesn't work. The Mac can't see the Pi.
Out of curiosity - and to contrast it with my experience - does it fail:

1) Always
2) Sometimes
3) Never

For me, the answer is #2 (with no rhyme or reason as to when)
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
cyrano
Posts: 718
Joined: Wed Dec 05, 2012 11:48 pm
Location: Belgium

Re: Making Pi discoverable to Macs with Avahi isn't working.

Wed Jul 24, 2013 3:01 pm

Network discovery is limited to the LOCAL subnet. Any chance you're on TWO subnets? For instance wired on 10.0.1.X and wireless on 10.0.0.X?

Stokestack
Posts: 45
Joined: Wed Aug 15, 2012 1:00 am

Re: Making Pi discoverable to Macs with Avahi isn't working.

Wed Jul 24, 2013 8:58 pm

Thanks a lot for your responses.

It has never worked. Both devices are connected wirelessly to the same router, and I can ping the Pi from the Mac using its IP address. They're on the same subnet.

I thought I'd received a reply telling me to do something with afpd, but now I can't find that message. However, if do "which afpd", afpd is found. And Netatalk is starting up on boot.

Ah, found it. afpd -V returns a bunch of info.

AppleTalk and Zeroconf are supported... the only things with "no" for "support" are SLP, "Dropbox kludge", and "Force volume uid/gid".

User avatar
cyrano
Posts: 718
Joined: Wed Dec 05, 2012 11:48 pm
Location: Belgium

Re: Making Pi discoverable to Macs with Avahi isn't working.

Wed Jul 24, 2013 9:37 pm

Although this should be set automagically, have you set a legal hostname on the Pi?

Here's an idea what the host file should look like:
http://www.howtogeek.com/167195/how-to- ... -hostname/

I can't remember how I did it, but setting up the Pi was really simple. A lot of these things have become so evident that it's hard to see what could be wrong in your setup.

Stokestack
Posts: 45
Joined: Wed Aug 15, 2012 1:00 am

Re: Making Pi discoverable to Macs with Avahi isn't working.

Wed Jul 24, 2013 10:05 pm

Thanks. The name is valid ("pi256"). I already checked it in both hosts and hostnames.

I can connect to the Pi from the Mac using AFP if I manually type in the IP address, and the hostname is shown correctly in the Finder sidebar. But pi256.local never works.

User avatar
cyrano
Posts: 718
Joined: Wed Dec 05, 2012 11:48 pm
Location: Belgium

Re: Making Pi discoverable to Macs with Avahi isn't working.

Wed Jul 24, 2013 10:28 pm

Have you tried it without ".local"?

I haven't got any of my Pi's here, but I always connect with the name, no extension.

Also, have you used that name before, e.g. with a different SD card or another Pi?

And last, but not least, is your Mac's DNS pointing to the router's ip for DNS settings, or directly to the ip's of your provider's DNS?

User avatar
Mortimer
Posts: 928
Joined: Sun Jun 10, 2012 3:57 pm

Re: Making Pi discoverable to Macs with Avahi isn't working.

Wed Jul 24, 2013 10:34 pm

Just done a fresh install of Raspbian using a NOOBS build.

Ran

Code: Select all

sudo apt-get update && sudo apt-get install netatalk
.

As soon as the install had finished "raspberrypi" appeared in the "Shared" section of the Finder sidebar.

It just worked for me.

The Mac is a MacBook Pro 2,1 : 32-bit Core Duo based machine running Mac OS X 10.6.8.
It connects to the BT HomeHub 3 over wifi.
The Raspberry Pi also connects to the HomeHub over wifi.
They share the same subnet, and can ping each other as yours do.

I can use "ping raspberrypi" or "ping raspberrypi.local" from an Apple Terminal, both work.


I'm at a loss as to what else to suggest.
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

User avatar
Mortimer
Posts: 928
Joined: Sun Jun 10, 2012 3:57 pm

Re: Making Pi discoverable to Macs with Avahi isn't working.

Wed Jul 24, 2013 10:47 pm

Actually the DNS setting sounds like a possibility. For what it's worth, my DNS settings point to my router, not an external provider.
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

Stokestack
Posts: 45
Joined: Wed Aug 15, 2012 1:00 am

Re: Making Pi discoverable to Macs with Avahi isn't working.

Wed Jul 24, 2013 11:11 pm

I never set the DNS manually, and right now it's pointing to the router. The name without ".local" doesn't work either.

I also did a NOOBS install just a couple days ago. Didn't do the apt-get update, but I just did and rebooted and it still doesn't work.

This is typical. I always have the setup/product/whatever that doesn't work. I'd say it's getting pretty tiresome, but it got tiresome years ago. Thanks for the troubleshooting help though! I appreciate it.

User avatar
cyrano
Posts: 718
Joined: Wed Dec 05, 2012 11:48 pm
Location: Belgium

Re: Making Pi discoverable to Macs with Avahi isn't working.

Thu Jul 25, 2013 10:51 am

Which OSX version do you use?

Mortimer and I both use 10.6.8. I know some parts of Bonjour have been dropped by Apple in 10.7 and even more in 10.8. Also, the SSH and DNS behaviour are different.

User avatar
Mortimer
Posts: 928
Joined: Sun Jun 10, 2012 3:57 pm

Re: Making Pi discoverable to Macs with Avahi isn't working.

Thu Jul 25, 2013 11:24 am

My wife's laptop is running Snow Lion, so I'll see if that works as well later. I'm sticking to my ancient 32-bit MacBook Pro until I have saved up for a 15" retina MacBook Pro.
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

User avatar
Mortimer
Posts: 928
Joined: Sun Jun 10, 2012 3:57 pm

Re: Making Pi discoverable to Macs with Avahi isn't working.

Thu Jul 25, 2013 6:05 pm

Works just fine for me on my wife's 64-bit Core 2 Duo based 13" MacBook Pro running Mac OS X 10.8.4.
"raspberrypi" appears in the finder side bar, and I can connect and browse in just the same way.
I can also "ping raspberrypi" and "ping raspberry.local".

So... Sorry no more clues there!
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

Stokestack
Posts: 45
Joined: Wed Aug 15, 2012 1:00 am

Re: Making Pi discoverable to Macs with Avahi isn't working.

Fri Jul 26, 2013 1:39 am

Thanks a lot for investigating, anyway. I'm running the latest Mac OS. 10.8.4.

photoben
Posts: 6
Joined: Mon Aug 05, 2013 9:22 pm

Re: Making Pi discoverable to Macs with Avahi isn't working.

Mon Aug 05, 2013 9:28 pm

I'm trying to set up a NAS on my pi, and also having this problem.

Latest NOOB download (from today), after wheezy last week not working. I can access the pi codeline via Terminal, but I seem to have tried everything and my pi won't show up in finder. Even if I access it with the cmd+K and put in the same ip address that works in Terminal, it won't work ing finder.

Nightmare. Help!

Stokestack
Posts: 45
Joined: Wed Aug 15, 2012 1:00 am

Re: Making Pi discoverable to Macs with Avahi isn't working.

Tue Aug 06, 2013 8:57 am

I did a totally fresh install of the latest NOOBS, reformatting the SD card and starting over. Installed Netatalk as described, which also installs avahi-daemon. On boot, all the messages report success. But this thing simply doesn't work for auto-discovery.

However, I can connect using the IP address in Finder, so your problem is mysterious. Are you saying you can ping the Pi from the Mac command line, but not connect in Finder using afp://[IP address]?

photoben
Posts: 6
Joined: Mon Aug 05, 2013 9:22 pm

Re: Making Pi discoverable to Macs with Avahi isn't working.

Tue Aug 06, 2013 9:24 am

Weird, after four hours of faffing last night, logged into it last night no problem. Pi appears in finder! Using the cmd+K and inputing the IP address.

Next problem, I can't see the USB mounted hard drives in finder - although there are the USBHDD1 & USBHDD2 folders I created, but they are clearly on the SD card.

Thanks for your help.

User avatar
cyrano
Posts: 718
Joined: Wed Dec 05, 2012 11:48 pm
Location: Belgium

Re: Making Pi discoverable to Macs with Avahi isn't working.

Tue Aug 06, 2013 12:08 pm

photoben wrote:Weird, after four hours of faffing last night, logged into it last night no problem. Pi appears in finder! Using the cmd+K and inputing the IP address.
probably your router cleaned it's cache...
Next problem, I can't see the USB mounted hard drives in finder - although there are the USBHDD1 & USBHDD2 folders I created, but they are clearly on the SD card.
You need to share those with samba. Very simple setup here:

http://raspberrypihelp.net/tutorials/11 ... y-pi-samba

Return to “Beginners”