LinHES Forums http://forum.linhes.org/ |
|
IRBlaster problem http://forum.linhes.org/viewtopic.php?f=11&t=15154 |
Page 1 of 2 |
Author: | Draeko [ Tue May 08, 2007 6:12 am ] |
Post subject: | IRBlaster problem |
I've been using Knoppmyth for a few months now. Most of it is working great, but I still have one minor annoyance which I think is causing a major problem. When I boot or reboot the computer, I have to go to the console, run 'killall mythbackend' and rerun 'mythbackend' for the IRBlaster to work at all. This to me has to be at least part of the cause of some random crash errors I've been getting, since I'm not allowing the database to close properly (not knowing a better way to do it). The system keeps getting more and more unstable, until I have to reformat and start fresh (about every three weeks). Can someone help me get this working properly at boot? I'm using a Hauppauge PVR-150 (non MCE), which has it's own on-card IRblaster. I know it's not a hardware issue, as I have two independant computers doing the exact same thing (no interaction between them at all). Any assistance is greatly appreciated. |
Author: | Draeko [ Thu May 10, 2007 5:39 pm ] |
Post subject: | |
Ok, I've discovered the source of the problem, but not the fix, and I'm getting really frustrated. The change_channel script doesn't work unless I'm logged in as root, so it's a permission error. I think it has to do with perl, as I got a message saying something about perl-suid. I've changed too many permissions and tried too many things to remember how anything was. I'm not adversed to redoing the whole box to set everything back to the way it was, but I still need help with this please. I feel like I'm so close to the solution, but I just don't know enough to make it work. Please, I've been working on this problem off and on since December, I would really like to get it done soon. Thanks |
Author: | Draeko [ Thu May 10, 2007 8:59 pm ] |
Post subject: | |
I've redone the system since I seemed to have screwed it completely up. This is what I get trying to execute the script using the mythtv account. Note that using root works perfectly. mythtv@mypvr:/etc$ ./change_channel POWER Can't do setuid (cannot exec sperl) |
Author: | bigbro [ Thu May 10, 2007 10:09 pm ] |
Post subject: | |
I thought there was a step in the setup to make it executable. Mine has these permissions when I run Code: ls -al # ls -al /usr/local/bin/change_channel -rwxr-xr-x 1 root root 1396 Dec 26 09:43 /usr/local/bin/change_channel You should see that x in the there. That should be able to be fixed with a chmod Code: #chmod +x change_channel
Of course I abbreviated, you need to include your path or be in that directory. Hope this helps! |
Author: | Draeko [ Fri May 11, 2007 7:34 am ] |
Post subject: | |
I've already done that, had to do it to get it working for root. |
Author: | Draeko [ Wed May 16, 2007 12:35 pm ] |
Post subject: | |
Can anyone help me? |
Author: | elgordo123 [ Wed May 16, 2007 2:18 pm ] |
Post subject: | |
Have you tried to do (as root) chmod a+x /path/to/change_channel.sh That will give everyone permission to execute that script. |
Author: | tjc [ Wed May 16, 2007 6:43 pm ] |
Post subject: | |
For some types of scripts you need to make them readable as well as executable: Code: chmod a+rx /path/to/change_channel.sh
|
Author: | Draeko [ Thu May 17, 2007 8:15 am ] |
Post subject: | |
I'll try the when I get home tonight, but I still have the feeling it has something to do with the mythtv user not having rights to run perl scripts. |
Author: | Draeko [ Thu May 17, 2007 7:06 pm ] |
Post subject: | |
Did that.. all I get is the same message Can't do setuid (cannot exec sperl) |
Author: | tjc [ Thu May 17, 2007 7:46 pm ] |
Post subject: | |
Probably because sperl isn't on the system... |
Author: | Draeko [ Thu May 17, 2007 10:22 pm ] |
Post subject: | |
But the script works fine under root. This is the 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 ("irsend 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"); } |
Author: | Draeko [ Thu May 24, 2007 9:26 am ] |
Post subject: | |
Can anyone help me with this? Or at least point me to a different change channel script that won't cause permission problems? |
Author: | slowtolearn [ Thu May 24, 2007 10:12 am ] |
Post subject: | |
I copied the script you posted onto my system and executed it fine as both root and myth user. Quote: myth3@myth3:~$ /usr/local/bin/change_channel.sh POWER I don't have a blaster so the errors are correct, however you can see that the script executed.channel changing POWER irsend: command failed: SEND_ONCE blaster POWER irsend: unknown remote: "blaster" Draeko wrote: Can't do setuid (cannot exec sperl)
You obviously have something misconfigured, there's no sperl on any of my systems... |
Author: | bigbro [ Thu May 24, 2007 10:52 am ] |
Post subject: | |
Your script "looks" correct. Both my lircd.conf and my change_channel script are posted here http://mysettopbox.tv/phpBB2/viewtopic. ... 0411#90411 Just for grins you might try creating a new change_channel per the instructions on the wiki for setting up an IR Blaster here. http://knoppmythwiki.org/index.php?page ... hSetTopBox Save your old script by doing an mv change_channel change_channel.orig or something like that. Use my script above as I know it works for the settop box, as I remember there was a cut and paste issue with the one posted on the wiki. I think it is fixed but just to be sure. Remember your actual codeset used for controlling your settop box may be different, but you shouldn't need to do that portion as yours is partially working. You know looking back at the post trail here. I see a small difference, I don't know if this is true of yours or not. my change_channel is exactly that name, I noticed the instructions TJC gave were for change_channel.sh I don't know if that makes a difference or not. Maybe someone else can speak up on that part my linux is weak there. Anyway when you set this up you will need to go back and ensure that your tuner setting has the correct path/filename in it to work. Hope this helps! |
Page 1 of 2 | All times are UTC - 6 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |