KnoppMyth downloads | documentation | HowTo | reporting bugs | links | Recent Changes  
search for in the  

What is a Wiki?

See WikiWikiWeb

If you don't know how to use a wiki see the WikiHowto

ErfurtWiki is maintained by a loosely knit group of developers.

Quick Links

Related sites

Contact

Please submit website bugs in the BugReports

Contribute!

Please file any wishes on UserSuggestions.

Hosted By

Setting up KnoppMyth with one or more Hauppauge PVR-150 Cards using Dish Network or other Set Top Box

First, thanks to Mark who pointed me in the right direction at his site: http://www.blushingpenguin.com/mark/blog/?p=24

Reference System: KnoppMyth R5C7 with 2 Dish Network (Echostar) set top boxes running on two seperate Hauppauge PVR-150 PCI Cards (*NOT* the MCE version which does not have the IR Blaster)

Setting up KnoppMyth to use a set top box with the Hauppauge PVR-150's IR Blaster is actually pretty simple but there seems to be a lack of directions on exactly what needs to be done. Hopefully this will shed some light.

First of all, KnoppMyth already has lircd installed and running and should have already installed the drivers for the IR Blaster on the PVR-150. You can confirm this by checking for /dev/lircd. You should also see /dev/lirc and if you have a second PVR-150, you should see /dev/lirc1 (but you wont see an lircd1 at this time - we'll fix that later).

Step One

Make sure the lirc_pvr150 module is loading (needed for R5F27).

In some KnoppMyth distributions (like R5F27), lirc_i2c is loaded instead of lirc_pvr150. lirc_pvr150 is needed for the IR Blaster to work. To use lirc_pvr150, change following line in /etc/lirc/hardware.conf from:

MODULES="lirc_dev lirc_i2c"

to

MODULES="lirc_dev lirc_pvr150"

and reboot.

Step Two

Grab the latest firmware file. You can find a copy over at Mark's blog: http://www.blushingpenguin.com/mark/lmilk/haup-ir-blaster.bin

Note that this loads the firmware into RAM so it will increase your RAM usage. The alternative would be throwing the card in a windows machine and flashing it using Hauppauge's utilities.

Place that file in /usr/lib/hotplug/firmware on your KnoppMyth system and reboot. This step may be able to be skipped but there are some versions of the cards that have issues with IR lock ups or erratic performance.

While you are grabbing files from that site, also grab the latest lircd.conf file that goes along with the latest firmware.

http://www.blushingpenguin.com/mark/lmilk/lircd.conf

Backup the existing config file located at /etc/lircd/lircd.conf and replace it with the new one.

Step Three

We need to find the codeset that your set top box uses. If you need to find your code set, check out the blog listed at the top of this wiki and look at step #9. He has a script that you can download and use to find the code set for your set top box.

http://www.blushingpenguin.com/mark/lmilk/send_power_new

It runs through hundreds of codes and sends a power command to your set-top box. If you run the script and your STB turns on or off, you know everything up to this point is correct.

You then have to narrow down which code you need to use. I did it by copying the "send_power_new" script 5 or 6 times, renaming them "send_power_new_a", "send_power_new_b", etc., then editing so each contained about 100 codes. Keep going like that until you have it narrowed down to a handful, then just send some individually in a terminal window until you have your exact code set. For my Verizon FIOS set-top box it ended up being code set 0_80.

You can then either edit your lircd.conf file to contain ONLY the code set you need, or use a modified version of the channel-change script below. If you choose to edit lircd.conf, you also need to edit the names of the keys so that they're just called, for instance, 1 and not 1_28_KEY_1. Again, the modified channel-change script handles this for you so you don't need to edit lircd.conf.

If you have Dish Network tuner(s), then here is what you need in your lircd.conf file. For my Dish Network / Echostar units, I used code set 1_28.:

--- Begin file insert ---

begin remote

  name          blaster
  bits          32
  flags         RAW_CODES
  eps           0
  aeps          0
  plead         0
  gap           333333
  repeat_bit    0

  begin raw_codes
    name 0
    2149318656
    name 1
    2149318657
    name 2
    2149318658
    name 3
    2149318659
    name 4
    2149318660
    name 5
    2149318661
    name 6
    2149318662
    name 7
    2149318663
    name 8
    2149318664
    name 9
    2149318665
    name POWER
    2149318666
    name CH_UP
    2149318671
    name CH_DOWN
    2149318672
    name MUTE
    2149318673
    name VOL_DOWN
    2149318674
    name CH_PREVIOUS
    2149318675
    name VOL_UP
    2149318676
    name DISPLAY
    2149318677
    name EXIT
    2149318680
    name GUIDE
    2149318683
    name SELECT
    2149318686
    name AV
    2149318697
    name ENTER
    2149318699
    name MENU
    2149318703
    name MUP
    2149318704
    name MDOWN
    2149318705
    name MLEFT
    2149318706
    name MRIGHT
    2149318707
  end raw_codes

end remote

--- End File Insert ---

If you did the installation of KnoppMyth correctly and told the installer what remote you had, your remote control and IR receiver should already be up and running.

Step Four

We're actually almost done if you have only one tuner. All that is needed now is to have a script that mythtv can point to when it needs to change the channel. Again, Mark wrote a great script that works well. Paste this into a file called "change_channel" or something else that makes you happy and do "chmod +x change_channel". A good location for this script would be /usr/local/bin. Make sure your mythtv user has access to this script.

Note that the script below needs to be edited for recent KnoppMyth versions, as irsend has moved. The new path is /usr/bin/irsend

--- Begin Script ---
#!/usr/bin/perl

# make sure to set this string to
# the corresponding remote in /etc/lircd.conf
$remote_name = "blaster";

# Let's assume you don't need to press enter after you punch in a
# channel number. Change this to 1 if your cable box expects you press
# enter after each command
$needs_enter = 0;

# Change this to point to your rc executable
$rc_command = "/usr/local/bin/irsend";

# This subroutine actually sends the signal to the cable box
sub change_SIGNAL {
    my($SIGNAL) = @_;
    system ("$rc_command SEND_ONCE $remote_name $SIGNAL");
}

$SIGNAL=$ARGV[0];
open F, ">> /var/log/channel.log";
print F "channel changing $SIGNAL\n";
close F;
print "channel changing $SIGNAL\n";

# Checks if $SIGNAL begins with a digit
# If it detects that the string is made up of digits, then it puts
# spaces between the digits.  Ex. 1234 becomes 1 2 3 4
if ( $SIGNAL =~ /^\d+$/ )
{
    my $length = length($SIGNAL);
    my $counter = 0;
    my $temp;

    while( $counter < $length )
    {
        $temp .= substr($SIGNAL,$counter,1) ." ";
        $counter++;
    }

    change_SIGNAL($temp);
}
else
{
    # argument we passed was not made up of digits, so it must be a
    # command that does something other than channel changing on the
    # cable box
    change_SIGNAL($SIGNAL);
}

# Do we need to send enter
if ( $needs_enter )
{
    system ("$rc_command SEND_ONCE $remote_name ENTER");
}

--- End Script ---

If your set top box needs an enter key pressed after a channel is entered, change the appropriate value to "1" in the script instead of "0" ... For Dish Network, 0 works fine.

ALTERNATIVE SCRIPT

This alternative script doesn't require you to edit lircd.conf. You just have to edit the script to include the code set number you need to use for your set-top box.

This modified script found in the KM forum thread: http://mysettopbox.tv/phpBB2/viewtopic.php?p=82965#82965

--- Begin Script ---
#!/usr/bin/perl
# added codeset configuration - 2006-08-14 Russell Salerno
#
# make sure to set this string to
# the corresponding remote in /etc/lircd.conf
$remote_name = "blaster";

# Let's assume you don't need to press enter after you punch in a
# channel number. Change this to 1 if your cable box expects you press
# enter after each command
$needs_enter = 0;

# Change this to point to your rc executable
$rc_command = "/usr/bin/irsend";

# Change this to your codeset prefix
$codeset = "0_41_KEY_";

# This subroutine actually sends the signal to the cable box
sub change_SIGNAL {
    my($SIGNAL) = @_;
#    print "$SIGNAL\n";
#    print "$rc_command SEND_ONCE $remote_name $SIGNAL\n";
    system ("$rc_command SEND_ONCE $remote_name $SIGNAL");
}

$SIGNAL=$ARGV[0];
open F, ">> /var/log/channel.log";
print F "channel changing $SIGNAL\n";
close F;
print "channel changing $SIGNAL\n";

# Checks if $SIGNAL begins with a digit
# If it detects that the string is made up of digits, then it puts
# spaces between the digits.  Ex. 1234 becomes 1 2 3 4
if ( $SIGNAL =~ /^\d+$/ )
{
    my $length = length($SIGNAL);
    my $counter = 0;
    my $temp;

    while( $counter < $length )
    {
        $temp .= "$codeset" . substr($SIGNAL,$counter,1) ." ";
        $counter++;
    }

    change_SIGNAL($temp);
}
else
{
    # argument we passed was not made up of digits, so it must be a
    # command that does something other than channel changing on the
    # cable box
    change_SIGNAL($codeset . $SIGNAL);
}

# Do we need to send enter
if ( $needs_enter )
{
    system ("$rc_command SEND_ONCE $remote_name $codeset" . "ENTER");
}
--- End Script ---

Step Five

Test your script. Simply do a "/usr/local/bin/change_channel xxx" where xxx is a valid channel number on your set top box. With a little luck, your set top box will change channels.

If your script changes the channel without issue, you're set. Now just tell MythTV to use the script when it needs to change the channel. Run mythtv-setup and go to the Input Connections and in the appropriate tuner fill in the blank for the script to change channels. Just put "/usr/local/bin/change_channel" and MythTV will automatically append the channel number each time it is needed.

Stop here unless you have more than one tuner

Step Six

If you have more than one tuner, you'll need to create a seperate PID for the second PVR-150 card. You do NOT need a seperate configuration file. If you only have one tuner, what are you doing reading this section? :)

Creating the second PID is rather simple. This command will start another process of lircd without affecting the first.

/usr/sbin/lircd --device=/dev/lirc1 --output=/dev/lircd1 --pidfile=/var/run/lircd1.pid

This is dependant on the fact that /dev/lirc1 is already created -- If KnoppMyth was installed properly, it should have already detected your second PVR-150 and created that device. If this command worked properly, you should now see a /dev/lircd1 device.

Step Seven

Now you need to create a separate change channel script for this tuner. Just copy the change_channel script you created above to something such as change_channel_1 and do a chmod +x on it as well. Edit the file and change the $rc_command line to this:

$rc_command = "/usr/local/bin/irsend --device=/dev/lircd1";

Step Eight

Tell the second tuner to use this script when changing channels the same way we did in Step Four above

Step Nine

Now you probably want KnoppMyth to start the second instance of lircd on boot. To do that, create /etc/init.d/lirc1 and include these 2 lines:

#! /bin/sh
/usr/sbin/lircd --device=/dev/lirc1 --output=/dev/lircd1 --pidfile=/var/run/lircd1.pid

Do a chmod +x on this file and now tell the system to export it to all run levels by doing "update-rc.d lirc1 defaults".

Note: if you are having problems with tinny PVR-150 audio when using the audio line input and a set-top box, after you've set up your channel change script from the above, go to the TinnyAudioPVR150 page.

--
Howto by bibleboy @ 3:31am EDT 07/07/06
Edited by Bigbro @ 16:50 PT 09/18/06 -Fixed the ARG statement syntax. 
  Wikimarkup made the bracket 0 bracket appear incorrectly. 
  inserted a tilde infront of first bracket.  Works with R5C7!
Edited by RBucci @ 7:59 ET 10/15/07 - Added new Step 1 for R5F27.


UpdatedPages

· WhatRemoteYouUse last changed on Sat Jul 31 10:46:47 2010
· WhatCardYouUse last changed on Sat Jul 31 10:45:00 2010
· TinnyAudioPVR150 last changed on Fri Jul 30 03:20:30 2010
· KnoppMythWiki last changed on Thu Jul 29 04:35:17 2010
· HowTo last changed on Wed Jul 28 09:27:02 2010
· HardwareAcceleratedVideo last changed on Tue Jul 27 09:15:10 2010
· MythVodkaHowTo last changed on Tue Jul 27 09:14:04 2010
· DisklessFrontend last changed on Tue Jul 27 09:13:29 2010
· CompileMythTVFromSVN last changed on Tue Jul 27 07:39:28 2010
· MythMusic last changed on Tue Jul 27 07:38:00 2010
· RRD Disk Partition Usage last changed on Sun Jul 25 21:34:12 2010
· UserSuggestions last changed on Sun Jul 25 16:25:51 2010
· Links last changed on Sun Jul 25 16:21:33 2010
· KnoppmythDownloads last changed on Sun Jul 25 14:02:11 2010
· KnoppMythInstall last changed on Sun Jul 25 14:00:46 2010
· TroubleShooting last changed on Wed Jul 21 07:03:13 2010
· webminhowto last changed on Mon Jul 19 07:34:28 2010
· PickingComponents last changed on Wed Jul 14 17:27:40 2010
· mplayerResume last changed on Mon Jul 12 22:54:24 2010
· R5A12DvdRipping last changed on Mon Jul 12 14:44:04 2010
· Additional Software last changed on Mon Jul 12 14:42:31 2010
· HowToUseMyth last changed on Mon Jul 12 14:41:09 2010
· x11vncHowTo last changed on Sun Jul 11 00:06:20 2010
· CountrySpecific last changed on Thu Jul 1 14:48:40 2010
· RepairingMythConvergDB last changed on Thu Jul 1 14:42:58 2010
· tv_grab_au last changed on Tue Jun 29 15:44:05 2010
sitemap |