How to set volume on mpc from cron job

131 views Asked by At

On a raspberry Pi running bookworm. I have a python file

import subprocess
command = ['mpc', 'volume', '16']
subprocess.run(command, text = True,  capture_output=True)

which runs fine from a terminal but it I run it at boot from cron I get MPD error: Connection refused How can I run it from cron? The line in cron is @reboot /home/pi/.venv/bin/python3 /home/pi/v02_2/test_mpd.py >> /home/pi/v02_2/logs/cron.log 2>&1

0

There are 0 answers