BPI-R4 RST button and WPS button

Hello

I would like to ask how to reconfigure the function of RST button and WPS button on BPI R4 with debian11 ?

Please note the current RST button is reboot the system

Thank you.

you cannot change RST-button as it resets hardware. WPS button is defined in devicetree, but no idea how to map it to something :slight_smile:

But how to set the RST button to restore configs then reboot

You probably can’t. Without looking at the schematics I assume it is wired to the EN (enable) or RST input of the chip / SoC.

Edit: So whatever you want to do has to be handled by the bootloader. Like detecting that the device wasn’t “properly shutdown” or some kind of failsafe.

1 Like

Is it possible to reset the R4 via serial console? In other words, is it possible to reset the R4 remotely?

When serial is still active (not on kernel crash) you can use os commands (e.g. reboot or reset in uboot). But for real reset i know no tested way…maybe you can trigger the reset gpio,but some parts will not powercycle (like sfp).

My primary concern is to do it remotely in case linux crashes or network is down. So gpio looks the only solution.

Any way to do it from another linux machine? Pikvm style? (Without pikvm of course)

If I could understand correctly

You cad use minicom by linux bash cmd

minicom -D /dev/ttyS0 -b 115200

And do as serial

I test minicom for other thing not your case

Yes, but how to reset R4 remotely?

Basicly you need external device as it could be such unresponsive that you cannot trigger reset after a crash. So e.g. using an rpi for this and a circuit bridging the reset button (transistor/mosfet), best electrically isolated (optocoupler).

Yes Frank, i already got a rpi controlling a mini pc (pikvm), so i’m thinking about connecting a usb serial cable from the rpi to the R4. But there is still missing an option for resetting the R4.

I can connect yet another usb cable to those reset pins on the gpio, but is there such cable?

Rpi has gpios…just use one adding a optocoupler+mosfet circuit to bridge pins from reset button of r4 (soldering needed there)

Ah, the gpios are all used by another board, geekworm board for pikvm. Maybe with another usb serial cable it is possible? All it is needed is to somehow send a signal to those reset pins, right? Going to search for the gpio diagram.

No,not sending anything to pins…just electrically short the pins from reset button (like the button is manually pressed) but there should be no current from rpi to bpi-r4 so use optocoupler+mosfet to really only bridge the pins like the button. If you have no pins you can extend it using a an arduino nano or similar,but this is a bit more work as these microcontroller running fixed code…you need a way to trigger it somehow (e.g. protocol via network).

Eh, that sounds complicated, i’m not an eletronics guy. So at this point, i’m thinking maybe a power adapter that can be controlled somehow. turn off / turn on.

yes, maybe some smart home power socket (but most are wifi) is much easier…wasn’t widely spreaded where i did this thinkings some years ago :slight_smile:

Use the watchdog timer?

Take it in control in userspace and only reset it in a script, only when a certain ping command is succesful

You could even have the script try to reboot nicely first, if unsuccesful, don’t reset wdt and reset the board the hard way.

Right linux also supports automatic reboot on crash,but make sure you have pstore working to allow searching for rootcause.

Alright, thanks for the tips guys, going to check out that watchdog.