Thanks for your wonderfull help
Posts by Benoitone
-
-
Perhaps only to add some version comments and replacing the deprecated usleep command, no functional change.
yes It will be cool...
Quote from HarryHcat /flash/config.txt
Code
Display More# SPDX-License-Identifier: GPL-2.0-or-later # Copyright (C) 2009-2014 Stephan Raue ([email protected]) # Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv) ################################################################################ # Bootloader configuration # config.txt version v1 (do not remove or change this line!) ################################################################################ # For more options and information see # http://rpf.io/configtxt ################################################################################ # Don't send initial active source message. # Avoids bringing CEC (enabled TV) out of standby and channel switch when # rebooting. hdmi_ignore_cec_init=1 [all] ################################################################################ # Use distroconfig-composite.txt instead of distroconfig.txt to enable # composite video output. # The composite video mode needs to be configured in cmdline.txt: # For PAL add: video=Composite-1:720x576@50ie # For NTSC add: video=Composite-1:720x480@60ie ################################################################################ include distroconfig.txt #include distroconfig-composite.txt # uncomment to enable infrared remote receiver connected to GPIO 18 #dtoverlay=gpio-ir,gpio_pin=18
Quote from HarryHdmesg | grep -i uart
Code[ 0.000000] Kernel command line: reboot=w coherent_pool=1M 8250.nr_uarts=1 pci=pcie_bus_safe snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 smsc95xx.macaddr=D8:3A:DD:CF:C9:00 vc_mem.mem_base=0x3fc00000 vc_mem.mem_size=0x40000000 boot=UUID=0604-1456 disk=UUID=e37f87e7-658e-4610-abc3-cd9177b85998 quiet console=ttyAMA10,115200 console=tty0 [ 0.010450] Serial: AMBA PL011 UART driver [ 0.348037] 107d50c000.serial: ttyS0 at MMIO 0x107d50c000 (irq = 35, base_baud = 6000000) is a Broadcom BCM7271 UART [ 2.515145] Bluetooth: HCI UART driver ver 2.3 [ 2.515151] Bluetooth: HCI UART protocol H4 registered [ 2.515172] Bluetooth: HCI UART protocol Three-wire (H5) registered [ 2.515306] hci_uart_bcm serial0-0: supply vbat not found, using dummy regulator [ 2.515356] hci_uart_bcm serial0-0: supply vddio not found, using dummy regulator [ 2.515375] Bluetooth: HCI UART protocol Broadcom registered
Quote from HarryHls -la /dev/ttyAMA*
Quote from HarryHpinctrl -p get
Code
Display More1: 3v3 2: 5v 3: no pu | -- // GPIO2 = none 4: 5v 5: no pu | -- // GPIO3 = none 6: gnd 7: no pu | -- // GPIO4 = none 8: ip pd | lo // GPIO14 = input 9: gnd 10: no pd | -- // GPIO15 = none 11: no pd | -- // GPIO17 = none 12: no pd | -- // GPIO18 = none 13: no pd | -- // GPIO27 = none 14: gnd 15: no pd | -- // GPIO22 = none 16: no pd | -- // GPIO23 = none 17: 3v3 18: no pd | -- // GPIO24 = none 19: no pd | -- // GPIO10 = none 20: gnd 21: no pd | -- // GPIO9 = none 22: no pd | -- // GPIO25 = none 23: no pd | -- // GPIO11 = none 24: no pu | -- // GPIO8 = none 25: gnd 26: no pu | -- // GPIO7 = none 27: ip pu | hi // GPIO0 = input 28: ip pu | hi // GPIO1 = input 29: no pu | -- // GPIO5 = none 30: gnd 31: no pu | -- // GPIO6 = none 32: no pd | -- // GPIO12 = none 33: no pd | -- // GPIO13 = none 34: gnd 35: no pd | -- // GPIO19 = none 36: no pd | -- // GPIO16 = none 37: no pd | -- // GPIO26 = none 38: no pd | -- // GPIO20 = none 39: gnd 40: no pd | -- // GPIO21 = none
Quote from HarryHDo you know which version of the RemotePi do you have? I read about, that the pcb has a current limiter to prevent damages at RPi pcb. But this can also restrict the current to much for your RPi5 and you are get in trouble, because not enough power.
It's the RemotePi Board for Pi 4.
Yes maybe shutdown on startup can be due to a sporadic power issue... If it happens again I will maybe try to power directly the board with direct power supply. -
Do we talk about the same thing? I meant, that I have updated the scripts inside of the 2 codeblocks in Post #17
Yes I updated the 2 scripts this morning like in your post.
And I have a shutdown at startup...After that I updated to latest nightly version 12.0 (20240416-8b61557) and uncommented the scripts and now it seems to work (and start fine)
I don't know if there is a connection... but it seems to work currently with your scripts...
-
Do you have this strange behavior only since you tried the pinctrl version? Have you updated to the current version?
Hello, yes, without the scripts I don’t have shutdown. I didn’t notice this with the first version you made. I just update to the last nightly version… I will retry later when I ´m come back home to see…
-
Quote
But I think, that I know the answer. You can check the gpiochip571 and you should get "54" for ngpio and "pintctrl-rp1" for label as the return values.
That’s it
Have you had time to test more? Are there any problems or is it working?
I don’t know if it’s due to the board but when I connect the power to the board the pi5 shutdown just after start
I’m not at home right now so it’s a little bit complicated to make test remotely.
-
To make it complete, please check every listed chip:
The correct one has 58 on the RPi4 (but the pin count could be split/vary on RPi5) as the return value for ngpio and I'm assuming the label is "pinctrl-bcm2712" or something similar.
for ngpio i have 32 as result and gpio-brcmstb@107d508500 for the label
-
In the meanwhile I have played a little bit with pinctrl. But it's now your part to test if it works.
Bash: irswitch.sh
Display More#!/bin/bash PINCTRL_BIN=/usr/bin/pinctrl # this is the GPIO pin receiving the shut-down signal GPIOpin1=14 # set GPIO14 to input $PINCTRL_BIN set $GPIOpin1 ip while true; do sleep 1 # check if GPIO14 is going to high power=$($PINCTRL_BIN get $GPIOpin1 | awk '{ print $5 }') if [ "$power" = "hi" ]; then # change GPIO14 to output and set it to high level $PINCTRL_BIN set $GPIOpin1 op dh sleep 3 poweroff fi done
Bash: shutdown.sh
Display More#!/bin/bash PINCTRL_BIN=/usr/bin/pinctrl if [ "$1" != "reboot" ]; then GPIOpin=15 GPIOpin1=14 # execute shutdown sequence on pin # set GPIO15 to output and high level for 125ms $PINCTRL_BIN set $GPIOpin op dh usleep 125000 # change the output to low level for 200ms $PINCTRL_BIN set $GPIOpin dl usleep 200000 # change the output to high level for 400ms $PINCTRL_BIN set $GPIOpin dh usleep 400000 # change the output to low level $PINCTRL_BIN set $GPIOpin dl # set GPIO 14 high to feedback shutdown to RemotePi Board # because the irswitch.sh has already been terminated $PINCTRL_BIN set $GPIOpin1 op dh usleep 4000000 fi
I have to do more tests when I get home, but it seems to be ok
Thanks a lot -
I think it's the same as Rpi4 on libreelec 12 but it doesn't work if i use GPIOpin=527 and GPIOpin1=526
Shell session
Display MoreLibreELEC:~ # ls -la /sys/class/gpio/ total 0 drwxr-xr-x 2 root root 0 Feb 27 18:26 . drwxr-xr-x 58 root root 0 Jan 1 1970 .. --w------- 1 root root 16384 Apr 15 20:42 export lrwxrwxrwx 1 root root 0 Feb 27 18:26 gpiochip512 -> ../../devices/platform/soc/107d508500.gpio/gpio/gpiochip512 lrwxrwxrwx 1 root root 0 Feb 27 18:26 gpiochip544 -> ../../devices/platform/soc/107d508500.gpio/gpio/gpiochip544 lrwxrwxrwx 1 root root 0 Feb 27 18:26 gpiochip548 -> ../../devices/platform/soc/107d517c00.gpio/gpio/gpiochip548 lrwxrwxrwx 1 root root 0 Feb 27 18:26 gpiochip565 -> ../../devices/platform/soc/107d517c00.gpio/gpio/gpiochip565 lrwxrwxrwx 1 root root 0 Feb 27 18:26 gpiochip571 -> ../../devices/platform/axi/1000120000.pcie/1f000d0000.gpio/gpio/gpiochip571 --w------- 1 root root 16384 Apr 15 20:42 unexport
-
Your are welcome.
Please keep in mind that this option to set the GPIO pins in this simple way may be removed in a future kernel release. If this happens, the scripts will need to be switched to using pinctrl or migrated to Python3 scripts.Do you know if there is an adaptation of the old scripts with pinctrl instead of gpio? I have a rpi5 and I think I must use pinctrl.
Can you help me?