Quantcast
Channel: Squeezebox : Community : Forums - Linux / Unix
Viewing all articles
Browse latest Browse all 1518

PCP 8 Python script in startup stopped working

$
0
0
Wonder if anyone can help me, because I ran out of options. :confused: Since I upgraded to PCP8 my Pyhton script that is running at startup stopped working.

I have a python script that checks "pcp mode" and then turns on a slow flashing led in a button. When you press the button it plays or pauses ("pcp play" or "pcp stop"). The script is started from a shell script, that I added to "user commands" under "tweaks".

When I upgraded to PCP8 it stopped working. It doesn't flash when playing and doesn't pause/play. Checking 'top", I can see that the script is running (and it responds to button press and lights the led, so it can read and write GPIOs), but it seems to not be able to read the "pcp mode" status, or write "pcp play" or "pcp stop" anymore.

The related part of the script is:
Code:

    state = subprocess.getoutput("pcp mode")
    if state == "play":
        os.system('pcp stop')
    else:
        os.system('pcp play')

When I start it manually from the terminal like this:
Code:

sudo nohup python3 button.py &
it runs perfectly fine.

Anybody have any suggestions? There doesn't seem to be any logfiles I can check either..

Viewing all articles
Browse latest Browse all 1518

Trending Articles