Another simple system enhancement:
I have noticed that during shutdown there can be an extensive delay - 90 seconds - for the GPIO daemon to shut down. The shutdown timer eventually times out and the kernel kills the process anyway.
During this time the robot appears to “hang” with (sometimes) the power light flashing purple.
Would you please publish a list of color codes and signals for the power LED?
Since the activity LED on the GoPiGo board goes dark for an extended period of time, I have mistakenly assumed that the system had completely powered down, but (somehow or other), the GoPiGo board didn’t get the message. As a consequence, I have unplugged power long before the actual shutdown process was complete - as much critical stuff remains to be done.
This is not good. In fact, this might be responsible for some weird and unexpected SD card corruption, trashing my system several times for no obvious reason. (That is, unless you have a monitor plugged in, and have the splash-screen disabled.)
I don’t know why this module doesn’t stop normally - maybe it’s being held open by parts of the R4R software and GoPiGo controller firmware?
The solution is to edit /etc/systemd/system.conf as root, with your favorite editor.
You will find a long list of parameters, all commented out. These represent the compile-time defaults for various kernel options and parameters. If you un-comment a line and change its value, the new value for that option/parameter will be used after the next reboot.
What I did was to find the line that says
- Either un-comment it or, (as I did), make a copy of that line and uncomment the copy.
- Change the value to something more reasonable - like 10 or 15 seconds.
(I chose 10 seconds since the process never stops by itself anyway - better to kill it quickly and get on with the rest of the shutdown process.
Then save the file.
That part of my file now looks like:
#DefaultTimeoutStartSec=90s #DefaultTimeoutStopSec=90s DefaultTimeoutStopSec=10s <== This is the line I changed #DefaultRestartSec=100ms #DefaultStartLimitIntervalSec=10s
Save and reboot and any shutdown delays will be gone.
I have tried this extensively and there appears to be no change to the way the Raspberry Pi or the GoPiGo behaves during shutdown.