Reply To: [SOLVED] Infrared remote for Max2Play rpi Squeezebox

Max2Play Home Forums Max2Play as Squeezebox (Player / Server) [SOLVED] Infrared remote for Max2Play rpi Squeezebox Reply To: [SOLVED] Infrared remote for Max2Play rpi Squeezebox

25. Juli 2017 at 20:42 #30153

@Heiner

Hi Heiner,

everything with my remote control works fine, if I wrote in the shell of the remote session this:

DISPLAY=:0 irxevent -d /home/pi/lircrc

but after a reboot of the Raspberry PI3, I have to do it every time again.

My Problem is, to do that string anywhere in the boot sequence.

I try it as a script whit crontab like follow:

#!/bin/bash

### BEGIN INIT INFO
# Provides: fb.sh
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts & Stops fb.sh
# Description: Starts & Stops fb.sh
### END INIT INFO

# Nur asuführen wenn jivelite im Autostart
autostart=$(grap -a „jivelite=1“ /opt/max2play/autostartconf | wc -l)
if [ $autostart -eq 0 ];
then
echo „Jivelite nicht im Autostart – irxevent wird nicht gestartet!“
exit 0
fi

# Warten bis jivelite gestartet ist
while [ -z „$(pidof jivelite)“ ];
do
sleep 1
done

# Warten bis Lircd gestartet ist
while [ -z „$(pidof lircd)“ ];
do
sleep 1
done

if [ -z „$(pidof irxevent)“ ];
then
echo „Starte irxevent!“
echo ‚DISPLAY=:0 irxevent -d /home/pi/lircrc‘
else
echo „Starte irxevent neu!“
echo ’sudo kill „$(pidofirxevent)“‚
sleep 1
echo’DISPLAY=:0 irxevent -d /home/pi/lircrc‘
fi

exit 0

The script name is fb.sh and that is the crontab config:

@reboot /home/pi/fb.sh

I don’t know what is wrong in my script.

regards
Carsten

  • This reply was modified 6 years, 9 months ago by relgi.