|
IR Bridge Ericsson MC218 ↔ Flipper Zero ↔ LLM |
|||||||||||||||||||||||||||
| Overview · Architecture · Protocol · Hardware · Building · Usage · Limitations · Repository | Radio Bargain | |||||||||||||||||||||||||||
|
A working bridge that allows an Ericsson MC218 — a 1999 palmtop running EPOC Release 5 — to converse with a large language model via its built-in infrared port. The user types a question on the Psion keyboard; the message travels by IR to a Flipper Zero, which relays it over UART to an ESP32; the ESP32 queries an LLM over WiFi; and the response returns along 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 using IrDA for bidirectional communication with modern infrastructure. No additional IR hardware is required: the Psion's built-in IrDA transceiver and the Flipper's TSOP receiver and IR LED are used directly, pointed at one another at a distance of ten to thirty centimetres. | |||||||||||||||||||||||||||
|
Architecture
The signal chain is as follows:
The Psion transmits using a 5-bit pulse-width modulation scheme built on top of IrDA connection attempt bursts. The Flipper decodes these pulses, assembles the message, and forwards it to the ESP32 as a simple newline-terminated ASCII frame. The ESP32 queries the LLM and returns the response over the same UART link. The Flipper then re-encodes the text as pulse-width IR at 36 kHz carrier and transmits it back; the Psion reads this on its IrDA serial port (TTY:B) at 4800 baud. | |||||||||||||||||||||||||||
|
Protocol
Psion → Flipper (5-bit PWM). Each character is encoded as seven IrDA connection attempt bursts. The inter-burst gap encodes the data: a start space of approximately 1955 ms, followed by five data bits (A=0 through Z=25, space=26, MSB first) where a short gap (~1205 ms) represents 0 and a longer gap (~1505 ms) represents 1, and a sixth parity bit (even). End of message is signalled by an extra flash followed by a two-second silence. Why IrDA connect attempts rather than ordinary serial data? The Psion's TSOP-like receiver cannot decode SIR protocol from non-EPOC devices, but it can detect IrDA connection attempt bursts as IR activity. Each call to IrDAConnectToSend&: in OPL produces a detectable flash. This is, in effect, an abuse of the IrDA handshake mechanism as a low-bandwidth data channel.
Flipper-side thresholds: bit 1 ≥ 1350 ms, start ≥ 1730 ms, timeout = 4000 ms. 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 10 ms (for 0) or 26 ms (for 1), and an end mark of 75 ms, with 5 ms spaces between all marks. The Psion's SIR decoder on TTY:B at 4800 baud interprets the resulting byte values: ≥ $E0 = bit 1, ≤ $90 = bit 0. End of message is byte 0x04 (ASCII EOT). Data is sent in chunks of 63 bytes. Maximum response length: 200 characters.
Flipper ↔ ESP32 (UART). 115200 baud, newline-terminated ASCII. The Flipper sends Q:<text>\n for queries and PING\n for heartbeats. The ESP32 replies with R:<text>\n for responses, S:<status>\n for status, and E:<reason>\n for errors. The advanced bridge sketch supports an RPC opcode table via OP:HH:params\n frames. | |||||||||||||||||||||||||||
Hardware
No additional IR hardware is needed. Point the Psion's IrDA window at the Flipper's IR transceiver, ten to thirty centimetres apart. | |||||||||||||||||||||||||||
|
Building
Flipper application.
ESP32 sketch. Edit esp32/simple_bridge/simple_bridge.ino and set WiFi credentials and OpenRouter API key. Then:
Flash: hold BOOT on devboard, press RESET, flash with esptool, power-cycle. Psion OPL programme. Requires the EPOC SDK with OPLTRAN.EXE (runs under Wine on macOS and Linux):
The OPL source uses INCLUDE "SYSTEM.OXH" for IrDA functions. | |||||||||||||||||||||||||||
|
Usage
Flash the IR Bridge FAP to the Flipper and launch it from the Infrared category. Power the ESP32 devboard; it will connect to WiFi and report S:WIFI_OK. On the Psion, run irchat.opo, type a message (A–Z and spaces), and press Enter. The Psion transmits via IR — the Flipper's screen shows a callback counter — then enters listening mode. The Flipper dispatches the query to the ESP32, which queries the LLM; the response arrives back on the Psion's screen. The programme then prompts for the next message.
| |||||||||||||||||||||||||||
|
Known Limitations
The Psion transmit alphabet is restricted to A–Z and space; there are no numerals or punctuation. IrDA connect overhead of approximately 955 ms per burst results in a throughput of roughly 3.5 seconds per character. LLM responses are capped at 200 characters by the IR transmit buffer constraint (MAX_TIMINGS_AMOUNT=1024). The Psion receives only the first burst of a multi-burst response owing to blocking I/O in OPL with no asynchronous timeout. The infrared_send_raw_ext timing is approximate; long transmissions may drift. TTY:B may be busy after IrDA TX; the Psion retries up to fifteen times over seventy-five seconds. | |||||||||||||||||||||||||||
|
Repository
Source code and documentation are at
| |||||||||||||||||||||||||||
| github.com/R2BPW/psion-flipper-bridge | |||||||||||||||||||||||||||