You are not logged in.
Hello,
Newbe here so be gentle.
I want to capture keystrokes send out by the LIRC dongle. I made a script file which runs correctly when I run it from the command line. But it doesn't seem to work when ir runs as a service.
Basically, what I've done is this:
#!/bin/bash
while true
do
read -n 1 ir_code
case $ir_code in
"W")
echo "... inschakelen"
echo 1 > /sys/class/gpio/gpio200/value
sleep 2
echo 1 > /sys/class/gpio/gpio91/value
;;
"Z")
echo "Uitschakelen ..."
echo 0 > /sys/class/gpio/gpio91/value
sleep 2
echo 0 > /sys/class/gpio/gpio200/value
;;
esac
done
Is there a reason why this won't work as a service?
Offline
The reason is that `read' command reads symbols from standard input. When you start the script from the command line the standard input is taken from evdev subsystem. When you start the script as a service the standard input is likely redirected to /dev/null.
Probably you need to use lirc command line utilites such as irw to handle IR data.
Last edited by dimich (2015-08-15 02:42:37)
Offline