lirc sky rflink howto

NB This Howto is around 5 years old, but its still linked to from some sources so I though I would keep it alive, the lirc bits are probably a little out of date by now

This howto is a quick description of how i got a pace rflink device (designed for TIVO) working on a standard RS232 serial port with lircd

Pace rf2link

The rf2link is a remote control extender for SKY and SKY+ systems that sends the control commands via the coax cable that is also used to send the picture to other televisions. These can be bought from http://www.pacelink.co.uk/rf2link.htm. These devices run of 9v power from the SKY/SKY+ box that can be switched on from the RF2 socket. Two varieties exist one of which allows the power to continue to the NEXT device along the coax and one that stops the power at the rf2link device, ONLY use the through power device IF you require the power at the next device, i.e. another remote extender. DO NOT ALLOW the 9v to reach your TV or your capture card! You have been warned!.

These are designed for a TIVO so two possibilities exist :-

1 – Cut off the jack plug
2 – Make a nice socket for the jack plug to plug in to

I chose number one. Next you will need some 1N4148 diodes or similar small signal diodes, a female DB9 socket and a plastic cover to mount the DB9 socket and hide away the 1N4148 diodes. These parts can be obtained from maplins http://www.maplin.co.uk or you local electronics shop.

Serial ports can signal from -9v to +9v (nominal) and can have voltages much lower than this. I assumed my serial port was 9v and used 4 diodes (0.6-0.7v drop per diode) and to stop the serial port putting any -ve voltages on the pacelink device.

DTR. -------->|---->|---->|----->|------- PACELINK Centre of cable

GND ---------------------------------------- PACELINK Ground of cable

The pace link device input drives into a 3.5k ish resistor so i suspect a few extra volts won’t hurt but their are a load of transistors next so i would not recommend any negative volts reaching them so a minimum of one diode always!.-

Lircd configuration

I have based my work on my Mandrake 10.1 (cooker actually) setup so *exact* configuration may vary, I can’t remember where exactly I got this file i think it might be a standard LIRC config file but here it is anyway-

#Copyright (C) 1999 Christoph Bartelmus
#You may only use this file if you make it available to others,
#i.e. if you send it to lirc@bartelmus.de
#
# this config file was automatically generated
# using lirc-0.6.4-CVS(serial) on Mon Jul  9 08:14:04 2001
#
# contributed by Steve Davies steve@daviesfam.org
# modified by Steve Hill steve@nexusuk.org 2003/06/29
#
# brand:                       sky
# model no. of remote control: 
# supported devices:              34000 20
#
#

begin remote

  name          SKY
  flags         CONST_LENGTH|RAW_CODES
  eps           30
  aeps          100
  ptrail        0
  repeat        0     0
  gap           149692
  frequency     36000
  duty_cycle    50

  begin raw_codes

    name 0
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444

    name 1
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      888

    name 2
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 888 888
      444

    name 3
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 888 444
      444

    name 4
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 888 888 444 444
      444

    name 5
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 888 888 888

    name 6
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 888 444 444 888
      444

    name 7
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 888 444 444 444
      444

    name 8
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 888 888 444 444 444 444
      444

    name 9
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 888 888 444 444 888

    name RED
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 888 444 444 888 888 444 444 888 888

    name GREEN
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 888 444 444 888 888 444 444 444 444 888 444

    name YELLOW
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 888 444 444 888 888 444 444 444 444 444 444

    name BLUE
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 888 444 444 444 444 888 444 444 444 444 444 444
      444

    name TEXT
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 444 444 888 444 444 444 444 444 444 888 444 444
      444

    name BACKUP
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 888 888 444 444 444 444 444 444 444 444 888 444 444

    name HELP
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 888 888 444 444 444 444 444 444 444 444 444 444 888

    name CURSOR-LEFT
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 888 888 888 444 444 888 888 888 444

    name CURSOR-DOWN
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 888 888 888 444 444 888 444 444 888

    name CURSOR-RIGHT
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 888 888 888 444 444 888 888 444 444

    name CURSOR-UP
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 888 888 888 444 444 888 444 444 444 444 444

    name SELECT
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 888 888 888 444 444 444 444 888 444 444 444

    name CHANNEL-DOWN
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 444 444 888 888 444 444 444 444 444 444 888

    name CHANNEL-UP
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 444 444 888 888 444 444 444 444 444 444 444 444
      444

    name I
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 888 444 444 888 444 444 888 888 888 444 444

    name ONOFF
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 888 444 444 888 444 444
      444

    name TV
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 888 888 444 444 444 444 444 444 888 888 444 444 444

    name SKY
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 888 888 444 444 444 444 444 444 444 444 444 444 444 444
      444

    name TVGUIDE
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 888 444 444 888 444 444 888 444 444 888 444 444 444

    name BOXOFFICE
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 888 444 444 444 444 444 444 444 444 888 888

    name SERVICES
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 444 444 888 444 444 444 444 444 444 444 444 444 444 888
      444

    name INTERACTIVE
      2664 888 444 444 444 444 444 888 444 888 888 444 444 444 444 444
      444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444
      444 444 888 444 444 444 444 444 444 888 888 888 888

  end raw_codes

end remote

Channel changer

Ok this is the script i used for changing channels. The original author of this script is Steve (2nd name unknown) and the script can be found at his page http://nexusuk.org/projects/mythtv/lirc/ I have made some mods as the script would not work for me out of the box for me at least.

skychannel.sh

#!/bin/sh

# For channels from 100 - 999 just request a channel number, for channels
# > 1000, select a channel from the "other channels" list.
# Channels < 100 get a 1 (and maybe a 0) glued on the front

export PATH=$PATH:/usr/local/bin

declare -i channel
channel=$1

if [ "$channel" -lt "100" ]; then
 $channel=`printf '1%02i' $channel`
fi

RV=$?

if [ "$channel" -lt "1000" ]; then
 declare -i digit1
 declare -i digit2
 declare -i digit3
 digit1=$channel/100
 digit2=$channel/10
 digit2=$digit2%10
 digit3=$channel%10
 rc SEND_ONCE sky sky backup $digit1 $digit2 $digit3
else
 channel=$channel-1000
 rc SEND_ONCE sky_tx sky
 rc SEND_ONCE sky_tx services
 rc SEND_ONCE sky_tx 6
 while [ "$channel" -gt "0" ]; do
  rc SEND_ONCE sky_tx down
  channel=$channel-1
 done
 rc SEND_ONCE sky_tx select
fi

Starting lircd

In my /etc/sysconfig/lircd file i have the following variables set

DRIVER=default

HWMOD=lirc_serial

DEVICE=/dev/lirc/0

COM_PORT=/dev/ttyS0

DRIVER_OPTS="irq=4 io=0x3f8 type=0"

This is used in the mandrake setup when the /etc/init.d/lircd start is called what this achieves is that a

setserial $ uart none

is called to set up the serial port then a

modprobe $ $ > /dev/null

is done. Followed by

daemon lircd --driver=default --device=/dev/lirc/0

The modprobe lirc_serial loads the lirc serial driver and this patches itself into /dev/lirc/0 (or the next available) the lirc daemon has to be told which device driver to connect to.
Lircd is now up!

Turning on the RF2 output

To enable the engineers menu press services on the sky control, select system set up then press “0”,”1″,”SELECT” and you will be in the engineers menu. The options you want are RF Outlets where you can turn the power on to RF2 and set the output channel.

Leave a Reply