geekworm-com / xscript

This script is for raspberry pi nas storage products such as naspi, naspi cm4-m2 etc from Geekworm.
MIT License
11 stars 5 forks source link

Errors with "x-c1-pwr.sh" on Raspberry Pi 4 #3

Closed ridgarou closed 4 months ago

ridgarou commented 6 months ago

Hello, I install XScript on a Linux raspberry64 6.6.17-v8+ #1734 SMP PREEMPT Mon Feb 19 11:59:52 GMT 2024 aarch64 in my Raspberry Pi 4, but the x-c1-pwr.sh doesn't work properly:

$ sudo /usr/local/bin/x-c1-pwr.sh 
/usr/local/bin/x-c1-pwr.sh: line 6: echo: write error: Invalid argument 
/usr/local/bin/x-c1-pwr.sh: line 7: /sys/class/gpio/gpio4/direction: No such file or directory 
/usr/local/bin/x-c1-pwr.sh: line 9: echo: write error: Invalid argument 
/usr/local/bin/x-c1-pwr.sh: line 10: /sys/class/gpio/gpio17/direction: No such file or directory 
/usr/local/bin/x-c1-pwr.sh: line 11: /sys/class/gpio/gpio17/value: No such file or directory

The problem is I haven't this 'directories' :

/sys/class/gpio/gpio4 
/sys/class/gpio/gpio17

I only have this in gpio:

$ sudo ls /sys/class/gpio -la 
total 0 
drwxrwxr-x 2 root gpio 0 Feb 23 06:20 . 
drwxr-xr-x 66 root root 0 Jun 18 2023 .. 
--w--w---- 1 root gpio 4096 Mar 11 09:23 export 
lrwxrwxrwx 1 root gpio 0 Feb 23 06:20 gpiochip512 
lrwxrwxrwx 1 root gpio 0 Feb 23 06:20 gpiochip570 
--w--w---- 1 root gpio 4096 Feb 23 06:20 unexport

Can anyone tellme what's wrong??

koroki commented 6 months ago

Same problem here.

geekworm-com commented 5 months ago

This is due to a kernel update, the 6.6 kernel changes the way GPIOs are accessed, run the following command to fix it.

mv xscript xcript-old
git clone https://github.com/geekworm-com/xscript
cd xscript
chmod +x *.sh
./uninstall.sh

Then refer to the wiki and reinstall the script.