Le potato shutdown without any reason - journalctl shows sudo shutdown

Hello,

my Le potato is shutting down almost everyday by itself and when I look at journalctl there is always a shutdown command by sudo after a entropy starvation=0 message.

I’m running the last raspbian image (Bookworm) downloaded at the Libre website on the Le Potato and running the raspbian in a Raspberry PI 4. It only happens on the Le Potato. I’ve changed the power supply to a 3A 5 Volts and didn’t change anything. As the shutdown is showing up on the log without more info, I don’t know what is calling it.

In one of the entries it shown a crontab job, but my sudo crontab has nothing there.

Please look at the pictures attached for the log messages.

I don’t have a clue of what is causing it.

It is running for only a month and it is happening almost everyday.


Per the timestamps, this has nothing to do with entropy starvation. You have some software installed that is running shutdown in a cron job. This is not part of the base image.

You were right, it was my script for the shutdown button. It is working well in my 2 Raspberry PIs for years and is unstable on the Libre Board.

Here is the script:
import libregpio as GPIO
import time
import os

set pin GPIOX_4 to be used as an input

pin = GPIO.IN(‘GPIOX_4’)

wait for a rising-edge event. Bias is set to pull-up

value = pin.wait_for_edge(bias=‘pull-up’, edge=‘rising’)

time.sleep(5)
os.system(“sudo shutdown -h now”)

GPIO.cleanup()

The hardware is only a push button to ground. The switch is working well, I’ve tested.
Do I need to add an external pull-up resistor on this?
The libregpio is the correct one to use? I just followed some tutorials from the forum.

I have a Raspberry PI B+ working this way form more than 5 years, never had troubles. Same thing for my Raspberry PI4 that is working for 2 years without shutdown down like the LIbre board.

Thanks for the help

You would write a device tree overlay that binds a GPIO to a gpio-key. You set the emulated key to the power or some other button and then bind that button to shutdown the machine. Using a hacky script is not the right way as is the case with most Raspberry Pi guides in the wild.

A majority of things in the Raspberry Pi ecosystem are done incorrectly. There is hacking and there are proper way of doing things. Functions that belong in kernel should stay in kernel and not be hacked using userspace scripts.

If my script is the wrong way of doing it, why the are a lot of examples here in the forum doing it the way I did?
Also, can you provide an example of the right way of doing it, as all the examples I saw follow they way I did it?
Thanks

Looking at the guide and the overlays is not clear how I should do it.

I’ve looked at the sudo ldto list and there is a bunch of commands that make some sense, but no examples on how to use them.

I think the rpi-sense should be the one I have to use to get the pin going up after I’ve press the button, but not sure how to do it.

The example provided gpioget.py doesn’t deal with the pin going up or down and don’t mention how you set the pull_up or pull_down resistors.

Can you please explain it and provide an example on how to do it “on the right way” ?

Why it has to be so complicated when compared to the PIs?

This is my last try to make it work. If I can’t I will put PI Hole on this board and forget about it.

There’s already an example but you didn’t bother to look. libretech-wiring-tool/libre-computer/aml-s905x-cc/dt/gpio-key-power-7j1-31.dts at master · libre-computer-project/libretech-wiring-tool · GitHub

Additionally, use the search function. How to add a Power Button to Le Potato board - #16 by blamphos

An example hiding on github is a poor excuse for being so insulting to a customer. And this “hub” is, honestly, a piss-poor excuse for documentation. It’s fine for question and answer, if you prefer answering the same questions over and over, but from the above that doesn’t seem to explain it.

I LOVE that you’re working to upstream support for your SBCs, but I can’t imagine why you have a reputation for good documentation. At least not for anyone without an LKM mindset. :-/

This is the first thing you see here. If you cannot be bothered to search for what you are looking for, hire a software consultancy. We are provide free professional level support so if you are not happy, take your business somewhere else.