I have RaspBMC installed on Raspberry Pi, XBMC on Window laptop and UPnPlay on my Android device. Raspberry Pi is always on and is designed to work as a server for the system.
Accepted IP Addresses:
192.168.0.18: RPi
192.168.0.13: Notebook
192.168.0.1: Router
When I connect my Android device to Wi-Fi and turn on UPnPlay or launch XBMC on my laptop, there would be a delay of 5-10 minutes before the Raspberry Pi appears in the list of devices. However, over the past few weeks, Pi does not appear at all unless I restart it while other services are running (XBMC or UPnPlay). I can use ssh and sftp for Pi and access the RaspBMC web interface from both devices without problems.
Is it possible that UPnP network discovery / announcement messages are lost or blocked in some way? How would I research this? My knowledge of networking is limited to port forwarding.
I am open to suggestions of alternative protocols for UPnP - this is the simple first one I came across, and it worked great on my previous setup (XBMC on a desktop computer sending media to Apple TV).
EDIT:
Some analyzes with Wireshark on the laptop show that the laptop behaves as expected - sending M-SEARCH and NOTIFY packets at regular intervals over SSDP up to 239.255.255.250 (which, I believe, is a multicast address). However, RPi does not respond to these packets with unicast packets (as Wikipedia suggests), but it also does not send any SSDP packets other than downloading.
I am very new to Wireshark and network analysis in general, but I am very grateful for any recommendations or advice you can give.
The Wireshark filter that I used was "(udp.dstport == 1900 or ip.addr == 192.168.0.18) and! (Ip.src == 192.168.0.1)", where 192.168.0.18 is my RPi address - I I think this is correct, but, as I said, I am very new to Wireshark - please correct me if I made a mistake! In particular, I assumed that the RPi multicast response to M-SEARCH would have ip.src = 192.168.0.18, but I'm not sure about that (maybe it could be 192.168.0.1 or 239.255.255.250)
EDIT 2:
Guided by this post , I ran /sbin/route -n and got the following output.
pi@raspbmc:~$ /sbin/route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
I donโt know how to interpret this, but judging by the other comments of the related stream, it seems that there is no record for multicast. Again, following these related flow tips, I ran sudo route add -net 239.0.0.0 netmask 255.0.0.0 eth0 , added it to /etc/rc.local and restarted RPi - however, Pi still does not appear in the list of network devices for UPnP clients. I also tried using 239.255.255.250 as the multicast address (see the "Editing 1" section above), resulting in a route: netmask doesn't match route address error.
Again, guided by a related message, I started tshark and ran sudo tshark -i et0 multicast | grep 192.168.0.18 sudo tshark -i et0 multicast | grep 192.168.0.18 (I added grep since I saw a lot of traffic between other devices on the network).
Here is the conclusion.
RPi sends a cluster from NOTIFY packets, but very rarely (this entry takes almost 20 minutes, and only two clusters are sent). I believe that ARP packets are described below, implying that some devices lack MAC addresses for other devices on the network. While this is potentially troubling (some devices ask for the same address more than once โ why do they โforgetโ it?), It may be more troubling about the inaccuracy with which these packets are sent, and the fact that even when they are sent, clients in networks still don't pick up RPi.
So, we summarize:
RPi sends NOTIFY packets, but very rarely. Is there any way to control this?
Even when RPi sends NOTIFY packets (in the normal course of events, and not during loading), clients on the network do not get stuck in its existence.
RPi does not seem to respond to M-SEARCH packets sent from other devices.