SFP Tool Hardware and Software Reference

SFP Tool Hardware and Software Reference

Overview

SFP Tool is a field device for reading and programming transceiver modules. It combines custom hardware, ESP32-S3 firmware, a React and Tauri user interface, and a small firmware recovery web app.

Hardware Architecture

Main Controller

The hardware is built around an ESP32-S3, chosen for:

Connectors and User I/O

The hardware design includes:

The firmware supports two OLED controller families:

Hardware Revisions

The firmware currently distinguishes two hardware revisions:

Revision 1.1 is the default current revision and includes battery support. Revision 1.0 does not have a battery gauge.

Relevant MCU Pin Mapping

Current firmware configuration defines:

Battery Management

Battery-aware firmware builds use an RT9426 battery gauge and enforce low-voltage protection. The configured battery safeguards include:

If the battery remains below the configured threshold long enough, the tool powers off to protect the cell.

Hardware Bill of Materials

The PCB export in pcb/info contains a machine-generated bill of materials with components such as:

That file should be treated as the source for manufacturing detail. This reference intentionally stays at the architectural level.

Firmware Architecture

Platform

The firmware is implemented with Arduino on top of PlatformIO for the ESP32-S3 target.

Primary firmware areas visible in the source tree include:

Runtime Design Goals

The firmware is designed to execute as much device functionality as possible locally so the tool remains useful without a permanently attached app host.

Safety and Recovery

The main firmware includes several recovery-oriented behaviors:

These mechanisms reduce the chance that a bad build leaves the tool permanently inaccessible.

Persistent Configuration

The firmware stores tool-specific configuration in ESP preferences, including:

Device Communication Interfaces

Bluetooth Low Energy

The app communicates with the tool over a custom BLE service:

The application uses dedicated characteristics for settings, EEPROM access, password workflows, scripting, telemetry, and firmware updates.

USB HID

Desktop service workflows can also use USB HID transport. This avoids BLE throughput limits and is preferred for large transfers such as firmware upload.

App Architecture

Technology Stack

The main app is built with:

Desktop builds use Tauri, while Android builds use the generated mobile wrapper. The feature set is intended to stay aligned across supported platforms.

Main App Pages

The app routes between these major pages:

Important Behaviors

Scripts Subsystem

The scripts feature provides a small domain-specific workflow for deterministic EEPROM programming. Supported command families include:

The UI validates syntax before execution and requires write to be present.

Password Workflows

The app and firmware support:

Password change currently requires both old and new passwords as exactly 4-byte values expressed as 8 hexadecimal characters.

Firmware Update Paths

There are two main update paths:

The app detects whether an image is app-only or a merged ESP image and skips the bootloader region when needed.

Firmware Recovery Web App

The software/Firmwareupdater project is a small web frontend based on esp-web-tools. It publishes a browser-based installer that can flash the firmware from a manifest hosted alongside release artifacts.

External Transceiver Library

The repository includes external/TransceiverTool, a C++ parser and assembler for transceiver standards data. It contains support code for:

The app builds a WebAssembly variant so parsing and pretty-printing logic can be reused in the frontend.

CI and Release Pipeline

The CI pipeline currently covers:

Documentation is generated from Markdown during CI and exported as both HTML and PDF.

Source Tree Guide

Important repository locations:

Maintenance Notes