Helpdesk

having touched into the subject before concerning the configuration, I still have not been able to confirm that the shutdown-script is running in the background.


Usually when the primary source is detached, the timer shown in the configurator-program starts counting down, but the pi abruptly usually just crashes, or goes to black a second before timer runs out.


Have 20 sec as timer for the power, and 10 sec (default) for the shutdown-script.


RC.local has the following added at the end:


/usr/local/bin/rpi4pci.sh
python /home/pi/RTCSerial.py [&]


python /home/pi/serialShutdown.py [&]


exit 0


The following command in Terminal: pi@openauto:~ $ ps -aef | grep python


shows the following:


pi [nbsp] [nbsp] [nbsp] [nbsp] 801 [nbsp] [nbsp] 1 [nbsp]0 13:15 ? [nbsp] [nbsp] [nbsp] [nbsp]00:00:02 /usr/bin/python3 /usr/share/system-config-printer/applet.py
pi [nbsp] [nbsp] [nbsp] 21896 [nbsp]2107 [nbsp]0 14:38 pts/0 [nbsp] [nbsp]00:00:00 grep --color=auto python

mirrormurr

26.10.22 14:41

Hello Mirrormurr,


there is the "[&]" missing in your rc.local.


furthermore our python scripts are designed for python3, you should run them in rc.local with python3 too


so it should look like this at the end of your rc.local:


/usr/local/bin/rpi4pci.sh [&]
python3 /home/pi/RTCSerial.py [&]

python3 /home/pi/serialShutdown.py [&]

exit 0

[nbsp]


Best regards


Tim (Joy-IT)


[nbsp]


[nbsp]

Tim

28.10.22 15:41

Hello again,[nbsp]


The missing "[&]" seemed to have escaped my copy-and-paste..


Adding the python3 didn't seem to do the trick either. Am getting the same result,[nbsp]


How could we proceed?


[nbsp]

mirrormurr

03.11.22 11:41

Another command gave this out-put:


pi@openauto:~ $ sudo systemctl status rc-local
Warning: The unit file, source configuration file or drop-ins of rc-local.servic
● rc-local.service - /etc/rc.local Compatibility
[nbsp] [nbsp]Loaded: loaded (/lib/systemd/system/rc-local.service; enabled-runtime; vendor
[nbsp] Drop-In: /lib/systemd/system/rc-local.service.d
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp]└─debian.conf
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp]/etc/systemd/system/rc-local.service.d
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp]└─ttyoutput.conf
[nbsp] [nbsp]Active: active (exited) since Thu 2022-11-03 12:03:57 CET; 1h 3min ago
[nbsp] [nbsp] [nbsp]Docs: man:systemd-rc-local-generator(8)
[nbsp] Process: 532 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS)


Nov 03 12:04:01 openauto rc.local[532]: [nbsp] File "/usr/lib/python3/dist-packages/s
Nov 03 12:04:01 openauto rc.local[532]: [nbsp] [nbsp] 'device reports readiness to read bu
Nov 03 12:04:01 openauto rc.local[532]: serial.serialutil.SerialException: devic
Nov 03 12:04:01 openauto rc.local[532]: During handling of the above exception,[nbsp]
Nov 03 12:04:01 openauto rc.local[532]: Traceback (most recent call last):
Nov 03 12:04:01 openauto rc.local[532]: [nbsp] File "/home/pi/serialShutdown.py", lin
Nov 03 12:04:01 openauto rc.local[532]: [nbsp] [nbsp] x=ser.readline()
Nov 03 12:04:01 openauto rc.local[532]: [nbsp] File "/usr/lib/python3/dist-packages/s
Nov 03 12:04:01 openauto rc.local[532]: [nbsp] [nbsp] raise SerialException('read failed:[nbsp]
Nov 03 12:04:01 openauto rc.local[532]: serial.serialutil.SerialException: read[nbsp]
lines 1-21/21 (END)...skipping...
Warning: The unit file, source configuration file or drop-ins of rc-local.service changed on disk. Run 'systemctl daemon-reload' to reload units.
● rc-local.service - /etc/rc.local Compatibility
[nbsp] [nbsp]Loaded: loaded (/lib/systemd/system/rc-local.service; enabled-runtime; vendor preset: enabled)
[nbsp] Drop-In: /lib/systemd/system/rc-local.service.d
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp]└─debian.conf
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp]/etc/systemd/system/rc-local.service.d
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp]└─ttyoutput.conf
[nbsp] [nbsp]Active: active (exited) since Thu 2022-11-03 12:03:57 CET; 1h 3min ago
[nbsp] [nbsp] [nbsp]Docs: man:systemd-rc-local-generator(8)
[nbsp] Process: 532 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS)


Nov 03 12:04:01 openauto rc.local[532]: [nbsp] File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 501, in read
Nov 03 12:04:01 openauto rc.local[532]: [nbsp] [nbsp] 'device reports readiness to read but returned no data '
Nov 03 12:04:01 openauto rc.local[532]: serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multi
Nov 03 12:04:01 openauto rc.local[532]: During handling of the above exception, another exception occurred:
Nov 03 12:04:01 openauto rc.local[532]: Traceback (most recent call last):
Nov 03 12:04:01 openauto rc.local[532]: [nbsp] File "/home/pi/serialShutdown.py", line 30, in [lt]module[gt]
Nov 03 12:04:01 openauto rc.local[532]: [nbsp] [nbsp] x=ser.readline()
Nov 03 12:04:01 openauto rc.local[532]: [nbsp] File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 509, in read
Nov 03 12:04:01 openauto rc.local[532]: [nbsp] [nbsp] raise SerialException('read failed: {}'.format(e))
Nov 03 12:04:01 openauto rc.local[532]: serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconne
~

mirrormurr

03.11.22 13:08

Hello Mirrormurr,


unfortunately, we cannot reproduce the error here. It could be the rpi4pci.sh file which should be executed as well.


We recommend removing this file from the autostart for testing to see if this is causing the problem.



You can also try again with a fresh set-up Raspberry Pi OS, set up according to our quick start guide, or use one of our prepared images from our download section. To rule out causes in your existing setup.


Best regards[nbsp]


Tim (Joy-IT)

Tim

07.11.22 11:55