|
IR BridgeEricsson MC218 ↔ Flipper Zero ↔ LLM A working bridge that lets an Ericsson MC218 — a 1999 palmtop running EPOC Release 5 — chat with a large language model via infrared. The user types a question on the Psion keyboard; a native OPX encodes and transmits the entire message in a single IR burst (~100 ms for "HELLO"); a Flipper Zero decodes the raw signal and relays it over UART to an ESP32 WiFi devboard, which queries an LLM API; and the response travels back the same path to appear on the palmtop's screen. The MC218 uses a proprietary serial connector that has been out of production for twenty-five years. This project eliminates the need for any cable by re-purposing the Psion's built-in IrDA transceiver hardware for a custom 38 kHz IR protocol. No IrDA software stack is involved on the transmit side; instead, a native OPX drives the SIR modulator at a baud rate chosen so that the resulting pulse train is indistinguishable from a 38 kHz consumer-IR carrier. The ESP32 WiFi devboard plugs directly into the Flipper, making the entire setup cable-free. No additional IR hardware is required: the Psion's IrDA LED and the Flipper's TSOP receiver are used directly, pointed at one another at a distance of ten to thirty centimetres. ArchitectureThe signal chain:
Key insight: 38400 baud bit period (26 µs) ≈ 38 kHz period (26.3 µs) — the TSOP locks on cleanly. The Psion transmits using a native OPX (C++ DLL) that drives the IrDA UART at
38400 baud — a rate whose bit period (26 µs) matches the 38 kHz
carrier expected by the Flipper's TSOP receiver. Each byte ProtocolPsion → Flipper (38 kHz carrier, ternary).
The entire message is transmitted in a single SIR frame at 38400 baud. At this
rate, each bit period is ~26 µs — nearly identical to the
38 kHz period (26.3 µs) that the Flipper's TSOP infrared receiver
is tuned to. A byte of Why 38400 baud? The Flipper's TSOP infrared receiver has a bandpass filter tuned to 38 kHz. Ordinary IrDA at 4800 or 9600 baud produces SIR pulses at the wrong repetition rate; the TSOP detects them unreliably, if at all. At 38400 baud, the pulse repetition rate matches the TSOP's design frequency, so the receiver locks on cleanly — turning the IrDA port into a standard 38 kHz IR transmitter. This is not IrDA communication: the project uses only the IrDA transceiver hardware (LED and SIR pulse shaper), while the protocol above it is entirely custom.
Flipper-side thresholds: digit 1 ≥ 1.5 ms, digit 2 ≥ 2.5 ms, header ≥ 4 ms. One character = three ternary digits = ~5 ms. A five-letter word transmits in roughly 100 ms including SIR frame overhead. Flipper → Psion (pulse-width IR + EOT).
Each ASCII byte is encoded as eight mark/space pairs at 36 kHz carrier. A
start mark of 50 ms, data marks of 8 ms (for 0) or 16 ms (for 1),
and an end mark of 75 ms, with 3 ms spaces between all marks. The
Psion's SIR decoder on TTY:B at 4800 baud interprets the resulting byte values:
≥
Flipper ↔ ESP32 (UART). 115200 baud, 8N1, newline-terminated ASCII over the Flipper GPIO header.
Hardware
No additional IR hardware is needed. The ESP32 devboard plugs directly into the Flipper — no soldering, no cables. Point the Psion's IrDA window at the Flipper's IR transceiver, ten to thirty centimetres apart. BuildingFlipper application. cd flipper/ir_bridge ufbt build # Copy ir_bridge.fap to # Flipper SD: /ext/apps/Infrared/ ESP32 firmware. Set your WiFi credentials and OpenRouter API key
in arduino-cli compile --fqbn esp32:esp32:esp32s2 \ esp32/simple_bridge/simple_bridge.ino arduino-cli upload --fqbn esp32:esp32:esp32s2 \ --port /dev/cu.usbmodem01 \ esp32/simple_bridge/simple_bridge.ino Psion OPX + OPL. The OPX (native C++ DLL) is built with the
EPOC Release 5 C++ SDK under Wine. A pre-built binary is available in
# OPX: built via GCC ARM cross-compiler # (see opx/ for source and build scripts) # Pre-built: release/irflash.opx # OPL: unix2dos psion/chat_a.opl wine path/to/OPLTRAN.EXE "C:\chat_a.opl" # Copy irflash.opx to MC218: # D:\System\Opx\IRFLASH.OPX # Copy chat_a.opo to MC218 # via CF card The OPX auto-loads via UsagePlug the ESP32 WiFi devboard into the Flipper GPIO header. Flash the IR Bridge
FAP to the Flipper and launch it from the Infrared category. On the Psion, run
Known LimitationsThe Psion transmit alphabet is restricted to A–Z and space; there are
no numerals or punctuation. LLM responses are capped at 200 characters by the IR
transmit buffer constraint ( RepositorySource code and documentation at github.com/R2BPW/psion-flipper-bridge. psion/
chat_a.opl OPL chat (OPX TX + TTY:B RX)
irchat_opx.opl legacy chat (original version)
opx/
irflash_sir.cpp OPX source (38400 baud)
irflash.h OPX C++ header
irflash.mmp Symbian build file
IRFLASH.OXH OPL interface header
flipper/ir_bridge/
ir_bridge.c Flipper Zero FAP source
application.fam app manifest
esp32/
simple_bridge/
simple_bridge.ino ESP32 LLM bridge (WiFi, OpenRouter)
llm_bridge/
llm_bridge.ino ESP32 LLM bridge with RPC opcodes
release/
irflash.opx compiled OPX for MC218
ir_bridge.fap compiled Flipper FAP
IRFLASH.OXH OPX header (copy to MC218)
docs/
PROTOCOL.md protocol specification
HARDWARE.md hardware notes
OPL_NOTES.md EPOC OPL compilation
SPEEDUP.org speed optimization notes
|