Skip to content

Convert infrared serial interface commands for Flipper Zero 🐬 🧱🤖


Notifications You must be signed in to change notification settings


Repository files navigation


The Python script can be used to convert infrared serial interface commands (in hexadecimal representation) into a Flipper Zero[1] compatible infrared[2] .ir file.

The script supports sending multiple multibyte messages at once and adds wait times for message replies by default.

Use case: It can be used to convert LEGO MINDSTORMS RCX[3] (the "yellow programmable brick") infrared commands[4] (see LEGO_RCX.json input file).

⚠️ If LEGO MINDSTORMS RCX is a use case for you: the example does not take care of the toggle bit. So sending the IR commands may not always work. You'll need to dive deeper into the internals of the RCX communication protocol. Pull requests are very welcome!


[1] Flipper Zero — Portable Multi-tool Device for Geeks

[2] Flipper Zero Blog — Taking over TVs with Flipper Zero Infrared Port

[3] Disclaimer: LEGO and MINDSTORMS are trademarks and copyrights of the LEGO Group of companies which does not sponsor, authorize or endorse this site.

[4] RCX 2.0 Firmware Command Overview / LASM bytecode specification


A Python 3 environment is required.

The script only imports sys and json and therefore shouldn't require any additional packages.

Converter usage

Run converter and print output on stdout:

$ python LEGO_RCX.json

Run converter and pipe output to IR output file:

$ python LEGO_RCX.json >

Run converter and pipe output to both an IR output file and stdout:

$ python LEGO_RCX.json | tee

For the format of the .json file, inspect LEGO_RCX.json example.

Plot usage

The IR signal plot script additionally requires the Python module matplotlib.

Usage: python3 <IR_file_name> <IR_signal_name>


python ABC_STOP
Trying to open file '' and then to plot signal 'ABC_STOP'
Found signal:
  Raw signal name: ABC_STOP
  Raw signal data: 833 417 417 417 417 ...

IR signal plot