Helpdesk

Hello,

I need a completely autonomous UPS system in a vehicle (12V). I am doing some tests with the mUSB in my lab, and I have set the StromPi-Mode to 6. Wide-> mUSB-> Battery.

In my case, if the stompi poweroff the raspberry after a primary power failure, on powerback, the rasp must restart. Too restrictive to ask the driver to press a button and the raspberry is not close to him.

The mUSB / Battery switch is OK. but I have questions about the poweroff, powerback and boot process.

Currently, I have set the Battery-Level Shutdown to 50%, and I unplug the mUSB.

At 50%, (or if I set a timer for the poweroff) the strompi poweroff the raspberry. When the power is back on the Wide or mUSB, will the raspberry automatically restart?

If all cards are completely off. battery empty for example.
When the power is back, will the raspberry restart automatically?

Because, currently, it's not the case. The raspberry seems to be in a kind of sleep mode, the only way to start the raspberry after a poweroff and a powerback is to plug a eth0 lan for me (wakeup on lan is enabled)

I use a raspberry PI 3B +, with the last lite image.

My strompi status:

---------------------------------
StromPi-Status:
---------------------------------
Time: 11:56:32
Date: Wednesday 21.10.20

StromPi-Output: mUSB

StromPi-Mode: Wide -> mUSB -> Battery

Raspberry Pi Shutdown: Disabled
Shutdown-Timer: 120 seconds

Powerfail Warning: Disabled

Serial-Less Mode: Disabled

Power Save Mode: Disabled

PowerOn-Button: Enabled

PowerOn-Button-Timer: 30 seconds

Battery-Level Shutdown: 50%

Powerfail-Counter: 5

PowerOff Mode: Disabled
---------------------------------
Alarm-Configuration:
---------------------------------
WakeUp-Alarm: Disabled
Alarm-Mode: Minute WakeUp-Alarm
Alarm-Time: 00:00
Alarm-Date: 01.01
WakeUp-Alarm: Monday
Weekend Wakeup: Enabled
Minute Wakeup Timer: 01 minutes

PowerOff-Alarm: Disabled
PowerOff-Alarm-Time: 00:00

Interval-Alarm: Disabled
Interval-On-Time: 01 minutes
Interval-Off-Time: 1440 minutes

---------------------------------
Voltage-Levels:
---------------------------------
Wide-Range-Inputvoltage: not connected
LifePo4-Batteryvoltage: 3.452V [100%] [charging]
microUSB-Inputvoltage: 5.145V
Output-Voltage: 5.116V



Thanks,

S.Reillon

21.10.20 16:02

Hello,

you need to enable the Raspberry Pi Shutdown and set the shutdown timer in your StromPi configuration.
This way the StromPi will cut the power to the Raspberry Pi if the primary power supply has failed and the shutdown timer has expired. When the primary power supply returns the Raspberry Pi will reboot.
The only way the StromPi can't reboot the Raspberry Pi would be if the power returns before the shutdown timer has expired and after the Raspberry Pi has been turned off by the serialshutdown script.
To avoid this, the time between the two shutdown timers must be as short as possible, so that there is just enough time to shut down the Raspberry Pi safely before the StromPi cuts the power.

Best regards

Tim (Joy-IT)

Tim

22.10.20 12:04

Hello,

In fact with:

StromPi-Mode: Wide -> mUSB -> Battery

Battery-Level Shutdown: 10%

WakeUp-Alarm: Enable
Alarm-Mode: Minute WakeUp-Alarm
Weekend Wakeup: Enabled
Minute Wakeup Timer: 01 minutes

All the others params Disable.

It works perfectly. The raspberry reboots after 1 min (good thing to wait a stable primary power) after primary powerback (with mUSB, I have to test the Wide). With any kind of strompi-poweroff.

With the 1000ma battery, I have 01h24 of autonomy until 10%.

Now, I have to find a way to make a poweroff with a switch on the primary cable. And I can do that with the param Raspberry Pi Shutdown.

Thanks and best regards,

S.Reillon

22.10.20 13:23

However, I stupidly forgot one big detail (I'm a noob with strompi, sorry), the management of the shutdown of the raspberry and it's hard to manage that properly like many of us.

The param "Battery-Level Shutdown" doesn't send the poweroff notification on the serial port.

So, I will use only:

WakeUp-Alarm: Enable
Alarm-Mode: Minute WakeUp-Alarm
Weekend Wakeup: Enabled
Minute Wakeup Timer: 01 minutes

All the others params will be disable.

A script will check every X seconds the state of:

Wide-Range-Inputvoltage: not connected
LifePo4-Batteryvoltage: 3.452V [100%] [charging]
microUSB-Inputvoltage: 5.145V
Output-Voltage: 5.116V

And I will send poweroff on the serial with a script in a systemd service before the shutdown of the raspberry, and use the poweroff of the OS. When I want.

I guess the command poweroff of the strompi shutdowns the card whatever the state of the primary power?

I hope.

Regards,

S.Reillon

23.10.20 04:22

Hello,

yes, the poweroff command will shutdown the StromPi regardless of the status of the power supply.

Best regard

Tim (Joy-IT)

Tim

23.10.20 13:53

Hello,

Some lastest news:

In fact, when I write a static ip=x.x.x.x in the /boot/cmdline.txt file for eth0 with a hostapd enabled on wlan0, to reboot the raspberry after a poweroff and powerback, I have to use:

WakeUp-Alarm: Enable
Alarm-Mode: Minute WakeUp-Alarm
Weekend Wakeup: Enabled
Minute Wakeup Timer: 01 minutes

There are troubles with the raspberry about that.

But when I remove ip=x.x.x.x, with the hostapd enabled, no need to have Alarm-Mode: Minute WakeUp-Alarm. The raspberry reboot almost instantly.

So the only param I use is StromPi-Mode: Wide -> mUSB -> Battery

For your information, for the shutdown process, a service like this works perfectly:

[Unit]
Description=poweroff spi
DefaultDependencies=no
Before=shutdown.target poweroff.target halt.target

[Service]
Type=oneshot
ExecStart=/etc/spi.d/spi-poweroff.sh 
TimeoutStartSec=0

[Install]
WantedBy=shutdown.target poweroff.target halt.target

In spi-poweroff.sh, the bash run a python script to send poweroff on the spi serial0.

When you use sudo poweroff with the Raspberry PI OS, all is shutdown properly.

regards,

S.Reillon

28.10.20 19:48

Hello S. Reillon

that's great, thank you for the information.

Best regards
Tim (Joy-IT)

Tim

29.10.20 14:08