The PiSugar 3 Plugin displays the battery percentage as well as the charging status on your Pwnagotchi's UI.
-This plugin introduces a smoothing mechanism for the battery readings. It calculates a smoothed average based on a sample size of battery readings, resulting in a more stable and accurate battery percentage display.
-The UI has also been simplified, showing only the battery percentage. The voltage as well as the tempature readout have been removed.
-Battery status will automatically change from "BAT" to "CHG", when plugged into a charger.
- Supports PiSugar 3 Only!
- I2C interface Enabled
- PiSugar Power Manager
- Custom plugins enabled and directory configured
Update (9/29/24): This plugin has been extensively tested and confirmed to work with version 1.5.5 by hundreds of users for over a year. Please note that by installing this plugin, you accept responsibility for resolving any issues related to installation or device configuration. I am not tech support. Any requests for assistance with installation, configuration, or device-specific hardware detection will be considered outside the scope of support and will likely be closed without a response
To install the PiSugar3 plugin and configure the PiSugar3 UPS module, follow these steps:
Enable the I2C interface by running the following command:
sudo raspi-config
Select "Interfacing Options," then "I2C," and choose "Yes" to enable the I2C interface.
Detect the I2C bus and devices by running the following commands:
i2cdetect -y 1
i2cdump -y 1 0x32
i2cdump -y 1 0x75
Run the following command to install the PiSugar Power Manager:
curl http://cdn.pisugar.com/release/pisugar-power-manager.sh | sudo bash
If the custom plugins directory doesn't already exist, create it by running the following command:
mkdir /etc/pwnagotchi/custom-plugins
Navigate to the custom plugins directory:
cd /etc/pwnagotchi/custom-plugins
Clone the PiSugar3 plugin repository:
git clone https://github.com/nullm0ose/pwnagotchi-plugin-pisugar3.git
Copy the pisugar3.py
file to the custom plugins directory:
cp /etc/pwnagotchi/custom-plugins/pwnagotchi-plugin-pisugar3/pisugar3.py /etc/pwnagotchi/custom-plugins
Add the following lines config.toml
:
main.plugins.pisugar3.enabled = true
main.plugins.pisugar3.shutdown = 5
Adjust the shutdown
value to the desired battery percentage at which the pwnagotchi should shut down.
Restart your Pwnagotchi for the changes to take effect:
systemctl restart pwnagotchi