Helpdesk

Hi.
I'm currently working with firmware version 1.7 using strompi-mode 3.
It is my goal to ensure that after loss of the primary power source the Raspberry Pi shuts down and the StromPi as well a short time after that. I fear that if there happens a PowerBack event after the RaspberryPi has begun to shutdown the StromPi does not. In this situation the re-attching of the primary power source does not boot the RasperryPi.
I assume that setting a PowerOff-Alarm-Time in the near future would ensure the powering off of the StromPi. BUT I can see that the PowerOff-Alarm-Time does not take seconds? Is that an error in the documentation? Why would it not be possbile to set a PowerOff-Alarm-Time with a resolution of 1 second?
Overall, is my way of tackling the problem stringent? As the documentation was rather rudimentary this has been my approach so far.
Regards, Armin

Armin

21.05.19 18:26

Hi Armin,
sorry for our late reply. As for the documentation, we are currently updating it to a considering also the newest changes of the Version 1.7.
The PowerOff-Alarm is not for this purpose you are describing: It is for the regular and planed PowerOff-Event, which you can program to shutdown the Raspberry Pi at a given time - With the combination of the WakeUP-Alarm (Time-, Date- and Weekdayalarm) you can start the Raspberry Pi at 8 o'Clock in the morning and after that you can shut it down at 17 o'clock in the afternoon for example. That's why it is in minutes resolution - also for using it correctly you also have to ensure to run the provided Scripts in the background so the Raspberry Pi can process the messages for the shutdown from the StromPi.
As for your application, you have to use the Shutdown-Timer and enable the Shutdown Feature - in the event of a powerloss, the Raspberry Pi gets its message of Powerfailure from the StromPi and waits a few seconds if there will be a Powerback-Event Message (this length of this time you can modify in the "Serial\serialShutdown.py" Script) - if no such Message occure, then the Raspberry Pi will be shutted down through "sudo shutdown -h now" and then the StromPi 3 cuts off the PowerSource after the Shutdown Timer has elapsed.


Best Regards,
Jarek

Jens

23.05.19 11:44

Hi Jarek,
thank you for your explanation. I am aware of the serialShutdown.py script.
Although it tries to react on the Power-Back event ther can be a flaw. What if the primary power source is reattached in the phase between shutting down the Raspberry Pi (via script) and shutting down the Stromg Pi?
In this situation the combined system will never be started again without detaching hardware. Is it possible to tell the Strom Pi via configuration not to react on a power back itself?
My easiest solution out would have been setting the Power-Off timer as intially described by me. If this solution would not be needed all the better.
Thanks, Armin

Armin

24.05.19 09:51

Hi,
I would like to compact my question to my core intent:
Is the StromPi configurable in a way, that if "Raspberry Pi Shutdown" is enabled, the Raspberry does shutdown using "serialShutdown.py" but the StromPi does power down guaranteed after "Shutdown-Timer" seconds even if a "PowerBack" event occurs inbetween?


Thanks, Armin

Armin

24.05.19 16:53

Hi Armin,
yes this would be possbile, but as for this there have to be some changes made in the sourcecode of the firmware - we will check these after the weekend and we will upload a modified version for this setup.
Best Regards,
Jarek

Jens

24.05.19 19:50

Hi Jarek,
that is great to hear!
If this feature would work reliably we would integrate the StromPi into a prototype series.
Thanks, Armin

27.05.19 13:03

Hi Armin,
sorry for keeping you waiting - today I've made the requested changes into the firmware and you can find it for download following this link https://strompi.joy-it.net/wp-content/uploads/2019/05/RB-StromPi3_v171Alpha.zip
For this Version there is no updated config script (it would be released with the new version at the beginning of next week), so you would have to manually enable the feature through the CLI/Serial Interface (minicom) -
You have to use the following two commands:
set-config 25 1
set-config 0 0
To disable the Feature:
set-config 25 0
set-config 0 0
You can test the new version and it would be nice if you can give us a quick feedback ;)
Best Regards,
Jarek

Jens

28.05.19 19:35

Hi.
Thank you very much, I will test it ASAP.
Regards, Armin

Armin

29.05.19 14:43

Hi.
My findings so far:
I have updated the firmware successfully. Then I have used strompi-config.py to set the following values:

  • Mode = 3

  • Shutdown = enable

  • shutdown-time = 10 sec

  • everything else disabled (not setting time, no setting alerts)


Then I've used screen to connect to SSPC successfully. There it enter the following commands without error:

  • set-config 25 1

  • set-config 0 0


Then I quit SSPC and started script power-down.py which executes shutdown after receiving "xxx–StromPiPowerfail–xxx". This is down successfully.
After 10 seconds StromPi powers down.
BUT: When I re-attach the primary power source the StromPi is not powering up, nor the Raspberry.
If I attached my power source to the Raspberry directly I can start it and then do a screen session with the StromPi (which has no LED active since the power down). In that screen session I tried to restore (?) the original state by:

  • set-config 25 0

  • set-config 0 0


The I shut down the Raspberry and tried to attach power to the StromPi. BUT still no life sign, no LED, Raspberry does not start.


Regards, Armin

Armin

29.05.19 16:09

PS: I have just removed the battery HAT, the I could boot after attaching the primary power source.

29.05.19 16:10

