5. Quick User Guide

To effectively utilize the Pironman U1, we’ll be employing the SunFounder Power Control Core (SPC).

This is a tool for power management and control of hardware devices. Its primary functions are to monitor battery voltage, current, capacity, and percentage, and to manage fan speed and modes. The SPC connects with devices via I2C communication, ensuring stable data transfer. Additionally, it supports real-time clock settings and features configuration and logging capabilities. This tool is ideal for professionals and hobbyists who require precise monitoring and control of hardware power.

1. Download and Install SPC

Note

For lite systems, initially install tools like git, python3, pip3, setuptools, etc.

sudo apt-get update
sudo apt-get install git -y
sudo apt-get install python3 python3-pip python3-setuptools -y
  • Download and install spc. If you encounter any errors during the installation, it’s recommended to rerun sudo python3 install.py.

    cd ~
    git clone https://github.com/sunfounder/spc.git
    cd ~/spc
    sudo python3 install.py
    
  • After installation, a reboot is necessary to activate certain settings.

    sudo reboot
    
  • Instructions for Powering On and Off:

    • Power On: Press the button until the light turns green, indicating the system is powering on. You can then release the button.

    • Shutdown: Press and hold the button for 2 seconds until the light turns purple, then release. When the power button’s light begins to flash purple, the Raspberry Pi will receive a shutdown signal and proceed to shut down. The power button’s light will turn off once the shutdown process is complete.

    • Power Cut: If you haven’t configured software on the Raspberry Pi, or for other reasons, you can opt for a power cut shutdown. Press and hold the button for 5 seconds and turns red, indicating a direct power cut. Be cautious with this method as it may damage data.

2. View Data from SPC Dashboard

Now, you can visit the SPC Dashboard to view various data.

  • Enter <your pi ip>:34001 in your browser to open the SPC Dashboard designed by us.

    _images/dashboard_1.png
  • The Dashboard will include the following:

    • External: Displays the status of the external USB power (Plugged in or Unplugged), its voltage, current, and power.

      _images/dashboard_external.png
    • Fan: Shows the fan status, mode, speed, and the current temperature of the Raspberry Pi.

      • You can manually turn the fan on or off and select different rotation modes for it.

      _images/dashboard_fan.png
    • Battery: Displays the battery’s percentage, charging status, voltage, current, and power.

      • When an external USB power source is plugged in, the battery is in charging mode, showing its voltage, charging current, and power.

      • When the external USB is not plugged in, the current and power are negative, indicating the battery’s output current and power.

      _images/dashboard_battery.png
    • Raspberry Pi Power: Displays the power supply to the Raspberry Pi (External or battery), its voltage, current, and power.

      _images/dashboard_power.png
    • Storage: Displays the storage capacity of a Raspberry Pi, showing various disk partitions with their used and available space.

      _images/dashboard_storage.png
    • Memory: Shows the Raspberry Pi’s RAM usage and percentage.

      _images/dashboard_memory.png
    • Processor: Illustrates the Raspberry Pi’s CPU performance, including the status of its four cores, operating frequencies, and CPU usage percentage.

      _images/dashboard_processor.png
    • Network: Displays the current network connection type, upload, and download speeds.

      _images/dashboard_network.png
  • You can also switch this page to a white mode.

    _images/dashboard_setting.png

3. Modify Configuration from Terminal

You can also view data related to the battery, fan, etc., from the Terminal.

  1. The spc program runs in a python3 virtual environment. Use the following command to enter the virtual environment:

    source /opt/spc/venv/bin/activate
    
  2. Once entered, use the following command to view the available instructions.

    spc -h
    
    usage: spc [-h] [-m] [-a] [-f [speed percentage]] [-F [{auto,quiet,normal,performance}]] [-b] [-e] [-o] [-p] [-c] [-j]
           [-st [battery percentage]]
    
    options:
      -h, --help            show this help message and exit
      -m, --monitor         open a monitor
      -a, --all             print all the data of spc
      -f [speed percentage], --fan [speed percentage]
                            get/set the speed of fan
      -F [{auto,quiet,normal,performance}], --fan-mode [{auto,quiet,normal,performance}]
                            get/set the mode of fan
      -b, --battery         battery voltage, current, percentage
      -e, --external_input  external input
      -o, --raspberry_pi_power
                            raspberry pi voltage, current
      -p, --powered         power source
      -c, --charge          is charging
      -j, --json            output json format
      -st [battery percentage], --shutdown-strategy [battery percentage]
                            get/set battery percentage for Shutdown Strategy
    
    • For most commands, simply use spc -x to print the relevant data. For example, you can use the following command to get the battery voltage, current, and percentage.

      spc -b
      
    • For -f, -F, -st, you can use them without parameters to get the current data. For example, use the command below to get the current fan speed.

      spc -f
      
    • You can also use them with parameters to set values.

      spc -f 40
      
  3. View log files.

    • First, enter the log directory.

      cd /opt/spc/log
      
    • To see what log files are available, use the ls command.

      config.log  ha_api.log  spc.log  system_status.log
      
    • To view the contents of a log file, such as spc.log, use the cat command.

      cat spc.log
      
  4. To view the logs generated by systemctl, press Q to exit the current page.

    sudo systemctl status spc.service
    
    • spc.service includes software shutdown, fan control, dashboard, and MQTT functionality. If the program isn’t running properly, you can try restarting spc.service.

      sudo systemctl restart spc.service