StromPi3 + RPI4 + Serial-Less Mode

375 views
0 Comments

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.

Answered question

10 Answers

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)

Answered question
Michael S. (anonymous) 0 Comments

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 …

Answered question

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)

Answered question
Michael S. (anonymous) 0 Comments

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 …

Answered question
Michael S. (anonymous) 0 Comments

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 …

Answered question
Write your answer.