Hi,
I have a problem with lcdup.py script on moOde 6.7.1 + RPI4 + audiophonics I-SABRE 9038Q2M
I intend to use lcdup.py to drive two leds on GPIO 23 and 24 indicating the selected input source, S/PDIF or IIS.
When input source is changed from WebUI, it only works when I change the source from S/PDIF to IIS.
Changing source from IIS to S/PDIF does not work. It seems that lcdup.py is not launched in this case.
As a work around I launch another script from /etc/rc.local at boot time where the input source is checked every 4 seconds.
This aproach works well but it oblies to run the script forever (putting the intructions in a while infinite loop):
The script (without the while loop) has been tested stand alone and it works well too, of course
in theory lcdup.py wakes up upon WebUI changes but this is not the case when it shows the S/PDIF screen
It would be nice this issue to be solved in future releases.
Best regards
Juan
I have a problem with lcdup.py script on moOde 6.7.1 + RPI4 + audiophonics I-SABRE 9038Q2M
I intend to use lcdup.py to drive two leds on GPIO 23 and 24 indicating the selected input source, S/PDIF or IIS.
When input source is changed from WebUI, it only works when I change the source from S/PDIF to IIS.
Changing source from IIS to S/PDIF does not work. It seems that lcdup.py is not launched in this case.
As a work around I launch another script from /etc/rc.local at boot time where the input source is checked every 4 seconds.
This aproach works well but it oblies to run the script forever (putting the intructions in a while infinite loop):
Code:
import sys
import RPi.GPIO as GPIO
import time
import os
import subprocess
# Use SoC pin numbering
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(23, GPIO.OUT)
GPIO.setup(24, GPIO.OUT)
GPIO.setup(25, GPIO.OUT)
GPIO.output(25,GPIO.LOW)
option= "-q"
sqlSelect="select value from cfg_system where id='93'"
while True:
SPDIF=subprocess.check_output(['/usr/local/bin/moodeutl',option,sqlSelect])
#print (SPDIF)
if SPDIF==b'Local\n':
#print ("IIS")
GPIO.output(23,GPIO.LOW) # SPDIF Red Led OFF
GPIO.output(24,GPIO.HIGH) # IIS Green Led ON
else:
#print ("S/PDIF")
GPIO.output(23,GPIO.HIGH) # S/PDIF. Red Led ON
GPIO.output(24,GPIO.LOW) # IIS Green Led OFF
time.sleep(4)
The script (without the while loop) has been tested stand alone and it works well too, of course
in theory lcdup.py wakes up upon WebUI changes but this is not the case when it shows the S/PDIF screen
It would be nice this issue to be solved in future releases.
Best regards
Juan