STROMPI 3 Power-Solution
1. TABLE OF CONTENTS 1. Table of contents 2. General information 3. Overview 4. Current sources 5. QuickStart 6. Functions of the StromPi 3 6.1 Prioritisation of input 6.2 Time-controlled applications 6.2.1 Real Time Clock 6.2.2 Automatic configuration of time 6.2.3 Shutdown Timer 6.2.4 Alarm Modes 6.2.5 PowerOff-Alarm Mode 6.2.6 WakeUp - Alarm Mode 6.2.7 Minute WakeUp-Alarm 6.2.8 Weekend WakeUp-Alarm 6.2.9 Interval Function 7. Additional functions 7.1 Serialless Mode 7.
2. GENERAL INFORMATION Dear costumer, Thank you for purchasing our product. The structure and functions of the StromPi3 are explained in the following chapters. We show you which settings should be made so that the Raspberry Pi will work smoothly with the StromPi. If you have any difficulties with the usage of the device, do not hesitate to contact us. The StromPi 3 enables the Raspberry Pi® and other single-board computer new areas of application.
3. OVERVIEW There are now 2 versions of the StromPi, the first version Rev 1.0 and the new version Rev 1.1. In Rev 1.1 the modifications for the PowerOnButton and the SeriallessMode have already been integrated. Rev 1.0 Jumper Powersave mode LiFePO4 battery Jumper Flash mode high - power USB output GPIO port data input (for highpower USB output) & current output microUSB - voltage input wide-range voltage input Jumper capacitor - buffering With heavy load the StromPi 3 can heat up.
Rev 1.1 Jumper Powersave mode LiFePO4 battery Jumper Flash mode High - power USB output GPIO port Data input (for highpower USB output) & current output MicroUSB - voltage input Jumper Serrialless mode PowerOnButton Wide-range voltage input Jumper capacitor - buffering The newly added serialless jumper connects the GPIO 21 (pin 40) of the Raspberry Pi to a GPIO of the microcontroller when set to "ON". The serialless function must still be activated as usual in the configuration of the StromPi 3.
4. CURRENT SOURCES The StromPi 3 can get its power from three different current sources. In case of a power failure it switches steplessly to the current source which is configurated as the second and if necessary to the third. microUSB The StromPi 3 can of course, as usual, be powered via the microUSB port. Wide - Range The Wide mode can be used with a voltage source from 6V - 61V. Connect the marked port to an arbitrary voltage source, like a power supply or a vehicle electrical system.
5. QUICKSTART In this chapter you will find the necessary steps to use the StromPi 3. Activation of the serial communication More details can be found in chapter 8.1 Use the following commands to install the required dependencies and then open the file config.txt . sudo apt-get update sudo apt-get install python-serial python3-serial sudo nano /boot/config.
6.
StromPi V3 Powerpath Mode: The StromPi V3 Powerpath Mode determines the prioritization of the separate voltage sources. Powerfail Warning Mode: The PowerFail Warning Mode will warn in case that the prioritized voltage source is failing. Battery Shutdown Mode: The Battery Shutdown Mode determines at which battery charge level the Raspberry Pi should be shut down. Serialless Mode: The Serialless Mode allows to use the serial ports for other purposes by communicating via a GPIO pin. [Rev 1.
6.1 Prioritisation of input Die Spannungsquelle aus der der StromPi 3 seine Energie bezieht, kann je nach Wunsch und Einsatzzweck eingestellt werden. Zusätzlich lässt sich eine zweite oder sogar eine dritte Spannungsquelle wählen, die automatisch die Versorgung übernimmt, falls die erste Quelle ausfallen sollte. Die Werkseinstellung ist so konfiguriert, dass der microUSB-Eingang als Hauptstromquelle dient.
6.2 Time-controlled applications 6.2.1 Real Time Clock The StromPi 3 also has a real-time clock. Should the power fail, even time-controlled applications are not endangered. Time controlled starts and shutdowns of the Raspberry Pi is also not a problem! Please note that for continuous operation of the RTC at least one of the power sources (mUSB, Wide Range or battery) must remain connected to the StromPi 3. If all power sources are disconnected, the current time is not stored.
6.2.3 Shutdown Timer The StromPi 3 has a shutdown timer which automatically interrupts the power supply of your Raspberry Pis after a failure of the primary power supply is detected. The period of time, when the shutdown after the failure of the power supply, you can choose individually, according to your needs, adapt. For example, if you have set the shutdown timer to 600 (600 seconds -> 10 minutes), the system behaves as the following: If the StromPi 3 now detects a power failure, the timer starts.
To activate the Shutdown Timer, select Enable at Choose Shutdown Mode and enter the desired shutdown time in seconds into the adjacent field. Finally, confirm with Update. 6.2.4 Alarm Modes The StromPi3 has the possibility to start and shut down the Raspberry time-controlled. With the combination of WakeUp-Alarm and PowerOff-Alarm Mode, you can configure an individual start-stop behaviour for your Raspberry Pi (e.g. start at 10:45 every day and stut down at 13:00 ).
6.2.5 PowerOff - Alarm Mode The PowerOff alarm allows you to use the Raspberry Pi every day at a preset time. However, the Raspberry Pi can only be shut down once a day using this mode. If you want to shut down the StromPi3 time-controlled start the config script. Switch Choose PowerOff-Alarm Mode to Enable to activate the PowerOff-Alarm. The time at which the Raspberry Pi should shut down, is entered into the two fields to the right of it.
Depending on what you have set in Choose Alarm Mode, your Raspberry Pi will now run daily, weekly or just at a set date at the set time. With Alarm Mode 1, your Raspberry starts at the set time every day. With Alarm Mode 2, your Raspberry starts on a special date at the time you set. With Alarm Mode 3, your Raspberry will start at a weekday once a week. With Alarm Mode 4 you activate the Minute WakeUp Alarm. The alarm mode refers exclusively to the WakeUp-Alarm, it has no influence on the PowerOff-Alarm.
6.2.9 Interval Function The interval function allows you to define time intervals in which the Raspberry Pi is switched off and on again with the help of the StromPi 3.You can activate and configure this function in the config script by Timer. Switch Choose Interval-Alarm Mode to Enable to enable the Interval Function to be activated. At Interval On-Time in minutes ,you can set the time that the Raspberry Pi should stay on in minutes.
7. ADDITIONAL FUNCTIONS 7.1 Serialless Mode The Serialless Mode allows you to use any serial communication of the StromPi, you can e.g. suppress another HAT, which uses the serial interface, can be used simultaneously with the StromPi. However, this also prevents the StromPi 3 from being configured, which is why it is useful to configure the StromPi before you activate the Serialless Mode.
7.3 PowerOn-Button Mode The PowerOn-Button Mode allows the StromPi to be start again after a shutdown with the poweroff command or the PowerOff-Alarm without disconnecting the power supply or removing the BatteryHATs. Only a small modification is necessary for this function when using StromPi3 Rev 1.0. A cable bridge must be soldered in between two solder pads. Then it is possible to restart the StromPi 3 by bridging the reset pin. If the StromPi 3 Rev 1.
7.5 Power Save Mode The Power Save Mode allows you to drastically reduce the power consumption of the StromPi 3 by switching off the voltage converter when the Wide port is not in use and switching it only on in case of a power failure of the primary power supply. This is only possible in low current mode (below 2.5 A). If the current is too high, there could be complications when switching the powerpaths. To activate the Power Save Mode, the jumpers are set OFF like shown in the following picture.
8.1 Activation of the serial communication In order to use the functions of the StromPi and to make settings, a few adjustments must be made to your Raspberry Pi. First, you need to install the Python3-Serial library by typing the following command into the console of the Raspberry Pi: sudo apt-get install python-serial python3-serial Then open the console on your Raspberry Pi and enter the the following command: sudo nano /boot/config.
Use the arrow keys on your keyboard to navigate to menu item 5 Interfacing Options. Select the point P6 Serial. The question Would you like a login shell to be accessible over serial? answer with No. The question Would you like the serial port hardware to be enabled? answer with Yes. www.joy-it.net Pascalstr.
After confirming again, you can exit the menu with Finish. Answer the question after restarting the device with Yes. The serial interface is now activated and the serial console deactivated. 8.2 Execution of the GUI script Attention! The StromPi config script does not work with the CLI version of the StromPi firmware, only with the main version of the firmware. In addition, the serial communication must be activated [see chapter 8.1 Automatic execution of scripts].
8.4 SSH-connection via PuTTY and Xming Execute the following command: sudo raspi-config Go to Interfacing Options And activate afterwards SSH. Now you have to download PuTTY and Xming. Xming Now start the XLaunch.exe file in the installation directory of Xming. Select Multiple Windows and Display number as 0. www.joy-it.net Pascalstr.
Make sure that Start no client is selected: Press Next without making any changes: Now press Finish: www.joy-it.net Pascalstr.
PuTTY Now you still have to set PuTTY. Make sure that you have selected in Session → SSH and have entered the IP address of your Raspberry Pi. Now make sure that the X11 → Enable X11 fowarding is switched on and enter Xdisplay location → localhost:0.0 . Now press Open and you should see the following: Now enter your login data. You have successfully established the SSH connection. www.joy-it.net Pascalstr.
Now enter the following command: sudo -E python3 strompi_config_gui.py Now the graphical interface opens, which looks as the following: The displayed values are synchronized with the values you set in the StromPi when the script is started. You can now change any values and then click Update to change the settings of your StromPi. 8.5 SSH-connection via MobaXterm Make sure that SSH is enabled, if it is not already enabled, see the last chapter on how to enable SSH. Next, download MobaXTerm. www.joy-it.
Now press Session and then select SSH. Now enter the IP address of your Raspberry Pis at Remote host and pi at Specify username. Then press OK and enter the password of your Raspberry Pi if prompted. You can call the graphical interface with the following command: sudo -E python3 strompi_config_gui.py This should look as the following: www.joy-it.net Pascalstr.
The displayed values are synchronized with the values you set in the StromPi when the script is started. You can now change any values and then click on Update to change the settings of your StromPi. It is possible that your script looks different. The Poweroff Mode and the Power Save Mode were added for a later firmware version. 9. STROMPI 3 SCRIPTS You can download all StromPi scripts published by us here.
Poweralarm_serial.py This script sends an email to the specified email address in the script if the primary power supply fails. Another email will be sent when the primary power supply is available again or when the Raspberry Pi is restarted. In line 22 you can set the notification mail when restarting the Switch the system on (1) or off (0). SERVER is your SMTP e-mail server (e.g. smtp.your-e-mail-server.
In line 11 of the script, you can change the GPIO pin you use for alternative communication for the serialless mode. In line 14 you can switch the notification mail on (1) or off (0) at system reboot. SERVER is your SMTP e-mail server (e.g. smtp.your-e-mail-server.
RTC_serialShutdown_serialless.py This script has all the functions of the powershutdown_serialless.py script and additionally compares the time of Raspberry Pi and that of the StromPis. The older time is overwritten with the more recent one. The Shutdown Timer and the GPIO pin that you use for the alternative communication inm the Serialless Mode, can be changed in lines 11 and 12.
RTCSerialless.py This script was written especially for the serialless mode. When the script is started, the serialless mode is terminated, so that the time of the Raspberry Pi and the StromPis can be compared and the older one will be overwritten with the more current time. Afterwards the serial mode is reactivated. Because the serial communication is now deactivated, you cannot make further changes to the configuration of the StromPi.
9.3 Raspberry Pi Pin-Layout Here you can see the pin assignment of the Raspberry Pi: 1 3.3 V DC 2 5 V DC 3 GPIO 2 (SDA1, I2C) 4 5 V DC 5 GPIO 3 (SCL1, I2C) 6 Ground 7 GPIO 4 8 GPIO 14 (TXD0) 9 Ground 10 GPIO 15 (RXD0) 11 GPIO 17 12 GPIO 18 13 GPIO 27 14 Ground 15 GPIO 22 16 GPIO 23 17 3.
9.4 Automatic execution of scripts Scripts can be added to the autostart of your Raspberry Pis to be executed when the Raspberry Pis is started: sudo nano /etc/rc.local Here you can add the script to the autostart. The following command must be inserted before the exit 0 command. python /home/pi/Skriptname.py & Example with the RTCSerial.py script: If you have not copied the script to the /home/pi folder, you will need to change the path accordingly.
Variant1 Variant 1 is the fastest solution, but can only be used if you are not using a battery hat. Just plug a cable to the reset pin as shown in the following picture. To do this You have to remove the jumper. The other end of the cable must be connected to a GPIO pin. You can use any other GPIO pin, but the software must be adapted accordingly. www.joy-it.net Pascalstr.
Variant 2 Solder one end of the cable to the free pad as shown in the picture. Note that the jumper on the reset pin must be set. The other end of the cable is connected to a free GPIO pin. www.joy-it.net Pascalstr.
Variant 3 For variant 3, solder one end of the cable to the free pad of the reset pin, like in variant 2. Again, the jumper must remain set. Solder the other end of the cable as shown in the picture below one of the GPIO pins. www.joy-it.net Pascalstr.
PowerOn-Button The two solder pads marked in red must be bridged with a cable. First apply some solder to both pads. Now solder one end of the cable to the upper pad. Finally the other end of the cable is soldered to the lower solder pad. www.joy-it.net Pascalstr.
Now you can start the system after a Poweroff - command by short-circuit the reset pins marked in red and restart. In operation the pins must not be bridged. For more comfort it is possible connect a push button (normally open contact) to the pins in order to short circuit them at the restart. IMPORTANT! There must be at least 30 seconds between Poweroff and restart.
For more information about the Serialless Mode please read the Serialless instructions. www.joy-it.net Pascalstr.
11. OPENING THE SERIAL CONSOLE To make settings manually via the StromPi console, you must download and install Minicom, enter the following commands: sudo apt-get update sudo apt-get install minicom After Minicom has been successfully installed, you can establish a serial connection to the StromPi 3 with the following command: sudo minicom -D /dev/serial0 -b 38400 Attention! The system is now waiting for another input and may not display your next keystrokes.
Should be after entering the command: sudo minicom -D /dev/serial0 -b 38400 Port/dev/tty8 (like in the picture) and not Port/dev/serial0 then you have to configure Minicom manually. To achieve this, enter the following command: sudo minicom -s You will now see the following window: Select Serial port setup here. Then the following window appears: Now press A and change /dev/tty8 to /dev/serial0. Then confirm with Enter. www.joy-it.net Pascalstr.
Now enter E and the following window appears: Now press D to set a baud rate of 38400.Then confirm twice with Enter to enter the configuration menu. Then press Save as dfl and this window appears as confirmation. You can now exit the configuration menu with ESC and then press CTRL + A. Now you see in the lower part of the console the following: If everything looks like the picture above, Minicom is configured correctly.
12.
Switch off the Raspberry Pi with the StromPi: poweroff Commands only for the CLI firmware version Set the Shutdown Timer in seconds: set-timer Enable <1> or disable <0> the Raspberry Pis Shutdown: shutdown-enable
Activate <1> or deactivate <0> the Serialless Mode: serialless-mode Set the battery voltage when the Raspberry Pi should be switched off: (<0>: deactivated, <1>: < 10 %, <2>: < 25 %, <3>: < 50 %) batlevel-shutdown Enable <1> or disable <0> the PowerOff Interval-Alarm: interval-enable Set the On time of the Interval-Alarm: interval-ontime Set the Off time of the Interval-Alarm: interval-offtime Enable <1> or disable <0> the PowerOn-Button: poweronbutton-enable
14. FURTHER INFORMATION PR Our information and redemption obligation according to the electro-law (ElektroG) Symbol on electrial and electronic products : This crossed-out bin means that electrical and electronic products do not belong into the household waste. You must hand over your old appliance to a registration office. Before you can hand over the old appliance, you must remove used batteries and accumulators which are not enclosed by the device.