Terminal UI (TUI)
The FreeMDU Terminal UI (TUI) is a lightweight, command-line desktop application designed for real-time appliance diagnostics. By leveraging the optical diagnostic interface, it retrieves all supported hardware properties, decodes raw protocol bytes, and presents them in a responsive, user-friendly graphical dashboard right in your terminal.
When to Use the TUI
The TUI is the ideal tool for:
- Appliance Repair Technicians: Quickly verify which internal component triggered a system fault without disassembling the machine.
- DIY Troubleshooting: Monitor real-time sensor data (e.g., verifying if the NTC temperature sensor is accurately reading the water temperature).
- Testing Actuators: Manually firing drain pumps, circulation pumps, or inlet valves to ensure they are mechanically sound.
Running the Application
Ensure your physical optical adapter is flashed with the bridge mode firmware, securely attached to the appliance, and plugged into your computer via USB.
Execute the TUI binary, passing the path to the USB serial port as the primary argument:
# On Linux
./freemdu-tui /dev/ttyACM0
# On macOS
./freemdu-tui /dev/tty.usbmodem14101
# On Windows
freemdu-tui.exe COM3
Interface Overview
Upon launch, the TUI automatically negotiates the protocol handshake. Once connected, the interface splits into two primary interactive sections:
1. The Properties Dashboard (Top)
Diagnostic properties are retrieved from the device via a continuous polling loop. They are categorized into distinct visual panels:
- General Information: Displays static data such as total operating hours, firmware versions, ROM codes, and manufacturing dates.
- Fault Information: Highlights both historical (logged) and active error codes. For example, it translates cryptic memory values into readable alerts like "F1: Pressure Sensor Malfunction" or "Detergent Overdose".
- Operating State: Shows the active program cycle, the current washing/drying phase, and targeted parameters like spin speed.
- Input/Output State: Provides live telemetry from the machine's hardware. Analog sensor values (such as NTC water temperature or drum water level) are rendered using dynamic line gauges, allowing you to visually compare the current reading against the machine's target threshold.
2. The Actions Menu (Bottom)
A list of supported manual override actions is displayed at the bottom of the terminal view.
- Actions are mapped directly to your keyboard's function keys (
F1throughF10). - Parameterized Actions: If an action requires input (e.g.,
Set Target Spin Speed), pressing the associated function key will open an interactive prompt. You must type the requested integer value and pressEnterto transmit the command.
To safely disconnect and exit the application, press q or Ctrl+C.
Common Pitfalls & Safety Warnings
WARNING: The Actions menu gives you direct, low-level control over the appliance hardware, bypassing many of the machine's standard safety interlocks. - Never manually activate heating elements if the drum is empty. Doing so will melt the surrounding plastic tub and cause catastrophic damage. - Avoid overriding the door lock while a cycle is active, especially if the drum is full of hot water.
Troubleshooting
Connection Failures or Glitches
If the application fails to connect, drops the connection frequently, or displays erratic data:
- Check Ambient Light: Ensure the adapter is tightly sealed against the appliance. Room lighting easily corrupts the infrared signal.
- Verify Port Permissions: On Linux, ensure your user has
dialoutgroup permissions.
Generating Debug Logs
If you encounter a bug or unsupported device error, you can capture a full trace of the serial protocol transaction. Because the TUI occupies the stdout of your terminal, traditional logging will corrupt the UI layout.
To safely collect logs, set the RUST_LOG environment variable and redirect stderr (2>) to a file:
RUST_LOG='freemdu=trace' ./freemdu-tui /dev/ttyACM0 2> debug_log.txt
You can then open debug_log.txt to inspect the raw hex byte sequences being sent and received.