Skip to content

Commit

Permalink
fix address assignment to pipes in python scanner
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Mar 6, 2024
1 parent e0c5168 commit 795d0fb
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions examples_linux/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
TOTAL_CHANNELS = 126
CACHE_MAX = 5 # the depth of history to calculate peaks

# To detect noise, we'll use the worst addresses possible (a reverse engineering
# tactic). These addresses are designed to confuse the radio into thinking that the
# RF signal's preamble is part of the packet/payload.
noise_address = [
b"\x55\x55",
b"\xaa\xaa",
b"\x0a\xaa",
b"\xa0\xaa",
b"\x00\xaa",
b"\xab\xaa",
]


class ChannelHistory:
def __init__(self) -> None:
Expand Down Expand Up @@ -92,12 +104,8 @@ def init_radio():
radio.setAutoAck(False)
radio.disableCRC()
radio.setAddressWidth(2)
radio.openReadingPipe(0, b"\x55\x55")
radio.openReadingPipe(1, b"\xaa\xaa")
radio.openReadingPipe(1, b"\x0a\xaa")
radio.openReadingPipe(1, b"\xa0\xaa")
radio.openReadingPipe(1, b"\x00\xaa")
radio.openReadingPipe(1, b"\xab\xaa")
for pipe, address in enumerate(noise_address):
radio.openReadingPipe(pipe, address)
radio.startListening()
radio.stopListening()
radio.flush_rx()
Expand Down

0 comments on commit 795d0fb

Please sign in to comment.