# Flipper Zero Raw RFID Tools
A python library for reading and analyzing Flipper Zero raw RFID files (`tag.[ap]sk.raw`)
* [Installation](#installation)
* [Via pip](#via-pip)
* [From source](#from-source)
* [Usage](#usage)
* [As a library](#as-a-library)
* [From commandline](#from-commandline)
* [Tutorial](#tutorial)
## Installation
### Via pip
```bash
pip install flipper-raw-rfid
```
### From source
```bash
git clone https://github.com/hnesk/flipper-raw-rfid.git
cd flipper-raw-rfid
make install
```
## Usage
### As a library
``` python
from flipper_raw_rfid import RiflFile
import matplotlib.pyplot as plt
rifl = RiflFile.load('test/assets/Red354.ask.raw')
# for the reconstructed binary signal
signal = rifl.signal()
# or for the raw pulse and duration values
pd = rifl.pulse_and_durations()
plt.plot(signal[0:20000])
```
results in:
![Plot of the RFID signal with matplotlib](docs/signal-plot.png)
There is also a short [tutorial notebook](docs/rifl-tutorial-1.ipynb)
### From commandline
``` bash
# Plot a file (requires matplotlib)
$ flipper-raw-rfid plot tests/assets/Red354.ask.raw
# Dump the contents in pad format (see below)
flipper-raw-rfid convert --format=pad tests/assets/Red354.ask.raw Red354.pad.csv
# Dump the contents in signal format
flipper-raw-rfid convert --format=signal tests/assets/Red354.ask.raw Red354.signal.csv
```
#### Commandline help
```bash
flipper-raw-rfid --help
```
```
flipper-raw-rfid
Description:
Reads a raw rfid file from flipper zero and plots or converts the signal
Usage:
flipper-raw-rfid convert [-f <format>] RAW_FILE [OUTPUT_FILE]
flipper-raw-rfid plot RAW_FILE
flipper-raw-rfid (-h | --help)
flipper-raw-rfid --version
Arguments:
RAW_FILE The raw rfid file from flipper (xyz.ask.raw or xyz.psk.raw)
OUTPUT_FILE The converted file as csv (default: stdout)
Options:
-h --help Show this screen.
--version Show version.
-f --format=(pad|signal) Output format: "pad" (=Pulse And Duration) is the internal format of the Flipper Zero,
each line represents a pulse and a duration value measured in samples, see
"Pulse and duration format" below.
In "signal" format the pulses are written out as a reconstructed signal with a "1" marking a
sample with high value and "0" marking a sample with low value [default: pad]
Pulse and duration (pad) format:
column 0: pulse - (number of samples while output high) and
column 1: duration - (number of samples till next signal)
Diagram:
______________ __________
______ __________ .......
^ - pulse0 - ^ ^-pulse1-^ .......
^ - duration0 -^^ - duration1 -^ .......
The csv file has the following format:
pulse0, duration0
pulse1, duration1
....
```
# Tutorial
There is a short [RFID tutorial notebook](docs/rifl-tutorial-1.ipynb) to see if there is data in the recording and what to do with it.
Raw data
{
"_id": null,
"home_page": "https://github.com/hnesk/flipper-raw-rfid",
"name": "flipper-raw-rfid",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "flipper-zero,flipper,RFID",
"author": "Johannes K\u00fcnsebeck",
"author_email": "kuensebeck@googlemail.com",
"download_url": "https://files.pythonhosted.org/packages/1f/73/45eb2e63d098023509f86f8a7cebbf42a4c6c7d2b8d3e40cc291b36779a1/flipper-raw-rfid-0.2.tar.gz",
"platform": null,
"description": "# Flipper Zero Raw RFID Tools\n\nA python library for reading and analyzing Flipper Zero raw RFID files (`tag.[ap]sk.raw`)\n * [Installation](#installation)\n * [Via pip](#via-pip)\n * [From source](#from-source)\n * [Usage](#usage)\n * [As a library](#as-a-library)\n * [From commandline](#from-commandline)\n * [Tutorial](#tutorial)\n \n## Installation\n\n### Via pip\n\n```bash\npip install flipper-raw-rfid\n```\n\n### From source\n```bash\ngit clone https://github.com/hnesk/flipper-raw-rfid.git \ncd flipper-raw-rfid\nmake install\n```\n\n\n## Usage\n\n### As a library\n\n``` python\n\nfrom flipper_raw_rfid import RiflFile\nimport matplotlib.pyplot as plt \n\nrifl = RiflFile.load('test/assets/Red354.ask.raw')\n# for the reconstructed binary signal\nsignal = rifl.signal()\n# or for the raw pulse and duration values\npd = rifl.pulse_and_durations()\n\nplt.plot(signal[0:20000])\n\n```\n\nresults in: \n\n![Plot of the RFID signal with matplotlib](docs/signal-plot.png)\n\n\nThere is also a short [tutorial notebook](docs/rifl-tutorial-1.ipynb)\n\n### From commandline\n\n``` bash\n# Plot a file (requires matplotlib)\n$ flipper-raw-rfid plot tests/assets/Red354.ask.raw\n# Dump the contents in pad format (see below) \nflipper-raw-rfid convert --format=pad tests/assets/Red354.ask.raw Red354.pad.csv\n# Dump the contents in signal format\nflipper-raw-rfid convert --format=signal tests/assets/Red354.ask.raw Red354.signal.csv\n```\n\n#### Commandline help\n```bash\nflipper-raw-rfid --help\n```\n```\nflipper-raw-rfid \n\nDescription:\n Reads a raw rfid file from flipper zero and plots or converts the signal\n\nUsage:\n flipper-raw-rfid convert [-f <format>] RAW_FILE [OUTPUT_FILE]\n flipper-raw-rfid plot RAW_FILE\n flipper-raw-rfid (-h | --help)\n flipper-raw-rfid --version\n\nArguments:\n RAW_FILE The raw rfid file from flipper (xyz.ask.raw or xyz.psk.raw)\n OUTPUT_FILE The converted file as csv (default: stdout)\n\nOptions:\n -h --help Show this screen.\n --version Show version.\n -f --format=(pad|signal) Output format: \"pad\" (=Pulse And Duration) is the internal format of the Flipper Zero,\n each line represents a pulse and a duration value measured in samples, see\n \"Pulse and duration format\" below.\n In \"signal\" format the pulses are written out as a reconstructed signal with a \"1\" marking a\n sample with high value and \"0\" marking a sample with low value [default: pad]\n\nPulse and duration (pad) format:\n\n column 0: pulse - (number of samples while output high) and\n column 1: duration - (number of samples till next signal)\n\n Diagram:\n\n ______________ __________\n ______ __________ .......\n\n ^ - pulse0 - ^ ^-pulse1-^ .......\n ^ - duration0 -^^ - duration1 -^ .......\n\n The csv file has the following format:\n\n pulse0, duration0\n pulse1, duration1\n ....\n``` \n\n# Tutorial\n\nThere is a short [RFID tutorial notebook](docs/rifl-tutorial-1.ipynb) to see if there is data in the recording and what to do with it.\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "A library for reading and analyzing Flipper Zero raw RFID files",
"version": "0.2",
"project_urls": {
"Homepage": "https://github.com/hnesk/flipper-raw-rfid"
},
"split_keywords": [
"flipper-zero",
"flipper",
"rfid"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7717f3d6b12f0f4b534d7b7c8c8faada501ec31c95ced5100b3ef7c7d2782230",
"md5": "fb7e560fceacb60896a214942f4e2a0b",
"sha256": "88ad2e9b1ab3e4789466be50ba7074a90a6919aba4e8bd6f0c9e115cba597d31"
},
"downloads": -1,
"filename": "flipper_raw_rfid-0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fb7e560fceacb60896a214942f4e2a0b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 13637,
"upload_time": "2023-10-25T13:21:40",
"upload_time_iso_8601": "2023-10-25T13:21:40.256533Z",
"url": "https://files.pythonhosted.org/packages/77/17/f3d6b12f0f4b534d7b7c8c8faada501ec31c95ced5100b3ef7c7d2782230/flipper_raw_rfid-0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1f7345eb2e63d098023509f86f8a7cebbf42a4c6c7d2b8d3e40cc291b36779a1",
"md5": "4becb6988c3b930cb4f0507c96e08bfc",
"sha256": "e174e76eb51558dd60d6b073dda26e13a8eaa1090f80c077f9dca78266564375"
},
"downloads": -1,
"filename": "flipper-raw-rfid-0.2.tar.gz",
"has_sig": false,
"md5_digest": "4becb6988c3b930cb4f0507c96e08bfc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 14576,
"upload_time": "2023-10-25T13:21:41",
"upload_time_iso_8601": "2023-10-25T13:21:41.708344Z",
"url": "https://files.pythonhosted.org/packages/1f/73/45eb2e63d098023509f86f8a7cebbf42a4c6c7d2b8d3e40cc291b36779a1/flipper-raw-rfid-0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-25 13:21:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hnesk",
"github_project": "flipper-raw-rfid",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "flipper-raw-rfid"
}