Friday 22 January 2010

MythTV - DSTV Channel Changer

LIRC

So the first step was to get LIRC up and running on Mythbuntu; this was quite easy as the default installation do enable lirc, I only selected " Enable an IR Transmitter" and selected a bogus Serial lirc device.

ir tx

This created all the relevant configuration files.

I then searched the net for the lircd.conf (remote command reference file) for my spesific decoder

digsat_uec-dsd-820_thb(DSD820 aka DSTV DualView Decoder).

 I did not find the spesific file but found one for the UEC DSD910 decoder.

digsat_uec-dsd-990_thb

The DSD910 remote file (general.conf):

#
# this config file was automatically generated
# using WinLIRC 0.6.5 (LIRC 0.6.1pre3) on Wed Sep 10 15:36:20 2003
#
# contributed by Guy Antony Halse <guy-lirc@rucus.ru.ac.za>
#
# brand:             Multichoice
# model:             DSD910
# supported devices: Digital Satellite Decoder (DSTV Decoder)
#
# Multichoice is a South African Satellite TV company offering their
# own branded decoders.

begin remote

  name  dsd910

  bits           13
  flags RC5|CONST_LENGTH
  eps            30
  aeps          100

  one           962   808
  zero          962   808
  plead         992
  gap          113485
  toggle_bit      2
      begin codes
          power                    0x000000000000160C
          red                      0x000000000000162C
          green                    0x000000000000162B
          yellow                   0x000000000000162A
          blue                     0x000000000000162E
          1                        0x0000000000001601
          2                        0x0000000000001602
          3                        0x0000000000001603
          4                        0x0000000000001604
          5                        0x0000000000001605
          6                        0x0000000000001606
          7                        0x0000000000001607
          8                        0x0000000000001608
          9                        0x0000000000001609
          0                        0x0000000000001600
          radio                    0x0000000000001625
          tv                       0x000000000000162F
          mute                     0x000000000000160D
          teletext                 0x0000000000001624
          information              0x000000000000162D
          up                       0x0000000000001612
          left                     0x000000000000161D
          ok                       0x0000000000001622
          right                    0x000000000000161E
          down                     0x0000000000001613
          menu                     0x000000000000161C
          exit                     0x0000000000001631
          tvguide                  0x0000000000001635
          progup                   0x0000000000001620
          progdn                   0x0000000000001621
          volup                    0x0000000000001610
          voldn                    0x0000000000001611
      end codes

end remote
 

This file was copied to the relevant directory in /var/lib/cache/lirc/....

The next step was to change the config in /etc/lirc/hardware.conf

#Chosen IR Transmitter
TRANSMITTER="dsd910"
TRANSMITTER_MODULES="lirc_dev lirc_serial"
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE="/dev/lirc0"
TRANSMITTER_LIRCD_CONF="dsd910/general.conf"
TRANSMITTER_LIRCD_ARGS=""

After that I started the lirc again:

sudo /etc/init.d/lirc start

This was then tested with the following command:

sudo irsend SEND_ONCE dsd910 information

This worked and showed the "information banner".
This was tested on TV1.

Still to do is to  add and test TV2 ir and to enable a change channel script in Mythbuntu.

Thursday 14 January 2010

Bind Dynamic DNS Updates

I saw a request to update Bind via a command line rather than Webmin for the ease and speed of a command line; So I embarked on investigating this.

Firstly it seems that there is not a lot of dynamic update or command line update scripts available or the people just don't want to share ???

I stumbled across nsupdate, an application that is part of the Bind suite.
This is a command line tool to add dynamic updates to an DNS server.

for this to work you need to update the specific zone file with at least the following configuration:

zone "example.com" {
type master;
file "/etc/bind/example.com.hosts";
allow-update {192.168.0.0/24; };
journal "/var/lib/bind/example.com.hosts.jnl";

};
For dynamic DNS you need:
allow-update
journal

then to add an entry to the DNS server:
from within the 192.168 ip range :

user@pc:~$ nsupdate
> zone example.com
> update add guest1.example.com. 86400 A 192.168.0.10
> send
> quit

your syslog on your DNS server will log all updates