maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   mDNS support for Maemo 5 (https://talk.maemo.org/showthread.php?t=82397)

pali 2012-02-17 10:15

mDNS support for Maemo 5
 
Hi,

I created package mdns-support and pushed it into Extras-Devel. Package can be installed via HAM (search for mDNS). This package install & configure Maemo 5 system for mDNS support.

It install packages avahi-daemon libnss-mdns library and edit /etc/nsswitch.conf.

After installation is reboot required.

mDNS provide hostname resolving for domain .local. Every device which support mDNS have domain <hostname>.local. So when computer (with mDNS support) and Nokia N900 connect to wifi network, mDNS can be used for identifing network devices and resolving hostname to ip addresses. Usefull for SSH when DHCP server assigning random ip address.

So on computer I can ping Nokia N900 device with:
Code:

$ ping Nokia-N900.local
PING Nokia-N900.local (192.168.15.110) 56(84) bytes of data.
64 bytes from Nokia-N900.local (192.168.15.110): icmp_req=1 ttl=128 time=29.4 ms
64 bytes from Nokia-N900.local (192.168.15.110): icmp_req=2 ttl=128 time=51.1 ms
64 bytes from Nokia-N900.local (192.168.15.110): icmp_req=3 ttl=128 time=73.7 ms
...

And from N900 I can ping computer:
Code:

$ sudo ping Pali.local
PING Pali.local (192.168.15.107) 56(84) bytes of data.
64 bytes from Pali.local (192.168.15.107): icmp_req=1 ttl=128 time=96.6 ms
64 bytes from Pali.local (192.168.15.107): icmp_req=2 ttl=128 time=16.5 ms
64 bytes from Pali.local (192.168.15.107): icmp_req=3 ttl=128 time=42.0 ms
64 bytes from Pali.local (192.168.15.107): icmp_req=4 ttl=128 time=1.41 ms
...

I also fixed problem in avahi-daemon package (which create non working /etc/init.d/avahi-daemon script).

http://maemo.org/packages/view/mdns-support/
http://maemo.org/packages/view/libnss-mdns/
http://maemo.org/packages/view/avahi-daemon/

ForeverYoung 2012-02-23 20:50

Re: mDNS support for Maemo 5
 
Sometimes (or always), after boot, avahi-daemon not starting.
When I "sudo start avahi-daemon", it says about too frequent starting.
But if I "sudo avahi-daemon", it starts normally. Then Ctrl-C, and "sudo start avahi-daemon" now ok.

pali 2012-02-24 08:09

Re: mDNS support for Maemo 5
 
Try to uninstall and install again all avahi packages. In old version was some init.d bugs.

ukki 2012-02-24 08:49

Re: mDNS support for Maemo 5
 
Quote:

Originally Posted by pali (Post 1166152)
Hi,

I created package mdns-support and pushed it into Extras-Devel.

I like you.

ForeverYoung 2012-02-24 12:28

Re: mDNS support for Maemo 5
 
Quote:

Originally Posted by pali (Post 1169109)
Try to uninstall and install again all avahi packages. In old version was some init.d bugs.

I purged avahi-daemon and 2 other packages, reinstalled them.
But after reboot again - too fast respawning.

pali 2012-02-24 14:06

Re: mDNS support for Maemo 5
 
Try:
$ sudo start avahi-daemon
and write output from syslog (after command)

Also please write output:
$ ls -l -a /etc/init.d | grep -i avahi
$ ls -l -a /etc/event.d | grep -i avahi

ForeverYoung 2012-02-27 07:33

Re: mDNS support for Maemo 5
 
sudo start avahi-daemon - if some time passed after reboot - normal start. I think some service prevents start of avahi-daemon on startup (at least on my phone, many programs installed). Maybe it will be enough to start after hildon-desktop e.g., not after dbus.

Code:

[1|user@Nokia-N900|~]ls -l -a /etc/init.d | grep -i avahi
-rwxr-xr-x  1 root root  225 2012-02-16 17:06 avahi-daemon
-rwxr-xr-x  1 root root  2428 2009-03-24 16:06 avahi-dnsconfd
[1|user@Nokia-N900|~]ls -l -a /etc/event.d | grep -i avahi
-rw-r--r--  1 root root  176 2012-02-16 17:26 avahi-daemon


pali 2012-04-10 19:56

Re: mDNS support for Maemo 5
 
Ok, now I found problem why avahi-daemon is not starting. It is because upstart trying it start before /opt is mounted and avahi-daemon is optified.

I will fix it ASAP and push new version of avahi-daemon to extras-devel.

pali 2012-05-25 21:38

Re: mDNS support for Maemo 5
 
Package is fixed in extras-devel for a long time. But I do not have permissions to promote it to extras-testing and extras...

JadeH 2012-05-26 05:25

Re: mDNS support for Maemo 5
 
this is a cool package

Xagoln 2013-04-20 04:25

Re: mDNS support for Maemo 5
 
@pali, I've installed this on my n900 from the repos (-maemo5 package version) and rebooted my phone.

I then installed the Debian avahi/mdns packages on my laptop.

Neither is able to ping the .local address of its counterpart.

Running avahi-discover on my laptop, I can see only the laptop itself.

On the n900, 'ps -ef | grep avahi' shows two processes running okay. And the changes to the /etc/nsswitch.conf file look correct (same as the laptop).

Do you have any idea why it might not be working? I guess I can run tcpdump for multicast packets next, if need be.

Xagoln 2013-04-20 05:11

Re: mDNS support for Maemo 5
 
It actually worked, just once, from my laptop to the n900. Then it stopped working some minutes later, while I was testing from the other end.

Running 'tcpdump -i wlan0 -n multicast' on both ends shows requests being sent, but neither end receives the requests from the other.

I am beginning to suspect the router (which has really b0rked firmware, e.g. local dns lookups return the router's IP, even for non-existent addresses!).

Or possibly the radio in my n900 is dying, because it kept not being able to see the wlan.

pali 2013-04-20 07:52

Re: mDNS support for Maemo 5
 
check also firewall. mDNS using udp multicast port 5353.

iptables for ipv4:
Code:

sudo iptables -A INPUT -p udp -d 224.0.0.251 --dport 5353 -j ACCEPT
iptables for ipv6:
Code:

sudo iptables -A INPUT -p udp -d ff02::fb --dport 5353 -j ACCEPT
By default n900 does not use firewall, but all (desktop) linux distribution yes.

Xagoln 2013-04-22 01:43

Re: mDNS support for Maemo 5
 
Thanks pali. I'm running a server install of Debian Wheezy. My iptables look like this :

Code:

# iptables -L
Chain INPUT (policy ACCEPT)
target    prot opt source              destination

Chain FORWARD (policy ACCEPT)
target    prot opt source              destination

Chain OUTPUT (policy ACCEPT)
target    prot opt source              destination

;)

So it would seem this piece of junk Huawei HG556a router is to blame, even with the most recent firmware. I can't believe hw manufacturers can release such broken pieces of junk!

pali 2013-08-08 08:49

Re: mDNS support for Maemo 5
 
Please vote for extras-testing packages, so mDNS support can be promoted to Extras:
http://maemo.org/packages/package_in...s-support/0.1/
http://maemo.org/packages/package_in....10-3.1maemo1/
http://maemo.org/packages/package_in....6.24-0maemo5/
http://maemo.org/packages/package_in....6.24-0maemo5/
http://maemo.org/packages/package_in....6.24-0maemo5/


All times are GMT. The time now is 10:21.

vBulletin® Version 3.8.8