2

I have installed lighttpd on my RPI 3 :

sudo apt-get install lighttpd

I have managed to access the web server from /home/pi/www And it works, I can find my Hello World when I entered 192.168.2.31 in my URL browser.

Now I try to access my raspberry pi through mDns. In this way I have installed AVAHI :

sudo apt-get install avahi-daemon libavahi-client-dev

I have modified my hostname :

Sudo raspi-config

and then select Network option then select Hostname then I have called it raspberrypik

I have updated my reboot system :

sudo update-rc.d avahi-daemon defaults

Now I try to access my web server from my browser, from either Windows 10 where Itunes is installed and my smartphone (I shared the Hotspot of my cellphone with the RPI) by typing raspberrypik.local but nothing happen.

Some tutorials use AVAHI to get acces on the RPI through SSH. I tried to access my RPI via SSH with raspberrypik.local, but nothing...

I have tried what is indicated in this post : How to debug avahi-daemon? Hostname not coming through

But when I do

$ ls -l /etc/avahi/services/
total 4
-rw-r--r-- 1 root root 243 Aug  2 05:53 ssh.service

The folder multiple.service and udisks.service are not present, is it normal ?

When I do :

$ avahi-browse -a
-bash: avahi-browse: command not found

When I ping I get :

~ $ ping -c 4 raspberrypik
PING raspberrypik (127.0.1.1) 56(84) bytes of data.
64 bytes from raspberrypik (127.0.1.1): icmp_seq=1 ttl=64 time=0.108 ms
64 bytes from raspberrypik (127.0.1.1): icmp_seq=2 ttl=64 time=0.076 ms
64 bytes from raspberrypik (127.0.1.1): icmp_seq=3 ttl=64 time=0.098 ms
64 bytes from raspberrypik (127.0.1.1): icmp_seq=4 ttl=64 time=0.104 ms

--- raspberrypik ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3098ms
rtt min/avg/max/mdev = 0.076/0.096/0.108/0.015 ms

Now if I follow the post I get :

~ $ avahi-resolve
-bash: avahi-resolve: command not found

And finally :

~ $ tcpdump -i wlan0 port 5353 or igmp -w /tmp/mdns.pcap
-bash: tcpdump: command not found

Ok I do things wrong, but where ??

Thank you for your help

  • Is there a DHCP server running on your network? – Ingo Aug 3 '18 at 21:49
  • 1
    No I don't think, the IP address is attributed by the router of the room. Do you have any idea about my problem ? – FrancNovation Aug 7 '18 at 9:44
  • No not really. One idea was that there is a DHCP server. Then avahi will not configure a link-local address from address block 169.254.0.0/16. With avahi-tools you have installed now you can browse and discover services. Maybe you have to use them with sudo. To use tcpdump you have to install it with sudo apt install tcpdump and has to run with sudo. If avahi has configured a link-local address then you address your RasPi with raspberrypik.local. Look with ip addr what ip address your RasPi has. – Ingo Aug 7 '18 at 10:25
  • Ping the RasPi from your Windows pc. Local ping as you did always work with response from local ip address 127.0.1.1 defined in /etc/hosts. – Ingo Aug 7 '18 at 10:27
  • Thank you for your help. I looked at ip addr and it displays the WANL0 with the IP address attributed by the DHCP of the router. I have watched the content of the folder /etc/hosts and it contains this : 27.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters 127.0.1.1 raspberrypik . Eventually, I ping raspberrypik (and raspberrypik.local) from windows connected to the same network and nothing .... – FrancNovation Aug 7 '18 at 14:48
0

Some suggestions:

I have updated my reboot system sudo update-rc.d...

This is an obsolete or at least depreciated methodology on current versions of Raspbian and GNU/Linux generally. Instead:

systemctl list-unit-files "*avahi*"

Should give you the service name, then:

sudo systemctl enable [avahi.service]

Or whatever the correct name is there.

-bash: avahi-browse: command not found

To search packages for a specific executable command:

sudo apt install apt-file
apt-file search "bin/avahi-browse"

I think you will find this is in the avahi-utils package, which is probably not a dependency for any of the other avahi packages you installed.

tcpdump: command not found

Same thing:

apt-file search "bin/tcpdump"
  • To search for unit files I would prefer systemctl list-unit-files *avahi* you also see the status. – Ingo Aug 3 '18 at 21:44
  • @Ingo Thanks, I wasn't aware of that one -- just that plain list-units only includes things "currently in memory". Also hadn't noticed most of that stuff accepts glob patterns! – goldilocks Aug 4 '18 at 9:40
  • @goldilocks thank you a lot ! I have installed the packages avahi-utils but now how can I do to get mDns working ? – FrancNovation Aug 7 '18 at 9:39
  • Enable the systemd service. I actually don't use avahi, but I believe based on what people have said about it here that it should be pretty easy. – goldilocks Aug 7 '18 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.