SwissCenter UPnP/SSDP Broadcast Script for PopcornHour A-100

This script is to ensure that the PopcornHour A-100 (and possibly all other Syabas-based devices) discovers a SwissCenter server. It works by detecting the UPnP SERVER response for A-100 and sending a URL request.

This script is based on the original broadcast.pl included with SwissCenter.

Changes by Keith Solomon – 09/11/2008

Download Package


SwissCenter UPnP/SSDP Broadcast Script

Supported Devices


The script should work for any Network media Tank media streamer device. It has been verified to work on the following devices:

PopcornHour A-100
PopcornHour A-110
PopcornHour B-110
NetGear EVA700

The Problem


The original broadcast.pl script as supplied doesn’t work with the PopcornHour A-100. It sees the responses sent from the A-100, but it doesn’t act on them. After much debugging and trial and error, I finally found a response code that would cause the A-100 to see a SwissCenter install on Linux (Ubuntu 8.04 “Hardy Heron” in my case).

On line 47, we find the following code in the original broadcast.pl:

if ($data =~ /USN: uuid:myiBoxUPnP::upnp:rootdevice/) {

This line looks for a upnp:rootdevice response, but the A-100 never returns this response. After running through roughly 10 hours of logged output from the broadcast.pl script, I noticed that every multicast packet coming in from the A-100 carried the same “SERVER” response. Taking a stab in the dark, I modified line 47 to read:

if ($data =~ /SERVER: UCosII, UPnP\/1.0, Syabas myiBox UPnP-stack, v1.0/) {

After this change, my A-100 immediately discovered my SwissCenter install, and showed it on the Sources page. It might work for any Syabas-based NMT, but as I only have the PopcornHour A-100, it’s the only device I can say with 100% certainty it works.

How To Use


  1. Put the broadcast.pl file somewhere where you can find it. Mine is in /ext/broadcast, with a symbolic link to /usr/local/bin/broadcast. Wherever you put it, make sure it’s executable (chmod +x broadcast.pl). You can also place this file on a different machine in your network as long as you configure your SwissCenter’s server address in the next step correctly and it has the required Perl modules.
  2. Edit the broadcast.pl script to configure it for your server. Find the line “### BEGIN SCRIPT CONFIG ###”, and change the two variable declarations below it to fit your needs. The address must be in <address>:<port> format. The default port (unless you changed it when you set up SwissCeneter) is 8080. The host variable can be anything you like.
  3. Copy the broadcast init script to /etc/init.d (you’ll need to be root or use sudo for this step).
  4. Create two links as follows. You can copy and paste for these, but you must be root or use sudo. These will work for Ubuntu and Debian for sure; other *nix flavors, you may or may not need to adjust these…check your /etc directory to be sure:

    ln -s /etc/init.d/broadcast /etc/rc2.d/S25broadcast
    ln -s /etc/init.d/broadcast /etc/rc0.d/K25broadcast
    

    These setup the script to run at boot, and shutdown gracefully.

  5. As root (or using sudo), issue the following command to start the broadcast daemon:

    /etc/init.d/broadcast start
    

That’s it. You should now be able to find your SwissCenter on the Sources screen of the A-100 interface. As I said in the beginning, It might (should?) work for other Syabas-based devices, but I have no way to test them. If you have a Syabas device other than the PopcornHour and this script works for you, please let me know, and I’ll add the device to the list of supported devices.

To discuss this script, please use this forum thread SwissCenter on Linux UPnP Broadcast Script

Comments are closed.