Helpdesk

I am struggling with the Serial less mode. I managed to activate it properly but have following issues:

  • Serial less mode is after each reboot deactivated. This means I can establish a connection via UART with the StromPI3. Is this on purpose or a bug? I need always to start script Start_Serialless.py. But this I want to avoid!

  • I connected Reset-Pin to two different GPIO pins (21 and 20). But both pins always have value HIGH; regardless if primary or secondary power source is used. I tried the provided script poweralarm_serialless.py and also reading the pin values with different tools.


I am using latest Raspbian Version and Firmware 1.72 for StromPI3. In serial mode power failure detection works fine.

Michael S.

11.09.19 02:41

Hi Michael S.,
We are trying to reconstruct your observed behavior. Could you execute the StromPi status script and post the output over here?
Thank you.
Best regards
Nils (Joy-IT)

Nils

12.09.19 16:55

Hi Nils,
attached the status script output. I disabled now "power save mode" but this also didn't solve the issue. I also tried GPIO4, because I found some discussion in internet that the RPI4 GPIO pins have no internal pullups and GPIO4 should still work in old behavior; whatever this exactly means. But anyway, GPIO4 also didn't work.
Thanks a lot for your support & help,
Michael ...
---------------------------------
StromPi-Status:
---------------------------------
Time: 00:02:32
Date: Tuesday 01.05.18
StromPi-Output: mUSB
StromPi-Mode: mUSB -> Wide
Raspberry Pi Shutdown: Disabled
Shutdown-Timer: 10 seconds
Powerfail Warning: Enabled
Serial-Less Mode: Enabled
Power Save Mode: Disabled
PowerOn-Button: Disabled
PowerOn-Button-Timer: 30 seconds
Battery-Level Shutdown: Disabled
Powerfail-Counter: 0
PowerOff Mode: Disabled
---------------------------------
Alarm-Configuration:
---------------------------------
WakeUp-Alarm: Disabled
Alarm-Mode: Time-Alarm
Alarm-Time: 00:00
Alarm-Date: 01.01
WakeUp-Alarm: Monday
Weekend Wakeup: Enabled
Minute Wakeup Timer: 30 minutes
PowerOff-Alarm: Disabled
PowerOff-Alarm-Time: 00:00
Interval-Alarm: Disabled
Interval-On-Time: 00 minutes
Interval-Off-Time: 00 minutes
---------------------------------
Voltage-Levels:
---------------------------------
Wide-Range-Inputvoltage: 6.903V
LifePo4-Batteryvoltage:  not connected
microUSB-Inputvoltage: 5.054V
Output-Voltage: 5.015V

Michael S.

12.09.19 19:49

Hi Michael,
we have tried to reconstruct the error with the GPIO tied on High, but on our Pi4 with GPIO21 the behaviour of the Pin turns out like excepted (High on normal state - Low on shutdown state). As i can see in your configuration, you have disabled the Shutdown function of the StromPi3 - so you want to check the current state of the StromPi3 for another purpose?
As for the Serial Communication turning on on reboot: Yes this behaviour is on purpose so the Raspberry Pi System Clock  can be synchronized with the RTC Clock of the StromPi3. We are providing Scripts which can be integrated into the Raspberry Pi Bootup procedure so it will sync the clock and then disable the serialinterface once again.
I have uploaded a modified (untested) Firmware where the serialinterface should stay off, also after a reboot. You can find it here for a test: https://strompi.joy-it.net/wp-content/uploads/2019/09/RB-StromPi3-SerialBootOff.zip
Best Regards,
Jarek

Jens

16.09.19 17:53

Hi!
Before I change my config and play around, please let me know the behavior of the GPIO pin.
Currently I am using a StromPI2 and there I have following setup:

  • Powered by mUSB: GPIO pin high

  • Powered by Wide: GPIO pin low


The same setup I wanted to use with the StromPI3. You write now that the pin is on low when it's in "shutdown state". So what is the "shutdown state"? When is it reached? And when is the StromPI3 automatically switching off the RPi?
Thanks and KR,
Michael ...