Hi Armin,
sorry for that, but I have forgotten yesterday to make some additional notes: After the PowerOff has been triggered the StromPi3 will only react on a PowerOn-Button Signal or if all of the voltage sources are take off from the StromPi3 and reconnecting them after that (like you did it with the Battery Hat). For more information about the PowerOnButton, you can find the manual for this feature following this link: https://strompi.joy-it.net/wp-content/uploads/2019/05/RB-StromPi3-PowerOn-Button-Manual_29052019.pdf
Best Regards,
Jarek

Jens

29.05.19 18:20

Hi Jarek,
this is unfortunately not applicable for us as StromPi will not be reachable to perform the PowerOn-Button maneuver.
The case that the StromPi cannot be power on again while the Battery Hat remains attached exists because of hardware reasons? Can this be solved by firmware at all?
Best regards, Armin

Armin

04.06.19 16:07

Hi Armin,
it is not a hardware reason that the Battery-Hat have to be disconnected, but its based on the software solution of the PowerOff-Feature: As the Shutdown Event occurs, then the Poweroff blocks all Powerback cases - only a restart of the StromPi3 (disconnect all Power Sources) or the PowerOn Button can restore the normal State of the StromPi3.
It would be possible to configure a timer for such PowerOff-Event, so the Powerback cases will be enabled after a period of time. If this would be okay, I can give you a modified version of the firmware.
Best Regards,
Jarek

Jens

04.06.19 19:13

Hi Jarek,
I would love to give this solution a try. Could you maybe make the mentioned timer configurable? In that case I could test heuristically if the system comes back to live as we would need it!
Thank you very much, Armin

Armin

05.06.19 09:57

Hi Jarek,
could you tell me when the firmware could be provided for testing? We would need it rather urgently.
Best regards, Armin

Armin

07.06.19 09:31

Hi Armin,
sorry for keeping you waiting - you can find a version with a timer follwing this link:
https://strompi.joy-it.net/wp-content/uploads/2019/06/RB-StromPi3-Armin.zip
The Timer is preconfigured to 30 seconds and can be changed with "set-config 26 x" + "set-config 0 0" ( x is for seconds - 50 seconds=> set-config 26 50).
The System is held in a blocked power off state while the timer is counting down - after it has reached 0 the primary source will be able to power the system in again.
Best Regards,
Jarek

Jens

07.06.19 19:10

Hi Jarek, thank you again. Again the is unforunately some kind of error involved in the current firmware (or my configuration).
I did the following steps:



  • 1) Flashed connecting power to MicroUSB of StromgPi and Raspberry

  • 2) Configured strompi_config.py:

    • StromPi-Mode 3

    • Raspberry Pi Shutdown 1

    • Shutdown Timer 10

    • everything else disabled, did not set time nor timer



  • 3) Connected via screen to configure custom configs:


set-config 25 1
set-config 26 11 // power can come back on after 11 seconds
set-config 0 0

  • 4) Detach all power cables, battery HAT is on. Attach only MicroUSB to StromPi

  • 5) System starts, I start my script that shuts the Raspberry down in signal „xxxShutdownRaspberryPixxx\n“ which works.

  • 6) After that I unplug MicroUSB from StromPI

  • 7) Raspberry gets signal to shutdown and does that.

  • 8)  After approx. 10 or 11 seconds the StromPi powers down.

  • 9)  After approx. 20 seconds it powers back on by itself and boots the Raspberry.

  • 10)After approx. 11 seconds StromPi powers itself of.

  • 11)GOTO 10


So this timer seems to alternate between ON and OFF state. During the ON state I can plug on and off the MicroUSB cable which does not change the behaviour. If I plug in the MicroUSB cable during the OFF phase, the cycle is stopped.


Could you please provide a solution for that?
Thanks, Armin

Armin

11.06.19 16:18

Hi Jarek,
I've given the process described by me another try with a (minor?) difference:
Previously I have used this sequence to configure the custom items:
set-config 25 1
set-config 26 11
set-config 0 0
This led to the described loop.
Now I have altered the sequence a little and the behaviour seems to be ok now:
set-config 25 1
set-config 0 0
set-config 26 15
set-config 0 0
2 differences:

  1. set-config 0 0 is executed after each custom setting command, does this have an effect compared to execute it once after both commands?

  2. The 26-Timer has been set to 15, was 11 before. Is 11 too narrow to the 10 seconds of the power-off timer? Would make no sense to me if it were.


Best regards, Armin

Armin

11.06.19 17:23

Hi Armin,
I have just rechecked the Firmware and couldn't reproduce your prpblems - can you try your procedure with the settings described in the picture which I have attached at this message. Also please make sure that the battery would be charged above 50%.
Best Regards,
Jarek

Jens

12.06.19 13:59

Hi Jarek, thanks for your answer.
Till now the described behaviour did not occur again. I will keep you posted.
One more question: Is there a way to get the current configuration of the StromPi including my special values that are being set with ids 25 and 26 with command set-config? Is there a get-config?
Best regards, Armin

Armin

12.06.19 17:36

Hi Armin,
the Poweroff-feature linked to set-config 25 is included in the current configuration scripts, so also there the status would be shown. Unfortunately the timer wouldn't be included in the scripts as for now, but I have uploaded here https://strompi.joy-it.net/wp-content/uploads/2019/06/RB-StromPi3-Armin2.zip a version with the possibility to go into the terminal and use the "show-status" command to look into the configured values.
Best Regards,
Jarek

Jens

13.06.19 11:57

Hi Jarek,
great, thank you, I was now able to verify my scripted configuration of StromPi including my custom configs.
Thank you very much.
Best regards, Armin

Armin

13.06.19 16:12