Skip to content

feat: add IR, NFC, RFID, and SubGHz capability modules#8

Open
adrbn wants to merge 2 commits into
busse:mainfrom
adrbn:feat/ir-nfc-rfid-subghz-modules
Open

feat: add IR, NFC, RFID, and SubGHz capability modules#8
adrbn wants to merge 2 commits into
busse:mainfrom
adrbn:feat/ir-nfc-rfid-subghz-modules

Conversation

@adrbn

@adrbn adrbn commented Apr 15, 2026

Copy link
Copy Markdown

Summary

Adds four new capability modules that expose the Flipper Zero's radio and contactless subsystems as MCP tools, plus a CLI bridge that lets modules fall back to the Flipper CLI where the protobuf RPC doesn't have coverage.

  • core/cli_bridge.py — toggles between CLI and protobuf RPC over the existing transport so modules can safely issue text-mode CLI commands.
  • modules/subghz — list/read/delete .sub files, raw & file-based TX, RX (incl. raw), frequency analyzer, decode_raw, chat, launch_app.
  • modules/nfc — list/read/parse/write/delete .nfc files, reader detection, launch_app / launch_file.
  • modules/rfid — read/write/emulate 125 kHz tags, raw read/analyze/emulate for T5577-class workflows, file management, launch_app.
  • modules/ir — list/read/decode/delete .ir files, TX (saved + raw), RX capture, universal remotes (TV/AC/audio/projector/etc.), launch_app.
  • core/flipper_client.py — wires CLIBridge into FlipperClient.connect() once the protobuf RPC is ready.

Total: 1 modified file, 9 new files, ~1,748 lines added.

Test plan

  • Connect a Flipper Zero over USB and confirm FlipperClient.connect() initializes CLIBridge without errors
  • subghz: list /ext/subghz, read a saved .sub, TX from file with confirm=true, run rx/rx_raw briefly, launch frequency analyzer
  • nfc: list /ext/nfc, parse a saved .nfc, run reader detection
  • rfid: read a 125 kHz tag, emulate a saved .rfid, run raw read/analyze
  • ir: list /ext/infrared, TX a saved .ir signal, RX capture briefly, send a universal remote command
  • Verify CLI bridge cleanly toggles back to protobuf RPC after each CLI command
  • Confirm transport auto-switching between USB and WiFi still works after the FlipperClient changes

adrbn added 2 commits April 15, 2026 13:35
Adds four new capability modules exposing the Flipper Zero's radio and
contactless subsystems as MCP tools, plus a CLI bridge that lets modules
fall back to the Flipper CLI when protobuf RPC lacks coverage.

- core/cli_bridge.py: toggles between CLI and protobuf RPC over the
  existing transport so modules can issue text-mode CLI commands safely
- modules/subghz: list/read/delete .sub files, raw & file-based TX,
  RX (incl. raw), frequency analyzer, decode_raw, chat, launch_app
- modules/nfc: list/read/parse/write/delete .nfc files, reader
  detection, launch_app / launch_file
- modules/rfid: read/write/emulate 125kHz tags, raw read/analyze/
  emulate for T5577-class workflows, file management, launch_app
- modules/ir: list/read/decode/delete .ir files, TX (saved + raw),
  RX capture, universal remotes (TV/AC/audio/projector/etc.), launch_app
- core/flipper_client.py: wire CLIBridge into FlipperClient.connect()
  once the protobuf RPC is ready
`FlipperStorage.read()` went straight to `rpc.storage_read()`, which on
this firmware returns empty for many .sub and .ir files (the protobuf
path only captures the first chunk's data). That made both
`subghz_read_file` and `ir_read_file` unusable — reported as
"(empty or failed)" even for valid saved files.

When protobuf returns empty, fall back to the Flipper CLI's
`storage read "<path>"` via the CLIBridge added in the previous commit,
and strip the `Size: N` header the CLI prepends.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant