Skip to content

Improved PiSugar 3 plugin for evilsocket's Pwnagotchi project

Notifications You must be signed in to change notification settings

nullm0ose/pwnagotchi-plugin-pisugar3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Improved PiSugar 3 Plugin For Pwnagotchi

The PiSugar 3 Plugin displays the battery percentage as well as the charging status on your Pwnagotchi's UI.

Improvements

-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.


Screenshot 2023-07-04 at 1 57 00 PM Screenshot 2023-07-04 at 1 55 46 PM

Requirements

  • Supports PiSugar 3 Only!
  • I2C interface Enabled
  • PiSugar Power Manager
  • Custom plugins enabled and directory configured

Additional Notes

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

PiSugar3 Plugin Installation

To install the PiSugar3 plugin and configure the PiSugar3 UPS module, follow these steps:

Enable the I2C interface and configure PiSugar3

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

Install the PiSugar Power Manager

Run the following command to install the PiSugar Power Manager:

curl http://cdn.pisugar.com/release/pisugar-power-manager.sh | sudo bash

Create the custom plugins directory

If the custom plugins directory doesn't already exist, create it by running the following command:

mkdir /etc/pwnagotchi/custom-plugins

Download the plugin

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 plugin file

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 plugin configuration

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

Restart your Pwnagotchi for the changes to take effect:

systemctl restart pwnagotchi

About

Improved PiSugar 3 plugin for evilsocket's Pwnagotchi project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages