Note
Welcome to the SunFounder Raspberry Pi, Arduino & ESP32 Community on Facebook!
Get technical support and troubleshooting help.
Learn and share projects, tips, and tutorials.
Access early product previews and updates.
Enjoy exclusive discounts and giveaways.
👉 Join us here: [here]
Control with Commands
In addition to viewing data from the Pironman 5 and controlling various devices through the Dashboard, you can also use commands to control them.
Note
For the Home Assistant system, you can only monitor and control the Pironman 5 through the dashboard by opening the webpage at
http://<ip>:34001.
View the Basic Configurations
The pironman5 module offers basic configurations for Pironman, which you can review with the following command.
sudo pironman5 -c
The standard configurations appear as follows:
{
"system": {
"data_interval": 1,
"database_retention_days": 30,
"temperature_unit": "C",
"enable_history": true,
"oled_enable": true,
"oled_rotation": 0,
"oled_sleep_timeout": 10,
"oled_pages": [
"mix",
"performance",
"ips",
"disk"
],
"rgb_enable": true,
"rgb_color": "#0a1aff",
"rgb_brightness": 100,
"rgb_style": "breathing",
"rgb_speed": 50,
"rgb_led_count": 4,
"rgb_led_count_min": 4,
"gpio_fan_pin": 6,
"gpio_fan_mode": 0,
"debug_level": "INFO"
}
}
Customize these configurations to fit your needs.
Use pironman5 or pironman5 -h for instructions.
usage: pironman5-service [-h] [-v] [-c] [-dl [{debug,info,warning,error,critical}]] [--background [BACKGROUND]] [-rd] [-cp [CONFIG_PATH]] [-rc [RGB_COLOR]] [-rb [RGB_BRIGHTNESS]]
[-rs [{solid,breathing,flow,flow_reverse,rainbow,rainbow_reverse,hue_cycle}]] [-rp [RGB_SPEED]] [-re [RGB_ENABLE]] [-rl [RGB_LED_COUNT]] [-u [{C,F}]] [-gm [GPIO_FAN_MODE]] [-gp [GPIO_FAN_PIN]] [-oe [OLED_ENABLE]]
[-od [OLED_DISK]] [-oi [OLED_NETWORK_INTERFACE]] [-or [{0,180}]]
[{start,restart,stop}]
Pironman 5 command line interface
positional arguments:
{start,restart,stop} Command
options:
-h, --help show this help message and exit
-v, --version Show version
-c, --config Show config
-drd, --database-retention-days [DATABASE_RETENTION_DAYS]
Database retention days
-dl, --debug-level [{DEBUG,INFO,WARNING,ERROR,CRITICAL,debug,info,warning,error,critical}]
Debug level
-rd, --remove-dashboard
Remove dashboard
-cp, --config-path [CONFIG_PATH]
Config path
-eh, --enable-history [ENABLE_HISTORY]
Enable history, True/true/on/On/1 or False/false/off/Off/0
-re, --rgb-enable [RGB_ENABLE]
RGB enable True/False
-rs, --rgb-style [RGB_STYLE]
RGB style: ['solid', 'breathing', 'flow', 'flow_reverse', 'rainbow', 'rainbow_reverse', 'hue_cycle']
-rc, --rgb-color [RGB_COLOR]
RGB color in hex format without # (e.g. 00aabb)
-rb, --rgb-brightness [RGB_BRIGHTNESS]
RGB brightness 0-100
-rp, --rgb-speed [RGB_SPEED]
RGB speed 0-100
-rl, --rgb-led-count [RGB_LED_COUNT]
RGB LED count int
-u, --temperature-unit [{C,F}]
Temperature unit
-gm, --gpio-fan-mode [GPIO_FAN_MODE]
GPIO fan mode, 0: Always On, 1: Performance, 2: Cool, 3: Balanced, 4: Quiet
-gp, --gpio-fan-pin [GPIO_FAN_PIN]
GPIO fan pin
-oe, --oled-enable [OLED_ENABLE]
OLED enable True/true/on/On/1 or False/false/off/Off/0
-or, --oled-rotation [{0,180}]
Set to rotate OLED display, 0, 180
-op, --oled-pages [OLED_PAGES]
OLED pages, split by ',': mix,performance,ips,disk
-os, --oled-sleep-timeout [OLED_SLEEP_TIMEOUT]
OLED sleep timeout in seconds
Subcommands:
{start,stop,launch-browser}
start Start Pironman5
stop Stop Pironman5
launch-browser Launch browser
Note
Each time you modify the status of pironman5.service, you need to restart the service to make the configuration changes take effect.
sudo systemctl restart pironman5.service
Verify the
pironman5program status using thesystemctltool.sudo systemctl status pironman5.service
Alternatively, inspect the program-generated log files.
cat /var/log/pironman5/pironman5.log
Control RGB LEDs
The board features 4 WS2812 RGB LEDs, offering customizable control. Users can turn them on or off, change the color, adjust the brightness, switch RGB LED display modes, and set the speed of changes.
Note
Each time you modify the status of pironman5.service, you need to restart the service to make the configuration changes take effect.
sudo systemctl restart pironman5.service
To modify the on and off state of the RGB LEDs, use
trueto turn the RGB LEDs on, orfalseto turn them off.sudo pironman5 -re true
To change the RGB LED color, input the desired hexadecimal color value, such as
fe1a1a.sudo pironman5 -rc fe1a1a
To change the RGB LED brightness (range:
0 ~ 100):sudo pironman5 -rb 100
To switch RGB LED display modes, choose from:
solid/breathing/flow/flow_reverse/rainbow/rainbow_reverse/hue_cycleNote
If the RGB LED display mode is set to
rainbow,rainbow_reverse, orhue_cycle, the color setting usingpironman5 -rcwill not take effect.sudo pironman5 -rs breathing
To modify the RGB LED animation speed (range:
0 ~ 100):sudo pironman5 -rp 80
The default setup includes 4 RGB LEDs. If you connect additional LEDs, update the LED count using:
sudo pironman5 -rl 12
Control GPIO Fans
The IO expansion board supports up to two 5V non-CPU Fans. Both fans are controlled together.
Note
Each time you modify the status of pironman5.service, you need to restart the service to make the configuration changes take effect.
sudo systemctl restart pironman5.service
You can configure the operating mode of the two GPIO Fans using commands. These modes determine the temperature threshold at which the GPIO Fans will activate.
For example, if set to 1: Performance mode, the GPIO Fans will activate at
50°C.sudo pironman5 -gm 3
4: Quiet: The GPIO Fans will activate at
70°C.3: Balanced: The GPIO Fans will activate at
67.5°C.2: Cool: The GPIO Fans will activate at
60°C.1: Performance: The GPIO Fans will activate at
50°C.0: Always On: The GPIO Fans will always stay on.
If you connect the control pin of the RGB fan to a different GPIO pin on the Raspberry Pi, you can change the pin number using:
sudo pironman5 -gp 18
About CPU Fan
The CPU fan connects to a dedicated 4-pin CPU Fan port on the Raspberry Pi 5.
Its default control strategy is a firmware-managed, multi-level intelligent speed adjustment scheme based on CPU temperature. When you use an official or compatible CPU Fan and connect it correctly, the system will automatically adjust the fan speed according to changes in CPU temperature (starting above 50°C) without requiring manual intervention.
Check the OLED Screen
When the pironman5 library is installed, the OLED screen displays CPU usage, RAM usage, disk usage, CPU temperature, and the Raspberry Pi IP address automatically after each reboot.
If the OLED screen does not display any content, first check whether the OLED FPC cable is connected properly.
Then inspect the program log using the following command:
cat /var/log/pironman5/pironman5.log
You can also check whether the OLED I2C address 0x3C is detected:
i2cdetect -y 1
Checkout the Infrared Receiver
Install the
lircmodule:sudo apt-get install lirc -y
Test the IR receiver using the following command:
mode2 -d /dev/lirc0
After running the command, press a button on the remote control. The corresponding IR code will be printed in the terminal.