Skip to content

Add flippercheck: a validator for .sub / .ir / RTTTL / playlist files#687

Open
munzzyy wants to merge 1 commit into
UberGuidoZ:mainfrom
munzzyy:cole/flippercheck
Open

Add flippercheck: a validator for .sub / .ir / RTTTL / playlist files#687
munzzyy wants to merge 1 commit into
UberGuidoZ:mainfrom
munzzyy:cole/flippercheck

Conversation

@munzzyy

@munzzyy munzzyy commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

This adds flippercheck, a small static checker for the file types this repo is full of - .sub, .ir, RTTTL music, and Sub-GHz playlists. It reads files and reports what would break on a real Flipper. It never transmits and doesn't need a Flipper plugged in. Pure Python 3, standard library only, one script.

Why: files rot quietly here - a key that's the wrong length, a RAW capture with a stray line in the middle, a frequency the CC1101 can't tune, a pause long enough to overflow the transmit timer - and none of it shows up until you try to send. There was an IR-only linter (darmiel/fff-ir-lint) but nothing checked .sub files, and it's been untouched since 2024. This covers all four in one tool.

The rules come from the Flipper firmware source and the CC1101 datasheet, then checked against the real files in this repo. Where the firmware tolerates something the docs forbid, it follows the firmware - e.g. RAW captures that start on a negative value are fine, so they aren't flagged. I ran it across every .sub file in the repo (11k+) to make sure it doesn't cry wolf on good files.

Running it here actually turned up a few genuinely broken files, e.g.:

  • Sub-GHz/Sleep_Files/* encode a multi-hour pause as one RAW value (~-2,000,000,000 us), past the firmware's 30-bit transmit limit, so it truncates to a wrong delay - that matches the old "sleep files don't delay" reports.
  • A couple of LRS pager files set to 467.75 MHz, above the CC1101's top band, so a real Flipper can't tune them.
  • A few files with the spaces stripped out of the key so it no longer parses as bytes.

Usage and the full list of checks are in flippercheck/README.md. Tests: python3 flippercheck/tests/test_flippercheck.py. Happy to adjust placement or anything else.

Static checker for the file types this repo is full of. Reads a file
and reports what would break it on a real Flipper - wrong key length,
a RAW capture with a stray line in the middle, a frequency the CC1101
can't tune, a pause long enough to overflow the transmit timer. Never
transmits, no Flipper needed to run it.

Pure Python 3, stdlib only. Tests included, checked against the good
and bad fixtures plus every .sub file in this repo (11k+, zero false
positives) and the .ir files. It also found a handful of genuinely
broken files here, including the Sub-GHz/Sleep_Files overflow that
matches the old 'sleep files don't delay' reports.
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