Skip to content

Instantly share code, notes, and snippets.

@jinschoi
jinschoi / histogram_sub.py
Created June 2, 2022 23:23
Plot a histogram of Flipper raw .sub files
import re
import sys
import pandas as pd
import matplotlib.pyplot as plt
filename = sys.argv[1]
segs = []
with open(filename, 'r') as f:
for line in f:
@jinschoi
jinschoi / bitstream-from-sub.py
Created April 17, 2022 18:00
Python script to clean up and recover an OOK bitstream from a Flipper RAW .sub file.
#!/usr/bin/env python
# Find the raw bitstring from a captured Flipper RAW .sub file.
# Must provide the bitlength in ms, and the allowable error which can be tolerated.
import re
import sys
import math
filename = sys.argv[1]
@jinschoi
jinschoi / plot_raw_sub.py
Last active October 6, 2022 01:44
Plot Flipper RAW .sub captures
import plotly.express as px
import pandas as pd
import re
filename = 'Gar.sub'
points = [(0, 0)]
t = 0
with open(filename, 'r') as f:
for line in f:
@jinschoi
jinschoi / nscd.sub
Created March 25, 2022 02:02
de Bruijn .sub file for Flipper Zero for NSCD garage doors
Filetype: Flipper SubGhz RAW File
Version: 1
Frequency: 318000000
Preset: FuriHalSubGhzPresetOok650Async
Protocol: RAW
RAW_Data: 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 4000 -500 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 4000 -500 4000 -500 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 4000 -500 500 -4000 4000 -500 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 4000 -500 500 -4000 4000 -500 4000 -500 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 500 -4000 4000 -500 4000
@jinschoi
jinschoi / create_sub.py
Last active May 9, 2024 04:22
Python script to generate Flipper RAW .sub files from OOK bitstreams
#!/usr/bin/env python3
from typing import Iterable, Union, Any
# freq: frequency in Hz
# zerolen: length of space bit in μs
# onelen: length of mark bit in μs
# repeats: number of times to repeat sequence
# pause: time to wait in μs between sequences
# bits: string of ones and zeros to represent sequence