[mythtv-users] Raspberry Pi 4 FrontEnd Remote Control Issues
Stephen Worthington
stephen_agent at jsw.gen.nz
Tue May 19 09:58:13 UTC 2020
On Mon, 18 May 2020 15:10:26 -0500, you wrote:
>
>
>Hi Stephen!
>
>
>> Getting rid of the need for a password is tricky. It involves
>> creating an /etc/sudoers.d file
>
>I was snooping around last night and found this at
>https://stackoverflow.com/questions/233217/how-to-pass-the-password-to-su-sudo-ssh-without-overriding-the-tty
>:
>
>
>echo <password> | su -c <command> <user>
>
>So: echo MyPassword | su -l pi -c /home/pi/Load_MythFE.sh
>
>(substitute the real password up there)
>
>
>Modified the line in /etc/lirc/irexec.lircrc and seems to work.
>Admittedly not a good solution for some as is easily found and displayed
>in plain text but for me is fine. Will keep your suggestion as might
>need a more secure option, and so far not 100% working I havent
>gotten the loading button on the remote to work yet.
I suspect that the "su -l" needs to be changed to some form of sudo
command for the /etc/sudoers.d file to work. The su and sudo commands
are not the same. They are related, but I think sudoers only works
for sudo.
>Also had found my system wanted /export DISPLAY=:0.0/ needed the
>addition of .0. Found that at
>https://forums.xilinx.com/t5/Embedded-Linux/Qt-window-can-not-be-displayed-Could-not-connect-to-any-X/td-p/902773
Good, I was not sure if it needed the .0, or whether :0 was enough. I
have never delved into just how that works.
>OK, still having problems I think with the beginning: when the yellow
>button is pressed (KEY_C) nothing happens. Im guessing this the
>location of the problem because:
>
>
>/etc/lirc/irexec.lircrc
>
>Supposed to see the button is pushed and run Load_MythFE.sh. If I run
>the script at the Terminal things work. I also tried looking at the
>MythWeb page of the Backend which system is idle, active, etc. Yellow
>button, nothing. Manual entry becomes active. Just wanted to make sure
>there wasnt a display issue and the Frontend merely wasnt being seen.
>
>
>Also tried changing config = echo This is the C key to see if
>anything pops up - - but to where? So tried config = echo This is the
>C key > /home/pi/Test.txt hoping it would create the test file. Nope.
>Trouble is I dont know for certain if these test commands are right.
>Guessing so as the first test is from some LIRC file.
That is the test I would have suggested. Since the irexec service is
running irexec as root, permissions should not matter and the Test.txt
file should be written to (if /home/pi is a valid directory).
>So then while looking to see is the Test.txt file was being created saw
>I had Test_LIRC.py. Not quite sure its supposed to do as was at the end
>of an article I was using to guide me before asking for help here.
>Article dead-ended at the script so I wasnt sure what it did. Did give
>me a potential clue: error message no module named lirc. (Didnt we
>install it like a dozen times early on?) (At Terminal) lirc ? command
>not found. sudo lirc ? command not found. OK. install ? already
>installed. <sizzle>
Some things to check. Is irexec running?
sudo ps -ef | grep irexec
What log output do you get from irexec? I am not sure exactly where
the irexec service will be logging things, but it should show up
somewhere. What do these commands show?
sudo systemctl status irexec
sudo journalctl --unit=irexec
sudo journalctl -b0 /usr/bin/irexec
>I think off the no module named lirc error Googled and found these
>specifically on the RPi4:
>
>
> https://www.raspberrypi.org/forums/viewtopic.php?t=269703
>
> Thu Apr 02, 2020 ? The latest version appears to be broken.
>
> - -
>
> Mon Apr 06, 2020 ? As there has been no response from this I've been
> looking at alternatives.
>
> It looks like pigpio provides what I need which is easier than using
> Lirc anyway.
>
>
> https://www.raspberrypi.org/forums/viewtopic.php?t=235256
>
>
> [Stretch/Buster] Using LIRC with kernel 4.19.X and gpio-i
> <https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=235256&sid=cda4dc3db943f0d9642a34f6fc2f088c>
>
> Kernel 4.19 does not include lirc_dev, so it is recommended to use
> gpio-ir.
> https://lb.raspberrypi.org/forums/viewt ... 1&start=50
> <https://lb.raspberrypi.org/forums/viewtopic.php?f=29&t=224931&start=50>
>
> <More of article>
>
>
>So at this point Im not sure what to do. The second reference seems to
>indicate patches and etc. I dont read code so at this point if better
>to toss out the lirc stuff and go with pigpio (which I initially read as
>pig pe oh and later occurred to me its [raspberry] pi G-P-I-O).
>Could also just go back to the load at boot. ...Doesnt quite make sense
>why once MythFrontend is loaded the remote works.
>
>I dont know how much time and effort you want to put into this, though
>I may be leading the pack with a remote-operated RPi 4!
The remote is working - you have had it doing things. Most of the
problems with lirc packaging have been about doing the configuration
using the python configure programs. These can be broken due to a bad
package (as Ubuntu 18.04 lirc was). A missing _client.so module is
common. But lircd itself is normally fine and as long as you manually
set up the config (as you have done), it works.
Getting irexec to work as well is just icing on the cake. But it too
should work, with the right config. So for testing purposes, I would
suggest:
config = echo "irexec test" >/tmp/irexec.txt
It should be using a button that is not assigned to one of the other
lirc programs in the $HOME/.lircrc settings. Using the /tmp directory
for tests like this is a good idea as it is able to be used by any
user without permissions problems.
I put this in my /etc/lirc/irexec.lircrc file:
begin
prog = irexec
button = KEY_SELECT
config = echo "irexec test" >/tmp/irexec.txt
end
and restarted irexec:
sudo systemctl restart irexec
Then when I pressed the Home key on my remote, which sends KEY_SELECT,
it created a /tmp/irexec.txt file with the "irexec test" text, as
expected. Then I edited /etc/lirc/irexec.lircrc to this:
begin
prog = irexec
button = KEY_SELECT
config = echo "irexec test"
end
and restarted irexec again. Pressing Home three times gave this from
a "journalctl --unit=irexec" command:
-- Logs begin at Sat 2020-04-18 03:07:45 NZST, end at Tue 2020-05-19
21:38:15 NZST. --
May 19 21:32:14 mypvr systemd[1]: Started Handle events from IR
remotes decoded by lircd(8).
May 19 21:36:02 mypvr systemd[1]: Stopping Handle events from IR
remotes decoded by lircd(8)...
May 19 21:36:02 mypvr systemd[1]: Stopped Handle events from IR
remotes decoded by lircd(8).
May 19 21:36:02 mypvr systemd[1]: Started Handle events from IR
remotes decoded by lircd(8).
May 19 21:37:53 mypvr systemd[1]: Stopping Handle events from IR
remotes decoded by lircd(8)...
May 19 21:37:53 mypvr systemd[1]: Stopped Handle events from IR
remotes decoded by lircd(8).
May 19 21:37:53 mypvr systemd[1]: Started Handle events from IR
remotes decoded by lircd(8).
May 19 21:38:13 mypvr irexec[5393]: irexec test
May 19 21:38:14 mypvr irexec[5393]: irexec test
May 19 21:38:15 mypvr irexec[5393]: irexec test
And this from "journalctl -b0 /usr/bin/irexec":
-- Logs begin at Sat 2020-04-18 03:07:45 NZST, end at Tue 2020-05-19
21:38:15 NZST. --
May 19 21:38:13 mypvr irexec[5393]: irexec test
May 19 21:38:14 mypvr irexec[5393]: irexec test
May 19 21:38:15 mypvr irexec[5393]: irexec test
So when the output is not redirected to a file, systemd puts the
output into the journal files.
More information about the mythtv-users
mailing list