New Install Of Shutdowncheck Script Not Working

Started by RussellS, December 14, 2024, 06:22:53 PM

RussellS

Hi, I have an ATXRaspi running on a RPi 3 B+ Volumio music player (Debian based) and has been running very well for quite a few years. I recently, rather foolishly, did an OTA Volumio software update to the latest version which completely removed the 'shutdowncheck.sh' script. So I re-installed the script using option 2 (Install POLLING based script /etc/shutdowncheck.sh (classic)) but the power button isn't working correctly.
I have checked that the shutdowncheck.sh script is running which it is but if I connect a monitor up I am getting the following 3 lines continuously scrolling up the screen:

rc.local[729]: /etc/shutdowncheck.sh: line 32: [: =: unary operator expected
rc.local[729]: /etc/shutdowncheck.sh: line 36: [: =: unary operator expected
rc.local[729]: cat: /sys/class/gpio/gpio7/value: no such file or directory

When I set it up the first time a few years ago I remember having some issues but that was due to not being able to get the interrupt based script to work but once I reverted to the polling based script everything worked fine. So I don't know why I'm having this issue now. From what I understand, if you are just using the polling based script then you don't need to install RPi.GPIO so could you confirm that this is correct.

Does anyone have any advice on where the problem could lie please.

Many thanks

Felix

So you pressed the AZ-5 button and didn't make a backup of your nuclear reactor first... no sweat, we all do it in that exact same sequence ;)

Looks like the GPIO package is not installed on your Pi, check in here:

/sys/class/gpio/

RussellS

Quote from: Felix on December 16, 2024, 10:50:07 AM
So you pressed the AZ-5 button and didn't make a backup of your nuclear reactor first... no sweat, we all do it in that exact same sequence ;)
Yeah, I know, I had a moment of madness.

Quote from: Felix on December 16, 2024, 10:50:07 AM
Looks like the GPIO package is not installed on your Pi, check in here:

/sys/class/gpio/

I did try installing the GPIO package but it still didn't work so I'm not sure where to go now.
I'm away from home working this week so I will have another go at the weekend and try again. I may try going back to the earlier version of Volumio to test as I know that was working.

RussellS

Well I appear to have made some progress with this issue although I haven't as yet resolved it.

So I re-installed the earlier version of Volumio (v3.449) and then installed the shutdowncheck.sh script and everything worked again as it had done before. I made a careful note of the steps I took to achieve this working system which was:

Install RPi.GPIO
Reboot
Install shutdowncheck.sh
reboot

I then replicated the exact same steps with the later Volumio version (v3.779) on a fresh SD card and this didn't work and acted as I reported in my original post.

The original working version was running kernel version 5.10.92 and the later non working version is running kernel version 6.6.56 and after a lot of internet searching it appears that as of kernel version 6.6.xx the RPi.GPIO is no longer working as it was and the gpio pins are now numbered differently. There are numerous posts regarding projects that rely on GPIO access no longer working since updating the Rasbian OS.

Here is a quote from a 'Stack overflow' post:

QuoteAssuming you have kernel version higher 6.6 and higher, gpio pins are numbered differently. Instead of value 4 for GPIO PIN 4 use 516, for GPIO PIN 17 use 529. All gpio pin numbers can be found in /sys/kernel/debug/gpio

I am still investigating this and looking for a solution but I thik that anyone trying to use an ATXRasPi on the latest OS versions will be having issues with the shutdowncheck.sh script.

If I find any solutions I will report them here.

Felix

#4
Thanks for the update, I just don't get how these releases are completely breaking the previous software versions.

RussellS

Hi, it's been a long time with this issue but I am really happy to report that the new 'shutdowncheck' script 'ATXRaspi-SoftBTN-Shutdown' by user 'CptSandwich' is working perfectly with the newer Raspberry Pi OS's with kernel version 6.6+.

I have now successfully upgraded my Volumio software to the latest version and, with the new script, I have been able to retain the ATXRasPi functionality.

I know this new script is referenced in the main LowPowerLab ATXRasPi web page but just in case anyone has missed it the new script can be found here

Many thanks to the user for creating this, I tried myself but failed miserably.

Felix

That's good to know. The feedback is appreciated!