Know what a Set-Top-Box is ? By this time everybody should know. This little box you plug to your TV so you can see video channels or VoD (Video On Demand) streamed from another computer or from your ISP.

We had a project at work about replacing TV in almost every office, connected to coaxial cable, by a network based system. This have two advantages, and only one drawbacks :

  • It is netwok based and you are not limited with the number of channel
  • You can also watch TV on your desktop or laptop computer, no need to have a TV
  • It is nework based, so you need a real good network


As you understand, the last point is the bad side of the change. For my company it was a pain as ethernet cables had to be changed… $$$$

Then we had a buch of Anevia Flamingo/Sunbird to stream TV channels from satellite or internal broadcasts. These appliances are pretty cool, not that expensive, and almost reliable. I’m waiting for the new firmware so we will have access t new features, as SNMP for monitoring. This way we have almost 50 TV channels from all around the world.

Finaly, we installed VLC player on every desktop, with a SAP server for broadcasting channel lists.
The last part was giving a Set Top Box (STB) to every people using a TV (almost journalists).

The first choice was Amino STB. Amino 103

This is once again small and easy to use. At first….
Where it comes tricky is when you have to configure 100 of these at the same time. For that you have multiple choices : tftp, multicast tool, telnet or using the « web » interface with a infra-red keyboard.

One thing you can do is power up your 100 Amino and use the IR keyboard. Then the IR commands will reach every STB and they all be configured identicaly at the same time.

This is, of course, not the best solution.

Another solution we had since then was using a home made Python script to change the config (mainly the IP config and the channel list) of one Amino at the time.
You just have to start a dhcp server, plug-in the Amino, get it’s IP from the DHCP lease and start the script with the IP in parameter. The script then connect with telnet (Login : root, Pass : root2root by default) and update the conf files (located in /mnt/nv) to set a static IP and the list of channels.
Why do we set static IP’s ? Because our multicast network for TV is not connected to the rest of the network and have no server (DHCP) on it.

This solution have 2 main drawbacks :

  1. the IP is static, we have to increase it every time we setup a new Amino, and remember it
  2. The channel list is also static

This is really a pain if you want to upgrade something once the amino is on production. This solution still have a benefit : knowing the IP enables you to search for it’s location or state.
We had last week a « stolen » Amino. We quickly found that the IP of the amino was still present on the network and been able to get it back. In fact, I think we didn’t. We were not looking for the right one. One amino was really stolen….

While we heard it was possible to configure the Amino with a DHCP server plus a web page, we had no documentation on how to do this. I found few things on Internet, like dhcpd.conf files, but none of them was working.
I finaly got one working fine with ISC DHCPD server (v4). And this is the purpose of this article. You will see this is pretty easy when you have the right information.

First, compile ISC DHCPD. This ain’t so hard, but the damn awfull ISC documentation won’t help you much. See my other post on DHCPD failover if you need this.

Change the configuration to add you IPs pool and the special Amino options :

# options for amino set-top-box
option space AMINO;
option AMINO.address    code 1 = ip-address;
option AMINO.port       code 2 = integer 16;
option AMINO.product    code 3 = text;
option AMINO.option     code 4 = text;
option AMINO.version    code 5 = text;
option AMINO.middleware code 6 = ip-address;
option AMINO.mw_port    code 7 = integer 16;
option AMINO.homepage   code 8 = text;
option AMINO.dindex     code 9 = integer 32;
option AMINO.dindex_min code 10 = integer 32;
option AMINO.dindex_page        code 11 = text;

# declaration des groupes de set top box amino 110
class "AmiNET110 all" {
# match if (option vendor-class-identifier="insecureAmiNET11xmboot1.32") or
# (option vendor-class-identifier="Aminoaminet110fisys");

match if (option vendor-class-identifier="Aminoaminet110fisys") or
((substring( option vendor-encapsulated-options, 2, 9)="aminet110")
and (substring(option vendor-encapsulated-options, 13, 5)="fisys"));

vendor-option-space AMINO;
option AMINO.homepage "http://172.16.12.41/portal/tv.html";
}

This needs explanations :

Options are just the list of possible option you will use, and theire type
the Match part is used to tell the DHCP to give the option only if the client is an Amino. Depending on your Amino flash it may not claim himself as Aminoaminet110fisys. Just use a tcpdump like application to trace that. If you have 103, you may change this also. You will find a sample dhcpd conf on the VLC forum.

The option AMINO.homepage should define a web page the amino can reach.

For the pool, still in the dhcpd.conf file :

shared-network IPTV {
subnet 172.20.0.0 netmask 255.255.252.0 {
option subnet-mask 255.255.252.0;
option domain-name "groupertl.net";
option domain-name-servers 172.16.12.10;
option routers 172.20.3.254;
option broadcast-address 172.20.3.255;
option ntp-servers 172.16.12.22;
pool {
failover peer "dhcp-failover";
deny dynamic bootp clients;
range 172.20.2.70 172.20.2.250;
allow members of "AmiNET110 all";
}
}
}

The failover line is to use only if you use failover. Everything else is self-explanatory.

Then comes the tricky part. The HTTP web page giving the channels list. I finaly chose to use a dynamic generation of the page using a json table. This will change as soon as we have a Django provisionning tool for that, which will generate a static page when needed. Our dev team will also try to add overlay, channel name, programs… but that’s another story. I even don’t know if the Amino can handle that :)

So here we go :








 






Once again this is pretty simple :

  • Create a json table. id is the id channel, nom is the name of the channel, uri is the URL and logo is the html path for the channel's logo.
  • use a for loop to add a ASTB.SetChannel line for each channel
    ASTB.SetChannel(channelID, channelURL), like : ASTB.SetChannel(1,igmp://239.1.1.1:1234)
  • use another loop to create a pretty page with channel's logo

And there you go.

Please, comment :)