Go daemon essentials for the standard SunFounder Pironman 5.
This rewrite keeps the familiar pironman5 command surface where it matters and runs as a foreground Go daemon under systemd. V1 targets the standard Pironman 5 only: config, fan control, RGB, OLED pages, status sampling, logs, and service files. Dashboard/history, Mini/Max variants, vibration wake, and full installer automation are deferred.
Important
This is the only text in this repository written without AI.
This project is a Go rewrite of the essential service for the SunFounder Pironman 5. The original source code is written in Python: https://github.com/sunfounder/pironman5
To view and downlaod the original rewrite in Go with 1:1 APIs: view the commit l-you/pironman5-go/tree/faeff568730a411a95ee3708839ab3612b9ee1f4 . In the changes after this commit, I added new features, and slightly modified some APIs.
I created and use this project for personal purposes.
You may use https://github.com/l-you/pironman5-go for any purpose, but I do not provide any guarantees regarding its functionality.
If you encounter any bugs or broken behavior, please report them via GitHub Issues: https://github.com/l-you/pironman5-go/issues
I do not promise proper versioning, CI, or verified binary builds. I can only say that:
- I use it myself;
- I use the binary stored in the
distdirectory; - the binary is compiled with the
go buildcommand.
If you are a careful developer, you should not download or run this binary directly. It is safer to treat the commit hash as the version and compile the program from source. That is a much safer practice. Do not trust binaries from the internet.
I personally use it on my Raspberry Pi 5 + Pironman 5 server. I have not tested it on the Pironman 5 Max, so compatibility is unknown.
Why did I make this project? I did not like the Python RAM overhead on my lightweight server. It also consumed a small amount of CPU.
Numbers:
- The original Python-based Pironman 5 service used approximately 70–110 MB of RAM.
- The same service, rewritten in Go, uses a stable ~10 MB of RAM.
The initial version of this repository does not include the dashboard feature. I may add support for it later. I expect it would require about 5 MB of additional RAM, which is not a big deal.
CPU usage dropped from 0.02% to 0.00% for general server stats while running Debian OS + the Pironman service.
go test ./...
go build -o pironman5 ./cmd/pironman5
go build -o pironman5-image ./cmd/pironman5-imageRun this on Debian or Raspberry Pi OS arm64 on the Raspberry Pi 5. Do not keep the old Python Pironman service running at the same time as this daemon, because both services can try to control the same fan, RGB, and OLED devices.
sudo apt update
sudo apt install -y git
git clone https://github.com/l-you/pironman5-go.git
cd pironman5-go
systemctl list-unit-files '*pironman*'
sudo systemctl disable --now pironman5.service || true
sudo cp /etc/pironman5/config.json /etc/pironman5/config.json.bak 2>/dev/null || true
sudo install -m 0755 dist/pironman5-linux-arm64 /usr/local/bin/pironman5
sudo install -m 0755 dist/pironman5-image-linux-arm64 /usr/local/bin/pironman5-image
sudo install -m 0644 systemd/pironman5.service /etc/systemd/system/pironman5.service
sudo mkdir -p /etc/pironman5 /var/log/pironman5
sudo systemctl daemon-reload
sudo systemctl enable --now pironman5.service
sudo systemctl status pironman5.serviceIf the old unit has a different name, replace pironman5.service with the name shown by systemctl list-unit-files '*pironman*'.
To rebuild from source on the Pi instead of using the committed binary, install Go 1.26.1 or newer and run:
go test ./...
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -trimpath -ldflags '-s -w' -o dist/pironman5-linux-arm64 ./cmd/pironman5
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -trimpath -ldflags '-s -w' -o dist/pironman5-image-linux-arm64 ./cmd/pironman5-imagesudo install -m 0755 pironman5 /usr/local/bin/pironman5
sudo install -m 0755 pironman5-image /usr/local/bin/pironman5-image
sudo install -m 0644 systemd/pironman5.service /etc/systemd/system/pironman5.service
sudo mkdir -p /etc/pironman5 /var/log/pironman5
sudo systemctl daemon-reload
sudo systemctl enable --now pironman5.serviceThe default config path is /etc/pironman5/config.json. Use pironman5 -cp /path/to/config.json ... to override it.
Prints the active config file.
pironman5 -cReads or writes a custom config path instead of /etc/pironman5/config.json.
pironman5 -cp /path/to/config.json -cSets RGB to yellow, then restarts the daemon so the running service uses the new color.
sudo pironman5 -rc ffff00
sudo systemctl restart pironman5.serviceSets brightness to 35 percent.
sudo pironman5 -rb 35
sudo systemctl restart pironman5.serviceSets the RGB effect to a steady color.
sudo pironman5 -rs solid
sudo systemctl restart pironman5.serviceSupported styles: solid, breathing, flow, flow_reverse, rainbow, rainbow_reverse, hue_cycle.
Changes animation duration. Fading and hue effects still render at a fixed frame cadence.
sudo pironman5 -rp 75
sudo systemctl restart pironman5.serviceShows the current mode, then turns the GPIO fan on from LOW and above.
pironman5 -gm
sudo pironman5 -gm 1
sudo systemctl restart pironman5.serviceModes:
0 = GPIO fan always on
1 = on from LOW and above
2 = on from MEDIUM and above
3 = on only at HIGH
4 = always off
Sets the GPIO fan control pin to BCM 6.
sudo pironman5 -gp 6
sudo systemctl restart pironman5.serviceTurns OLED pages on.
sudo pironman5 -oe true
sudo systemctl restart pironman5.serviceCycles through performance, ip, disk, and heart screens. Adds image when -oj points to one or more .pbm files.
sudo pironman5 -om auto
sudo systemctl restart pironman5.serviceShows only the heart screen.
sudo pironman5 -om fixed -op heart
sudo systemctl restart pironman5.serviceCreates a 128x64 monochrome PBM for the daemon.
pironman5-image convert /home/pi/oled.jpg /home/pi/oled.pbmThe daemon reads PBM only.
sudo pironman5 -om fixed -op image -oj /home/pi/oled.pbm
sudo systemctl restart pironman5.serviceSwitches between multiple PBM images every 3 seconds.
sudo pironman5 -om fixed -op image -oj /home/pi/1.pbm,/home/pi/2.pbm,/home/pi/3.pbm -ot 3
sudo systemctl restart pironman5.serviceScreens: performance, ip, disk, heart, image.
Rotates the OLED output by 180 degrees.
sudo pironman5 -or 180
sudo systemctl restart pironman5.servicepironman5 start --background is accepted for upstream compatibility, but the Go daemon stays in the foreground so systemd can supervise it with Type=simple.
This project is intended to remain GPL-2.0-compatible because it uses the upstream GPL-2.0 Pironman projects as behavioral references.