Fringe use case for sure but still…
In autostart.sh I call a Day-Night.sh script that checks the time and invokes three different scripts for Day/Evening/Night use. The three scripts use wget to send commands to my Denon AVR and bscpylgtvcommand (GitHub - chros73/bscpylgtv: Library to control webOS based LG TV devices) to send commands to my LG TV.
I would also like to have the same functionality mapped to my remote as I used to do on my HTPC.
Now… if I SSH into CoreELEC, I can use bscpylgtvcommand just fine from command line. I installed the required python components from Entware and it works perfectly.
But when I try to call it from autostart.sh or using System.Exec(exec) in my keymap, it’s as if the command is not executed at all.
The command is installed in /opt/bin, it has execute permissions for all users (755) and contains the following:
#!/opt/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from bscpylgtv.utils import bscpylgtvcommand
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(bscpylgtvcommand())
As an example, the day script contains:
#!/bin/bash
wget -O - > /dev/null 2>&1 192.168.0.21:8080/goform/formiPhoneAppDirect.xml?PSDEH%20OFF
sleep 0.2
wget -O - > /dev/null 2>&1 192.168.0.21:8080/goform/formiPhoneAppDirect.xml?PSDYNVOL%20OFF
sleep 0.2
wget -O - > /dev/null 2>&1 192.168.0.21:8080/goform/formiPhoneAppDirect.xml?PSLFC%20OFF
sleep 0.3
wget -O - > /dev/null 2>&1 192.168.0.21:8080/goform/formiPhoneAppDirect.xml?PSCNTAMT%2005
sleep 0.2
wget -O - > /dev/null 2>&1 192.168.0.21:8080/goform/formiPhoneAppDirect.xml?SPPR%202
sleep 1.0
wget -O - > /dev/null 2>&1 192.168.0.21:8080/goform/formiPhoneAppDirect.xml?MV54
bscpylgtvcommand 192.168.0.36 set_current_picture_mode filmMaker
All the wget commands are executed with no problem. The bscpylgtvcommand is not, even though it works perfectly from ssh comand line.
EDIT: to clarify, the above bash script works perfectly, including the command sent to the TV through bscpylgtvcommand, when invoked from the ssh command line. But the same script does not see bscpylgtvcommand working from autostart.sh or keymap.xml when using System.Exec functionality. All the wget instructions do, but bscpylgtvcommand doesn’t.
Any ideas?