-
-
Notifications
You must be signed in to change notification settings - Fork 129
PiSugar support
If you have a PiSugar-board, you can add significantly increase the battery time and make Inkycal run without a cable attached to a USB-port. For this, you will need a PiSugar board. We recommend the PiSugar3, but all models work just as fine.
Please note that Inkycal is not associated or affiliated with PiSugar in any way and that the support for PiSugar with Inkycal is in beta. It should work for the most part, but these instructions need to be carefully read before continuing. These instructions apply for all versions of PiSugar.
If you haven't already run the PiSugar installer, please run it without sudo:
wget https://cdn.pisugar.com/release/pisugar-power-manager.sh
bash pisugar-power-manager.sh -c release
sudo systemctl enable pisugar-server
This will install the web-ui for PiSugar, not to be confused with the web-ui of Inkycal. You can check if the PiSugar server is running and if the PiSugar board was detected correctly by opening the IP-address of your Raspberry Pi at port 8421, e.g. http://192.168.1.2:8421
Before unlocking the full potential of Inkycal, we first need to make sure that Inkycal is running fine:
cd ~/Inkycal
source venv/bin/activate
python inky_run.py
If you some something on your display, please continue. If not, please ask for help on our Discord server or via Github issues.
If the test was successful, we can now ask Inkycal to try to communicate with the PiSugar board. For this, modify line 19 of inky_run.py:
# change this
inky = Inkycal(render=True)
# to
inky = Inkycal(render=True, use_pi_sugar=True, shutdown_after_run=False)
Save the file with [CTRL]
+ [X]
to open the save menu. Then press [Y]
to confirm. We can check if Inkycal can now interface with the PiSugar board like this:
cd ~/Inkycal
source venv/bin/activate
python inky_run.py
This time, you should see some more info about the PiSugar board, e.g. the current battery status and the current time. Inkycal will automatically set the time of the PiSugar board on each run. If this test was also successful, we can move on to the last step, which will significantly increase the battery life.
Modify inky_run.py
again:
# change this
inky = Inkycal(render=True, use_pi_sugar=True, shutdown_after_run=False)
# to
inky = Inkycal(render=True, use_pi_sugar=True, shutdown_after_run=True)
Save the file with [CTRL]
+ [X]
to open the save menu. Then press [Y]
to confirm. With this change, Inkycal will automatically shut down the system after rendering on the display and will set a wakeup-timer on the PiSugar board to wake up the Raspberry Pi at the correct time. To run Inkycal in low-power mode, which will shut down the system after rendering on the display, run the following again:
cd ~/Inkycal
source venv/bin/activate
python inky_run.py
- Please note that the Raspberry Pi Zero W is the most suitable candidate for a battery-operation as it only draws 200mA at 5V in idle state
- It takes about 3.5 minutes until the Zero W has fully booted up and has finished rendering the image
- Auto-shutdown mode requires using sudo commands without a password. This is the default behaviour on Raspberry Pi OS, but again, not the best in terms of security. Ensure you take necessary steps to ensure this security
- The PiSugar board is able to set one timer only. To allow more than one update a day, Inkycal will set the timer each time the system was restarted
- The timer of the PiSugar board is exactly the same as the one set by the web-ui. For the PiSugar support, we recommend an update-interval of once to thrice daily
- Calibration will not be performed in PiSugar mode. This is why it's in beta
- The PiSugar will draw around 80µA of current when idling around and the Zero W has been fully shutdown, after which the PiSugar board will cut off the power from the Zero, while remaining in low-power-mode
-
Assuming battery capacity of 1200mAh and losses of 20%, it gives a grand total of 960mA of usable capacity.
-
230mA for 3.5 minutes (one update) means 230mA / 60 = 3.83mA/min. As the Zero is only up for 3.5mins, the mA drawn from the battery can be calculated by: 3.83mA/min*3.5min = ~13.5 mA
-
Assuming no losses in shutdown-mode, in theory, the Zero W can update 960mA / 13.5mA = 71 times before the PiSugar requires recharging
-
71 updates in total means 71/3 = 23 days runtime with 3 updates a day, ignoring calibration. This is not much, but at least, better than nothing
Inkycal Project of aceinnolab Copyright © (2018-2024)