Made by RockGod, trying to be fixed by "me" (gpt 4O). This project contains a Python script that helps convert .sub (and possibily .wav, .iq, .bin) files (Flipper SubGhz RAW File) to .c16 files for use with HackRF PortaPack. This project is a fork from broken code and has been fixed and improved. I fixed this using chatgpt, I know nothing. Supports two protocols: RAW and BinRAW.
- A computer with Python installed.
- The NumPy library for Python. (This library helps with math operations.)
If you don't have Python, you can download and install it from python.org.
Open a command prompt or terminal on your computer and type the following:
pip install numpy
This command installs NumPy for Python.
Get Your Files Ready
Make sure you have files in one of the supported formats: .sub, .wav, .iq, or .bin. These are the files you want to convert.
Open the command prompt or terminal on your computer.
Go to the folder where you saved the script. For example, if it's saved in C:\Users\YourName\Documents, type:
cd C:\Users\YourName\Documents
Now, run the script with the following command:
python sdr_converter.py "input_file.sub" -o "output_file" --auto -v
Use the --auto flag to automatically detect and suggest appropriate parameters.
Example:
python sdr_converter.py "input_file.sub" -o "output_file" --auto -v
Sample Rate (-sr): Sets the sample rate to a specific value.
python sdr_converter.py "input_file.sub" -o "output_file" -sr 500000
Intermediate Frequency (-if): Sets the intermediate frequency.
python sdr_converter.py "input_file.sub" -o "output_file" -if 5000
Amplitude (-a): Sets the amplitude percentage.
python sdr_converter.py "input_file.sub" -o "output_file" -a 100
python sdr_converter.py runs the script.
your_signal.sub is the name of the file you want to convert.
-o output_file tells the script to save the new files with the name output_file.
-sr 500000 sets the sample rate to 500,000 samples per second.
-if 5000 sets the intermediate frequency to 5000 Hz.
-a 100 sets the amplitude to 100%.
-v enables verbose mode, which means the script will tell you what it's doing step by step.
--auto enables automatic parameter detection
After you run the command, the script creates two new files:
If the output folder is not specified, the converted files will be saved in the same location as the input files with the default naming convention.
Here's an example of how to run the script:
Single File with Automatic Detection:
python sdr_converter.py "input_file.sub" -o "output_file" --auto -v
Folder of Files with Automatic Detection:
python sdr_converter.py "input_folder" -o "output_folder" --auto -v
Single File with Manual Parameters:
python sdr_converter.py "input_file.sub" -o "output_file" -sr 500000
Ensure that file names with spaces are enclosed in quotes ("input folder").
Sample Rate: This tells how many samples per second are used.
Intermediate Frequency: This helps adjust the signal.
Amplitude: This tells how strong the signal is.
Remove any comments from the top of the .sub files, such as "# generated with ook_to_sub.py", it will not see the protocol. Can handle large .sub files such as CVS Chaos
Welcome to the flipper-sub-to-hackrf-portapack-c16-converter repository. This project aims to convert .sub files to HackRF Portapack .c16 files using a Python script.
The primary script used here is heavily inspired by the JS files found at this repository. Thanks François for the initial work!
The main goal of this project is to convert all .sub files from https://github.com/RocketGod-git/Flipper_Zero and load them into the HackRF repository https://github.com/RocketGod-git/HackRF-Treasure-Chest.
If you have the time and skills to help improve this project, please don't hesitate to contribute. Feel free to PR fixes or additions.
RocketGod