Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpi5 updates breaks install for rpi2 & 3 #15

Open
grondar69 opened this issue Mar 12, 2024 · 11 comments
Open

rpi5 updates breaks install for rpi2 & 3 #15

grondar69 opened this issue Mar 12, 2024 · 11 comments
Assignees
Labels

Comments

@grondar69
Copy link

grondar69 commented Mar 12, 2024

Had this up and running forever, rebuilt a rpi2 and 3 tonight and neither would work (light continuously flashing and switch did nothing. Also noticed that after the install neither pi shutdown.

Noticed changes were made a couple days ago, I ran the uninstall script, rebooted, made the following reversions, re-installed and everything is working fine now.

file /PowerBlock/install.sh

comment line 'updateBootConfig'

file /PowerBlock/scripts/powerblockservice - change as follows

setPinValue() {
  echo $2 > $BASE_GPIO_PATH/gpio$1/value
#-  gpioset $chip $1=$2
}

getPinValue() {
  echo $(cat $BASE_GPIO_PATH/gpio$1/value)
#-  echo $(gpioget $chip $1)
}
@grondar69
Copy link
Author

grondar69 commented Mar 13, 2024

Also had to comment out this section

file /PowerBlock/scripts/powerblockservice

#- Determine Raspberry Pi GPIO access chip
#- chip=4 for RPi5, chip=0 for older models
#-if gpiodetect | grep -q "pinctrl-rp"; then
#-  chip=4
#-else
#-  chip=0
#-fi

@geekawhyte
Copy link

Faced the same problem. Unfortunately neither your changes nor the old driver version work for me (anymore). I am running Raspberry Pi OS Lite 12 64bit with Kernel 6.6.20+rpt-rpi-v8. Before the last OS updates, which also included the current kernel, I think, I was at least able to get the old driver version working again. I'm still trying to figure out how to boot into the older kernel to explore this theory.

@geekawhyte
Copy link

geekawhyte commented Mar 14, 2024

It seems my theory was right. I prepared a new SD card with latest Raspberry Pi OS 12 Lite 64bit image from December 2023, cloned the PowerBlock repository and made the changes mentioned above. Everything worked fine. Then I did an apt upgrade. Kernel was updated from 6.1.0-rpi7-rpi-v8 to 6.6.20+rpt-rpi-v8. Powerblock service starts and runs all the time, but the LED keeps flashing and the switch does not work. Any ideas?

Could it have something to do with this?
raspberrypi/linux#6037

@grondar69
Copy link
Author

Not sure, I just saw that there were updates to the code and reverted them, I'm using the standard 32-bit legacy install of raspbian

@geekawhyte
Copy link

geekawhyte commented Mar 15, 2024

It doesn't matter if 32-bit or 64-bit. The new kernel in Bookworm is the "problem". It seems like I've found a solution, even if I don't know if it's a good solution.

In /etc/powerblockconfig.cfg I've made these changes:
statuspin=529
shutdownpin=530

@grondar69
Copy link
Author

In /etc/powerblockconfig.cfg I've made these changes: statuspin=529 shutdownpin=530

I'm curious how you came up with those values? I've done some looking online but havent been able to find anything. I am going to try your fix as well.

@grondar69
Copy link
Author

Closed by accident, reopening ....

@grondar69 grondar69 reopened this Mar 18, 2024
@geekawhyte
Copy link

geekawhyte commented Mar 18, 2024

In /etc/powerblockconfig.cfg I've made these changes: statuspin=529 shutdownpin=530

I'm curious how you came up with those values? I've done some looking online but havent been able to find anything. I am going to try your fix as well.

From this site:
raspberrypi/linux#6037

I did a "cat /sys/kernel/debug/gpio" on my RPi3 with old and new kernel.

Old kernel (6.1.x):
gpio-17 (GPIO17...
gpio-18 (GPIO18...

New kernel (6.6.x):
gpio-529 (GPIO17...
gpio-530 (GPIO18...

So, it works, but I don't know if it could have any side effects.

PS: your changes in PowerBlock/install.sh and PowerBlock/scripts/powerblockservice are still necessary for me.

@ZachPL
Copy link

ZachPL commented Apr 14, 2024

I'm on a pi 3b+ using the retropie img and I had to revert the last 2 commits and rerun the install script for the shutdown script to run. I checked the GPI pins the retropie image is still using 17 and 18 so I didn't need to make those changes.

@petrockblog
Copy link
Owner

Thanks for this information. I need to update the installation script, obviously.

@petrockblog petrockblog self-assigned this Apr 15, 2024
@petrockblog
Copy link
Owner

@ZachPL @geekawhyte @grondar69 @ontje I just updated the driver: It tries to install the GPIO tools during installation now. The driver checks at runtime the availability of the GPIO tools and falls back to sysfs in case the GPIO tools cannot be found. This should restore the compatibility with the older RPi models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants