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

Troubleshooting • Script doesn’t work properly at boot time

$
0
0
I have a simple script that turns on a usb device. It works if invoked from an interactive shell, but not from ~/.config/labwc/autostart.

The script, called device-on is
#!/bin/bash
set -x
/usr/bin/printf “+\r” >/dev/ttyAMA0

So, from a Trixie gui desktop shell prompt I can type
./device-on
and the device turns on.

If I put the same script in
~/.config/labwc/autostart

the device doesn’t turn on.
I know the script runs because I’ve tried adding diagnostic prints to a temp directory that
a) sends a listing of the /dev/tty devices to check that ttyAMA0 is present
b) sends stdout and stderr to temp files. Nothing unexpected found there, no error messages.

I’ve also tried adding a sleep statement in case something wasn’t ready.

So there’s a different behaviour between the script being autostarted and interactively run. But I don’t know what.

The platform is a Pi5 running Trixie with all updates applied.

Any ideas appreciated….

Statistics: Posted by jthjth — Wed Nov 26, 2025 10:25 am



Viewing all articles
Browse latest Browse all 8015

Trending Articles