Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5028

Python • Re: Help Request: Loading Python Script at Boot / Script Behaves Erratically

$
0
0
I made these changes

Code:

sudo nano /etc/systemd/system/touch_play_random.service

Code:

[Unit]Description=Touch Play Random Audio ServiceAfter=network-online.targetWants=network-online.target[Service]ExecStart=/usr/bin/python3 /home/pi/touch_play_random.pyRestart=alwaysRestartSec=10StandardError=append:/home/pi/touch_play_random.service.log[Install]WantedBy=multi-user.target
And then

Code:

pi@hallicrafterss20r:~ $ sudo systemctl daemon-reloadpi@hallicrafterss20r:~ $ sudo systemctl enable touch_play_random.servicesudo systemctl restart touch_play_random.servicepi@hallicrafterss20r:~ $ sudo systemctl status touch_play_random.service* touch_play_random.service - Touch Play Random Audio Service     Loaded: loaded (/etc/systemd/system/touch_play_random.service; enabled; pr>     Active: active (running) since Thu 2024-07-25 09:28:17 EDT; 13s ago   Main PID: 913 (python3)      Tasks: 2 (limit: 755)        CPU: 400ms     CGroup: /system.slice/touch_play_random.service             `-913 /usr/bin/python3 /home/pi/touch_play_random.pyJul 25 09:28:17 hallicrafterss20r systemd[1]: Started touch_play_random.service>
Then I rebooted. After reboot, the MQTT message is published, but no audio output. Updated touch_play_random.service.log:

https://www.dropbox.com/scl/fi/dm23kob4 ... 82mj7&dl=0

Statistics: Posted by grantalewis — Thu Jul 25, 2024 1:39 pm



Viewing all articles
Browse latest Browse all 5028

Trending Articles