Michael S.

16.09.19 19:55

Hi Michael,
when the StromPi3 has enabled the shutdown feature/Timer then it goes to the shutdown state is when a powerfailure on the main voltage source is detected - in this state the predefined shutdown-timer is counting down to give the Raspberry Pi time to quit its processes and shutdown the OS; after that the StromPi3 is cutting off the powersource from the Raspberry Pi and will it bring back after the main Power Source will be back online (this whole procedure would be the main UPS function of the SP3).
Here you can see how to enable the Shutdown-feature

In this described behaviour the Reset-Pin is High in the normal-state and Low in the "Timer" and "shutted-down-state". It would be possible to change the firmware to reconstruct the behaviour of the previous SP2, but for this we would need a more detailed description of your requirements.
Best Regards,
Jarek

Jens

17.09.19 11:43

Hi Jarek,
I understand what you now wrote. This means GPIO pin is only set to LOW when StromPI3 is in shutdown mode. Without setting a shutdown mode in config the PIN will stay on HIGH although backup power supply is used. Right? I would suggest to generally switch the PIN also on LOW in that case. Otherwise it will never become LOW in that setup. Or did I again misunderstand something?
Just to explain you what I want to achieve:

  • powered by mUSB -> standard behavior -> all scripts are running as scheduled -> most data is saved into memory and only saved all 8 hours to SD Card (to avoid to much write access to SD Card)

  • powered by Wide & battery voltage still ok -> Audio alarm each 5min -> stop execution of scripts which are not essential (to save battery power) -> save data in memory all 30mins to SD Card (treated as temporary data backup)

  • powered by Wide & battery voltage critical -> final saving of data to SD Card and shutdown of raspberry


Using the UART communication above scenario can be achieved; but how to manage this in serial less mode?
Do you have a suggestion?
KR,
Michael ...

Michael S.

17.09.19 23:58

Hi!
I checked now source code of 'main.c' and just thought how I could implement a feature with using only on GPIO pin to transmit three states. Is it easy possible to toggle between HIGH - LOW - HIGH with different timing?
E.g.

  • Always HIGH = main power supply

  • HIGH - LOW - HIGH = with a LOW of e.g. 2 secs -> secondary power supply

  • HIGH - LOW - HIGH = with a LOW of e.g. 4 secs -> shutdown mode


Additionally I saw that the "Battery Shutdown Mode" only referes to the onboard battery voltage and not the wide voltage. Did I read the source code correctly? Because in my scenario I have attached an external battery (6 x 1.5V) on Wide which should trigger the final shutdown.
KR,
Michael ...

Michael S.

19.09.19 01:30

Hi Michael,
you are right. The batteryshutdown refers just to the voltage of the battery connector.
Is it easy possible to toggle between HIGH – LOW – HIGH with different timing?
E.g.

  • Always HIGH = main power supply

  • HIGH – LOW – HIGH = with a LOW of e.g. 2 secs -> secondary power supply

  • HIGH – LOW – HIGH = with a LOW of e.g. 4 secs -> shutdown mode



Yes, it is possible. But you need to implement this into the firmware. Sorry, I can't guess the effort needed for this.


Best regards
Nils (Joy-IT)

Nils

19.09.19 19:35

I managed to change source code, compile it and put it on my StromPI3. At least LOW and HIGH is now working as it was with StromPI2. The next days I implement the feature to communicate three states via one pin and check wide voltage for triggering the shutdown (instead of battery).
Thanks for sorting out the current logic that I can easily interpret the sourcecode ( I have no debugger feature ) and that you provide the sourcecode, that we can modify the firmware to some special needs.
KR,
Michael ...

Michael S.

20.09.19 01:46

Hi Michael,
I wish you good luck. We are pleased, if we can help our customers to realize their projects. If you need further help, don't hesitate to contact us.
Best regards
Nils (Joy-IT)

Nils

20.09.19 11:40