Skip to content

gregsqueeb/PSP-Flock

Repository files navigation

Flock Gauge — PSP Client

A Sony PSP homebrew app that displays live sensor data from the Flock automotive gauge over Wi-Fi. Connect your PSP to the gauge's wireless network and see boost, coolant, RPM, EGT, and more on a retro handheld.

What It Does

The Flock gauge broadcasts sensor readings at 10 Hz over an open Wi-Fi access point. This PSP app joins that network, listens for the UDP packets, and renders a four-sensor digital dashboard on the PSP's screen.

Features:

  • Displays up to 4 live sensor readings in a 2x2 grid
  • Color-coded warning states when values exceed thresholds
  • Signal-lost detection when the gauge stops broadcasting
  • One-time Wi-Fi profile selection with auto-connect on future launches
  • Fully offline development mode with mock data sender

Requirements

For Users (Running the App)

  • Sony PSP with custom firmware (any homebrew-capable CFW, e.g. ARK4)
  • Flock gauge with Wi-Fi streaming firmware
  • The WLAN switch on the PSP must be ON

For Developers (Building from Source)

Quick Start — Users

  1. Download EBOOT.PBP from the Releases page.
  2. Copy it to your PSP memory stick at PSP/GAME/FlockGauge/EBOOT.PBP.
  3. On your PSP, go to Settings > Network Settings and save a connection to the Flock-Data open network.
  4. Launch Flock Gauge from the XMB game menu.
  5. On first launch, press X and select the Flock-Data profile.
  6. The dashboard appears once the gauge is broadcasting.

Quick Start — Developers

# 1. Install PSP SDK dependencies
brew install cmake pkgconf gnu-sed bash openssl libtool libmpc libarchive \
     gettext texinfo bison flex isl gsl gmp mpfr libusb-compat zlib

# 2. Install PSP SDK (Apple Silicon example)
curl -LO https://github.com/pspdev/pspdev/releases/latest/download/pspdev-macos-latest-arm64.tar.gz
tar xzf pspdev-macos-latest-arm64.tar.gz -C ~/
echo 'export PSPDEV="$HOME/pspdev"' >> ~/.zprofile
echo 'export PATH="$PATH:$PSPDEV/bin"' >> ~/.zprofile
source ~/.zprofile
xattr -rd com.apple.quarantine ~/pspdev

# 3. Verify
psp-config --pspdev-path

# 4. Build
mkdir build && cd build
psp-cmake ..
make

# 5. Test in PPSSPP
open /Applications/PPSSPP.app --args "$(pwd)/EBOOT.PBP"

# 6. Run the mock data sender (in another terminal)
python3 tools/mock_sender.py

Run Host Tests (No PSP SDK Needed)

The core protocol parser and state logic can be tested on any machine with a C compiler:

# Protocol parser tests
cc -I src -I src/vendor -o test_protocol tests/test_protocol.c src/core/protocol.c -lm
./test_protocol

# App state tests
cc -I src -I src/vendor -o test_app_state tests/test_app_state.c src/core/app_state.c src/core/protocol.c -lm
./test_app_state

# Fixture replay
cc -I src -I src/vendor -o replay host/replay_main.c src/core/protocol.c src/core/app_state.c src/core/render_model.c -lm
./replay fixtures/packets/sample_live.ndjson

Project Structure

PSP-Flock/
├── src/
│   ├── core/           # Platform-independent protocol + state logic
│   │   ├── protocol.h/c    # JSON packet parser
│   │   ├── app_state.h/c   # Timestamp ordering, signal loss, warnings
│   │   └── render_model.h/c # Display model builder
│   ├── psp/            # PSP-specific code
│   │   ├── main.c           # App entry point and main loop
│   │   ├── callbacks.c      # PSP system callbacks (Home button)
│   │   ├── net_wifi.c       # Wi-Fi connection and UDP receive
│   │   ├── wifi_onboard.c   # Profile selection and persistence
│   │   └── ui_digital.c     # 2x2 dashboard renderer
│   └── vendor/         # Vendored dependencies
│       └── jsmn.h           # Lightweight JSON parser
├── host/               # Host-side tools
│   └── replay_main.c       # Fixture replay harness
├── tests/              # Unit tests (run on host)
│   ├── test_protocol.c
│   └── test_app_state.c
├── fixtures/packets/   # Canned test data
│   └── sample_live.ndjson
├── tools/              # Development utilities
│   └── mock_sender.py      # 10 Hz UDP gauge simulator
├── docs/               # Documentation
│   └── PROTOCOL.md          # Protocol reference
├── CMakeLists.txt      # PSP build configuration
├── ARCHITECTURE.md     # Module map and contributor guide
├── CONTRIBUTING.md     # How to contribute
└── LICENSE             # MIT License

See ARCHITECTURE.md for a detailed module map and CONTRIBUTING.md for development workflow.

Protocol

The Flock gauge broadcasts JSON over UDP port 9999 at 10 Hz. See docs/PROTOCOL.md for the full specification.

License

MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors