-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Com things add pandwarf support #132
Open
atlas0fd00m
wants to merge
32
commits into
master
Choose a base branch
from
ComThings-add_pandwarf_support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
e657721
Docker: Add configs and script to access the rfcat device using docker
CharlieBailly 8d90b21
Docker: Now unpluging and replugging usb does not break access to the…
CharlieBailly ad43e4f
RfCat: Implement a first version of PandwaRF and PandwaRF Rogue
CharlieBailly 31e2234
RfCat: Add PandwaRF example scripts
CharlieBailly fb11769
RfCat: Fix specan
CharlieBailly b76c600
USB Device List: Add the PandwaRF and PandwaRF Rogue product ids and …
CharlieBailly b069590
USB non-root: Add PandwaRF vendor/device id to udev rules
CharlieBailly a4badec
RfCat: Update bruteforce method and example script
CharlieBailly 43eea21
RfCat: Add bruteforce legacy with example script
CharlieBailly 7d2a37b
Doc: Update Readme on how to install and use rfcat (with/without docker)
CharlieBailly f938577
RfCat: Minor fixes
CharlieBailly cc2550d
Docker: Make it work on windows
CharlieBailly 4e3274a
RfCat: Add example script to interact with Kaiju and PandwaRF
CharlieBailly f46e2f6
RfCat: Add another example script to generate and send rolling code
CharlieBailly a7e9891
Docker: Move dependencies to requirements.txt
CharlieBailly 7da9857
Move example scripts
CharlieBailly a9338c0
RfCat: Update init message
CharlieBailly 9eae4bc
Update scripts to execute in Python 3 by default (#122)
argilo d7e1550
Work around a suspected SDCC bug (#123)
argilo dcc348a
Fixes bug caused by future import statement not being at the top (#124)
jimilinuxguy 581ce04
description_file
atlas0fd00m f9632c3
working on bits.py
atlas0fd00m 9e70c36
lots of bits.py improvements and unittests
atlas0fd00m 4f0bba5
Fix Python 3 issues in rfcat_bootloader (#125)
argilo db60441
fix a few Python3 migration oversights in bootloader and intelhex
atlas0fd00m a03781f
touch up installer to allow for automated install of Pyside2 by choos…
atlas0fd00m 6a472e1
rfcat_bootloader Py3 lingering bug
atlas0fd00m 246aaa4
touch version upgrade
atlas0fd00m 93484f3
Merge branch 'master' into ComThings-add_pandwarf_support
atlas0fd00m 31fa5f2
Update rfcat
atlas0fd00m e5b7341
Update rfcat
atlas0fd00m 8303352
Update README.md
atlas0fd00m File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM python:3.9.10 | ||
|
||
WORKDIR /pandwarf/rfcat | ||
COPY . . | ||
RUN apt update && apt install -y usbutils ffmpeg && pip install -r requirements.txt | ||
RUN python setup.py install | ||
|
||
CMD [ "bash" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: "3.3" | ||
|
||
services: | ||
rfcat_image: | ||
build: . | ||
volumes: | ||
- /dev/bus/usb:/dev/bus/usb | ||
privileged: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import json | ||
from rflib.chipcon_gollum import * | ||
import time, requests | ||
|
||
if __name__ == "__main__": | ||
d = PandwaRF() | ||
FREQ = 433_920_000 | ||
DATARATE = 10_000 | ||
# Your token can be found on https://rolling.pandwarf.com/profile-user | ||
# It is the 'API token' | ||
KAIJU_API_TOKEN = "YOUR_KAIJU_API_TOKEN_HERE" | ||
|
||
d.setModeIDLE() | ||
d.rxSetup(FREQ, MOD_ASK_OOK, DATARATE) | ||
d.setAmpMode(RF_RX_POWER_AMPLIFIER_ACTION_ON) | ||
d.setModeRX() | ||
print("Please send some data...") | ||
time.sleep(5) | ||
data, _ = d.RFrecv() | ||
print(f"Data received : {data.hex()}") | ||
d.setModeIDLE() | ||
print("Analysing data with Kaiju...") | ||
|
||
base_url = "https://rolling.pandwarf.com/api/v1" | ||
s = requests.Session() | ||
s.headers.update({ | ||
'Authorization': f'Token {KAIJU_API_TOKEN}' | ||
}) | ||
|
||
payload = { | ||
"rawHexStream": data.hex() | ||
} | ||
payload = json.dumps(payload) | ||
response = s.post(f"{base_url}/analyze/detailed", data=payload) | ||
|
||
result = response.json() | ||
if "progress" not in result.keys(): | ||
print(json.dumps(result, indent=2)) | ||
d.setModeIDLE() | ||
exit() | ||
# Now polling server every 1 seconds until processing is finished | ||
progress = result["progress"] | ||
taskId = result["id"] | ||
while progress != 100: | ||
r = s.get(f"{base_url}/task/{taskId}") | ||
result = r.json() | ||
progress = result["progress"] | ||
print(f"Progress: {progress}/100") | ||
time.sleep(1) | ||
|
||
print("Processing done, now retrieving the result :") | ||
r = s.get(f"{base_url}/remote/{taskId}") | ||
result = r.json() | ||
remoteData = result["remoteData"] | ||
print(json.dumps(remoteData, indent=2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import json | ||
from rflib.chipcon_gollum import * | ||
import time, requests | ||
|
||
if __name__ == "__main__": | ||
d = PandwaRF() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same question? |
||
FREQ = 433_920_000 | ||
DATARATE = 2_500 | ||
# Your token can be found on https://rolling.pandwarf.com/profile-user | ||
# It is the 'API token' | ||
KAIJU_API_TOKEN = "YOUR_KAIJU_API_TOKEN_HERE" | ||
REMOTE_INFO = { | ||
"rollingCodeRequest": { | ||
"type": "Gate Opener", | ||
"brand": "MHouse", | ||
"model": "GTX", | ||
"serialNumberHex": "0x041170E", | ||
"syncCounter": 1440, | ||
"button": 1, | ||
"seed": "", | ||
"numCodesRequested": 2 | ||
} | ||
} | ||
# We will generate 2 rolling codes and send them using the PandwaRF | ||
base_url = "https://rolling.pandwarf.com/api/v1" | ||
s = requests.Session() | ||
s.headers.update({ | ||
'Authorization': f'Token {KAIJU_API_TOKEN}' | ||
}) | ||
|
||
payload = json.dumps(REMOTE_INFO) | ||
print("Asking Kaiju for rolling codes") | ||
response = s.post(f"{base_url}/generate/param", data=payload) | ||
result = response.json() | ||
if "progress" not in result.keys(): | ||
print(json.dumps(result, indent=2)) | ||
d.setModeIDLE() | ||
exit() | ||
# Now polling server every 1 seconds until processing is finished | ||
progress = result["progress"] | ||
taskId = result["id"] | ||
while progress != 100: | ||
r = s.get(f"{base_url}/task/{taskId}") | ||
result = r.json() | ||
progress = result["progress"] | ||
print(f"Progress: {progress}/100") | ||
time.sleep(1) | ||
|
||
print("Processing done, now retrieving the rolling codes :") | ||
r = s.get(f"{base_url}/remote/{taskId}") | ||
result = r.json() | ||
rollingCodes = result["remoteData"]["rollingCodes"] | ||
|
||
print("Preparing PandwaRF for TX") | ||
d.setModeIDLE() | ||
d.txSetup(FREQ, MOD_ASK_OOK, DATARATE) | ||
d.setAmpMode(RF_TX_POWER_AMPLIFIER_ACTION_ON) | ||
d.setModeTX() | ||
|
||
for rollingCode in rollingCodes: | ||
syncCounter = rollingCode["syncCounter"] | ||
button = rollingCode["button"] | ||
dataHex = rollingCode["dataHex"] | ||
fullMsgHex = rollingCode["fullMsgHex"] | ||
data = dataHex | ||
if not data: | ||
data = fullMsgHex | ||
|
||
data = bytes.fromhex(data) | ||
print(f"Sending rolling code {syncCounter} of button {button}") | ||
d.RFxmit(data) | ||
time.sleep(2) | ||
|
||
d.setModeIDLE() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import json | ||
from rflib.chipcon_gollum import * | ||
import time, requests | ||
|
||
if __name__ == "__main__": | ||
d = PandwaRF() | ||
FREQ = 433_920_000 | ||
DATARATE = 2_500 | ||
# Your token can be found on https://rolling.pandwarf.com/profile-user | ||
# It is the 'API token' | ||
KAIJU_API_TOKEN = "YOUR_KAIJU_API_TOKEN_HERE" | ||
ROLLING_INFO = { | ||
"numCodesRequested": 2, | ||
"rxTxConfig": { | ||
"rawBitStream": "10101010101010101010101000000000001101001001001001001001101101101001001001101001001101101001101101101001101101101001101001001101101101001001001101101101101001001001101001101101101001101101101101101001101101101101101101001101101101" | ||
} | ||
} | ||
# We will generate 2 rolling codes and send them using the PandwaRF | ||
base_url = "https://rolling.pandwarf.com/api/v1" | ||
s = requests.Session() | ||
s.headers.update({ | ||
'Authorization': f'Token {KAIJU_API_TOKEN}' | ||
}) | ||
|
||
payload = json.dumps(ROLLING_INFO) | ||
print("Asking Kaiju for rolling codes") | ||
response = s.post(f"{base_url}/generate/capture", data=payload) | ||
result = response.json() | ||
if "progress" not in result.keys(): | ||
print(json.dumps(result, indent=2)) | ||
d.setModeIDLE() | ||
exit() | ||
# Now polling server every 1 seconds until processing is finished | ||
progress = result["progress"] | ||
taskId = result["id"] | ||
while progress != 100: | ||
r = s.get(f"{base_url}/task/{taskId}") | ||
result = r.json() | ||
progress = result["progress"] | ||
print(f"Progress: {progress}/100") | ||
time.sleep(1) | ||
|
||
print("Processing done, now retrieving the rolling codes :") | ||
r = s.get(f"{base_url}/remote/{taskId}") | ||
result = r.json() | ||
|
||
rollingCodes = result["remoteData"]["rollingCodes"] | ||
|
||
print("Preparing PandwaRF for TX") | ||
d.setModeIDLE() | ||
d.txSetup(FREQ, MOD_ASK_OOK, DATARATE) | ||
d.setAmpMode(RF_TX_POWER_AMPLIFIER_ACTION_ON) | ||
d.setModeTX() | ||
|
||
for rollingCode in rollingCodes: | ||
syncCounter = rollingCode["syncCounter"] | ||
button = rollingCode["button"] | ||
dataHex = rollingCode["dataHex"] | ||
fullMsgHex = rollingCode["fullMsgHex"] | ||
data = dataHex | ||
if not data: | ||
data = fullMsgHex | ||
|
||
data = bytes.fromhex(data) | ||
print(f"Sending rolling code {syncCounter} of button {button}") | ||
d.RFxmit(data) | ||
time.sleep(2) | ||
|
||
if rollingCodes == []: | ||
print("Unable to generate rolling code") | ||
|
||
d.setModeIDLE() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from rflib.chipcon_gollum import * | ||
|
||
if __name__ == "__main__": | ||
# This bruteforce is only available on PandwaRF Rogue | ||
# See bruteforce legacy for the PandwaRF (non Rogue) | ||
d = PandwaRFRogue() | ||
d.setModeIDLE() | ||
FREQ = 433_920_000 | ||
DATARATE = 24_536 | ||
MOD = MOD_ASK_OOK | ||
codeLength = 12 | ||
startValue = 3190 | ||
stopValue = 3300 | ||
repeat = 6 | ||
delayMs = 30 | ||
|
||
symbolLength = 3 | ||
encSymbolZero = 0xFF0000 | ||
encSymbolOne = 0xFF00FF | ||
encSymbolTwo = 0x000000 | ||
encSymbolThree = 0x000000 | ||
syncWordSize = 40 | ||
syncWord = 0 | ||
tailWordSize = 8 | ||
tailWord = 0xFF00000000000000 | ||
functionSize = 12 | ||
functionMask = 0xFFFFFFFFFFFFFFFFFFFF0000 | ||
functionValue= 0x000000000000000000000001 | ||
|
||
d.doBruteForce(FREQ, MOD, DATARATE, startValue, stopValue, codeLength, repeat, delayMs, symbolLength, encSymbolZero, encSymbolOne, encSymbolTwo, encSymbolThree, syncWordSize, syncWord, tailWordSize, tailWord, functionSize, functionMask, functionValue) | ||
|
||
d.setModeIDLE() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from rflib.chipcon_gollum import * | ||
|
||
if __name__ == "__main__": | ||
# If you have a PandwaRF Rogue, it is better to use the | ||
# other version of bruteforce (non-legacy) | ||
d = PandwaRF() | ||
d.setModeIDLE() | ||
FREQ = 433_890_000 | ||
DATARATE = 5_320 | ||
MOD = MOD_ASK_OOK | ||
codeLength = 8 | ||
startValue = 0 | ||
stopValue = 6560 | ||
repeat = 10 | ||
delayMs = 0x64 | ||
|
||
encSymbolZero = 0x8E | ||
encSymbolOne = 0xEE | ||
encSymbolTwo = 0xE8 | ||
encSymbolThree = 0x00 | ||
syncWordSize = 2 | ||
syncWord = 0x0008 | ||
|
||
functionSize = 8 | ||
functionMask = 0xFFFFFF0000FFFFFF | ||
functionValue= 0x000000EEE8000000 | ||
|
||
d.doBruteForceLegacy(FREQ, MOD, DATARATE, startValue, stopValue, codeLength, repeat, delayMs, encSymbolZero, encSymbolOne, encSymbolTwo, encSymbolThree, syncWordSize, syncWord, functionSize, functionMask, functionValue) | ||
|
||
d.setModeIDLE() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from rflib.chipcon_gollum import * | ||
|
||
if __name__ == "__main__": | ||
d = PandwaRF() | ||
d.setModeIDLE() | ||
FREQ = 433920000 | ||
d.doDataRateDetect(FREQ, MOD_ASK_OOK) | ||
d.setModeIDLE() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this required? or will RfCat() work as well?
one thing i don't want is for RfCat to be arbitrarily fractured.