SubGhz
File Formats for Flipper's SubGhz Subsystem
.sub
File Format
.sub
File FormatFlipper uses .sub
files to store SubGhz transmissions. These are text files in Flipper File Format. .sub
files can contain either a SubGhz Key with a certain protocol or SubGhz RAW data.
A .sub
files consist of 3 parts:
header: contains file type, version, and frequency
preset information: preset type and, in case of a custom preset, transceiver configuration data
protocol and its data: contains protocol name and its specific data, such as key, bit length, etc., or RAW data
Flipper's SubGhz subsystem uses presets to configure the radio transceiver. Presets are used to configure modulation, bandwidth, filters, etc. There are several presets available in stock firmware, and there is a way to create custom presets. See SubGhz Presets for more details.
Header format
Header is a mandatory part of .sub
file. It contains file type, version, and frequency.
Field | Type | Description |
---|---|---|
| string | Filetype of subghz file format, must be |
| uint | Version of subghz file format, current version is 1 |
| uint | Frequency in Hertz |
Preset information
Preset information is a mandatory part for .sub
files. It contains preset type and, in case of custom preset, transceiver configuration data.
When using one of the standard presets, only Preset
field is required. When using a custom preset, Custom_preset_module
and Custom_preset_data
fields are required.
Field | Description |
---|---|
| Radio preset name (configures modulation, bandwidth, filters, etc.). When using a custom preset, must be |
| Transceiver identifier, |
| Transceiver configuration data |
Built-in presets:
FuriHalSubGhzPresetOok270Async
— On/Off Keying, 270kHz bandwidth, async(IO throw GP0)FuriHalSubGhzPresetOok650Async
— On/Off Keying, 650kHz bandwidth, async(IO throw GP0)FuriHalSubGhzPreset2FSKDev238Async
— 2 Frequency Shift Keying, deviation 2kHz, 270kHz bandwidth, async(IO throw GP0)FuriHalSubGhzPreset2FSKDev476Async
— 2 Frequency Shift Keying, deviation 47kHz, 270kHz bandwidth, async(IO throw GP0)
Transceiver Configuration Data
Transceiver configuration data is a string of bytes, encoded in hex format, separated by spaces. For CC1101 data structure is: XX YY XX YY .. 00 00 ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ
, where:
XX holds register address,
YY contains register value,
00 00: marks register block end,
ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ
: 8 byte PA table (Power amplifier ramp table).
You can find more details in the CC1101 datasheet and furi_hal_subghz
code.
File Data
.sub
file data section contains either key data — protocol name and its specific data, bit length, etc., or RAW data — an array of signal timings, recorded without any protocol-specific processing.
Key Files
.sub
files with key data files contain protocol name and its specific data, such as key value, bit length, etc. Check out the protocol registry for the full list of supported protocol names.
Example of a key data block in Princeton format:
Protocol-specific fields in this example:
Field | Description |
---|---|
| Princeton payload length, in bits |
| Princeton payload data |
| Princeton quantization interval |
This file may contain additional fields, more details on available fields can be found in subghz protocols library.
RAW Files
RAW .sub
files contain raw signal data that is not processed through protocol-specific decoding. These files are useful for testing or sending data not supported by any known protocol.
For RAW files, 2 fields are required:
Protocol
, must beRAW
RAW_Data
, contains an array of timings, specified in microseconds Values must be non-zero, start with a positive number, and interleaved (change sign with each value). Up to 512 values per line. Can be specified multiple times to store multiple lines of data.
Example of RAW data:
Long payload not fitting into internal memory buffer and consisting of short duration timings (< 10us) may not be read fast enough from the SD card. That might cause the signal transmission to stop before reaching the end of the payload. Ensure that your SD Card has good performance before transmitting long or complex RAW payloads.
File examples
Key file, standard preset
Key file, custom preset
RAW file, standard preset
RAW file, custom preset
SubGhz configuration files
SubGhz application provides support for adding extra radio presets and additional keys for decoding transmissions in certain protocols.
SubGhz keeloq_mfcodes_user
file
keeloq_mfcodes_user
fileThis file contains additional manufacturer keys for Keeloq protocol. It is used to decode Keeloq transmissions. This file is loaded at subghz application start and is located at path /ext/subghz/assets/keeloq_mfcodes_user
.
File format
File contains a header and a list of manufacturer keys.
File header format:
Field | Type | Description |
---|---|---|
| string | SubGhz Keystore file format, always |
| uint | File format version, 0 |
| uint | File encryption: for user-provided file, set to 0 (disabled) |
Following the header, file contains a list of user-provided manufacture keys, one key per line. For each key, a name and encryption method must be specified, according to comment in file header. More information can be found in keeloq decoder source code.
Example
SubGhz setting_user
file
setting_user
fileThis file contains additional radio presets and frequencies for SubGhz application. It is used to add new presets and frequencies for existing presets. This file is being loaded on subghz application start and is located at path /ext/subghz/assets/setting_user
.
File format
File contains a header, basic options, and optional lists of presets and frequencies.
Header must contain the following fields:
Filetype
: SubGhz setting file format, must beFlipper SubGhz Setting File
.Version
: file format version, current is1
.
Basic settings
Add_standard_frequencies
: bool, flag indicating whether to load standard frequencies shipped with firmware. If set tofalse
, only frequencies specified in this file will be used.Default_frequency
: uint, default frequency used in SubGhz application.
Adding more frequencies
Frequency
: uint — additional frequency for the subghz application frequency list. Used in Read and Read RAW. You can specify multiple frequencies, one per line.
Adding more hopper frequencies
Hopper_frequency
: uint — additional frequency for subghz application frequency hopping. Used in Frequency Analyzer. You can specify multiple frequencies, one per line.
Repeating the same frequency will cause Flipper to listen to this frequency more often.
Adding a Custom Preset
You can have as many presets as you want. Presets are embedded into .sub
files, so another Flipper can load them directly from that file. Each preset is defined by the following fields:
Field | Description |
---|---|
| string, preset name that will be shown in SubGHz application |
| string, transceiver identifier. Set to |
| transceiver configuration data. See Transceiver Configuration Data for details. |
Example
Last updated