add OOK and RFM69 encryption options to examples

This commit is contained in:
jerryneedell 2024-08-04 09:27:23 -04:00
parent 13a393c50c
commit 829d767d24
12 changed files with 128 additions and 10 deletions

View file

@ -41,6 +41,16 @@ rfm = rfm9xfsk.RFM9xFSK(spi, CS, RESET, RADIO_FREQ_MHZ)
# rfm = rfm69.RFM69(spi, CS, RESET, RADIO_FREQ_MHZ)
# For RFM69 only: Optionally set an encryption key (16 byte AES key). MUST match both
# on the transmitter and receiver (or be set to None to disable/the default).
# rfm.encryption_key = None
# rfm.encryption_key = (
# b"\x01\x02\x03\x04\x05\x06\x07\x08\x01\x02\x03\x04\x05\x06\x07\x08"
# )
# for OOK on RFM69 or RFM9xFSK
# rfm.modulation_type = 1
# Disable the RadioHead Header
rfm.radiohead = False
# set the time interval (seconds) for sending packets

View file

@ -41,6 +41,16 @@ rfm = rfm9xfsk.RFM9xFSK(spi, CS, RESET, RADIO_FREQ_MHZ)
# rfm = rfm69.RFM69(spi, CS, RESET, RADIO_FREQ_MHZ)
# For RFM69 only: Optionally set an encryption key (16 byte AES key). MUST match both
# on the transmitter and receiver (or be set to None to disable/the default).
# rfm.encryption_key = None
# rfm.encryption_key = (
# b"\x01\x02\x03\x04\x05\x06\x07\x08\x01\x02\x03\x04\x05\x06\x07\x08"
# )
# for OOK on RFM69 or RFM9xFSK
# rfm.modulation_type = 1
# Disable the RadioHead Header
rfm.radiohead = False
# set the time interval (seconds) for sending packets

View file

@ -38,7 +38,17 @@ rfm = rfm9xfsk.RFM9xFSK(spi, CS, RESET, RADIO_FREQ_MHZ)
# from adafruit_rfm import rfm69
# rfm = rfm9x.RFM69(spi, CS, RESET, RADIO_FREQ_MHZ)
# rfm = rfm69.RFM69(spi, CS, RESET, RADIO_FREQ_MHZ)
# For RFM69 only: Optionally set an encryption key (16 byte AES key). MUST match both
# on the transmitter and receiver (or be set to None to disable/the default).
# rfm.encryption_key = None
# rfm.encryption_key = (
# b"\x01\x02\x03\x04\x05\x06\x07\x08\x01\x02\x03\x04\x05\x06\x07\x08"
# )
# for OOK on RFM69 or RFM9xFSK
# rfm.modulation_type = 1
# Disable the RadioHead Header
rfm.radiohead = False

View file

@ -44,6 +44,15 @@ rfm = rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ)
# rfm = rfm69.RFM69(spi, CS, RESET, RADIO_FREQ_MHZ)
# For RFM69 only: Optionally set an encryption key (16 byte AES key). MUST match both
# on the transmitter and receiver (or be set to None to disable/the default).
# rfm.encryption_key = None
# rfm.encryption_key = (
# b"\x01\x02\x03\x04\x05\x06\x07\x08\x01\x02\x03\x04\x05\x06\x07\x08"
# )
# for OOK on RFM69 or RFM9xFSK
# rfm.modulation_type = 1
# send startup message from my_node
# rfm.send(bytes("startup message from node {}".format(rfm.node), "UTF-8"))

View file

@ -44,6 +44,16 @@ rfm = rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ)
# rfm = rfm69.RFM69(spi, CS, RESET, RADIO_FREQ_MHZ)
# For RFM69 only: Optionally set an encryption key (16 byte AES key). MUST match both
# on the transmitter and receiver (or be set to None to disable/the default).
# rfm.encryption_key = None
# rfm.encryption_key = (
# b"\x01\x02\x03\x04\x05\x06\x07\x08\x01\x02\x03\x04\x05\x06\x07\x08"
# )
# for OOK on RFM69 or RFM9xFSK
# rfm.modulation_type = 1
# send startup message from my_node
# rfm.send(bytes("startup message from node {}".format(rfm.node), "UTF-8"))

View file

@ -40,6 +40,15 @@ rfm = rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ)
# rfm = rfm69.RFM69(spi, CS, RESET, RADIO_FREQ_MHZ)
# For RFM69 only: Optionally set an encryption key (16 byte AES key). MUST match both
# on the transmitter and receiver (or be set to None to disable/the default).
# rfm.encryption_key = None
# rfm.encryption_key = (
# b"\x01\x02\x03\x04\x05\x06\x07\x08\x01\x02\x03\x04\x05\x06\x07\x08"
# )
# for OOK on RFM69 or RFM9xFSK
# rfm.modulation_type = 1
# set node addresses
rfm.node = 1

View file

@ -21,15 +21,15 @@ spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
# Use rfm9x for two RFM9x radios using LoRa
# from adafruit_rfm import rfm9x
from adafruit_rfm import rfm9x
# rfm = rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ)
rfm = rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ)
# Use rfm9xfsk for two RFM9x radios or RFM9x to RFM69 using FSK
from adafruit_rfm import rfm9xfsk
# from adafruit_rfm import rfm9xfsk
rfm = rfm9xfsk.RFM9xFSK(spi, CS, RESET, RADIO_FREQ_MHZ)
# rfm = rfm9xfsk.RFM9xFSK(spi, CS, RESET, RADIO_FREQ_MHZ)
# Use rfm69 for two RFM69 radios using FSK
@ -37,6 +37,16 @@ rfm = rfm9xfsk.RFM9xFSK(spi, CS, RESET, RADIO_FREQ_MHZ)
# rfm = rfm69.RFM69(spi, CS, RESET, RADIO_FREQ_MHZ)
# For RFM69 only: Optionally set an encryption key (16 byte AES key). MUST match both
# on the transmitter and receiver (or be set to None to disable/the default).
# rfm.encryption_key = None
# rfm.encryption_key = (
# b"\x01\x02\x03\x04\x05\x06\x07\x08\x01\x02\x03\x04\x05\x06\x07\x08"
# )
# for OOK on RFM69 or RFM9xFSK
# rfm.modulation_type = 1
# set node addresses
rfm.node = 100
rfm.destination = 0xFF

View file

@ -37,6 +37,16 @@ rfm = rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ)
# rfm = rfm69.RFM69(spi, CS, RESET, RADIO_FREQ_MHZ)
# For RFM69 only: Optionally set an encryption key (16 byte AES key). MUST match both
# on the transmitter and receiver (or be set to None to disable/the default).
# rfm.encryption_key = None
# rfm.encryption_key = (
# b"\x01\x02\x03\x04\x05\x06\x07\x08\x01\x02\x03\x04\x05\x06\x07\x08"
# )
# for OOK on RFM69 or RFM9xFSK
# rfm.modulation_type = 1
# set node addresses
rfm.node = 100
rfm.destination = 0xFF

View file

@ -42,6 +42,16 @@ rfm = rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ)
# rfm = rfm69.RFM69(spi, CS, RESET, RADIO_FREQ_MHZ)
# For RFM69 only: Optionally set an encryption key (16 byte AES key). MUST match both
# on the transmitter and receiver (or be set to None to disable/the default).
# rfm.encryption_key = None
# rfm.encryption_key = (
# b"\x01\x02\x03\x04\x05\x06\x07\x08\x01\x02\x03\x04\x05\x06\x07\x08"
# )
# for OOK on RFM69 or RFM9xFSK
# rfm.modulation_type = 1
# set the time interval (seconds) for sending packets
transmit_interval = 2

View file

@ -26,15 +26,15 @@ spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
# Use rfm9x for two RFM9x radios using LoRa
# from adafruit_rfm import rfm9x
from adafruit_rfm import rfm9x
# rfm = rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ)
rfm = rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ)
# Use rfm9xfsk for two RFM9x radios or RFM9x to RFM69 using FSK
from adafruit_rfm import rfm9xfsk
# from adafruit_rfm import rfm9xfsk
rfm = rfm9xfsk.RFM9xFSK(spi, CS, RESET, RADIO_FREQ_MHZ)
# rfm = rfm9xfsk.RFM9xFSK(spi, CS, RESET, RADIO_FREQ_MHZ)
# Use rfm69 for two RFM69 radios using FSK
@ -42,6 +42,16 @@ rfm = rfm9xfsk.RFM9xFSK(spi, CS, RESET, RADIO_FREQ_MHZ)
# rfm = rfm69.RFM69(spi, CS, RESET, RADIO_FREQ_MHZ)
# For RFM69 only: Optionally set an encryption key (16 byte AES key). MUST match both
# on the transmitter and receiver (or be set to None to disable/the default).
# rfm.encryption_key = None
# rfm.encryption_key = (
# b"\x01\x02\x03\x04\x05\x06\x07\x08\x01\x02\x03\x04\x05\x06\x07\x08"
# )
# for OOK on RFM69 or RFM9xFSK
# rfm.modulation_type = 1
# set the time interval (seconds) for sending packets
transmit_interval = 10

View file

@ -38,7 +38,17 @@ rfm = rfm9xfsk.RFM9xFSK(spi, CS, RESET, RADIO_FREQ_MHZ)
# from adafruit_rfm import rfm69
# rfm = rfm9x.RFM69(spi, CS, RESET, RADIO_FREQ_MHZ)
# rfm = rfm69.RFM69(spi, CS, RESET, RADIO_FREQ_MHZ)
# For RFM69 only: Optionally set an encryption key (16 byte AES key). MUST match both
# on the transmitter and receiver (or be set to None to disable/the default).
# rfm.encryption_key = None
# rfm.encryption_key = (
# b"\x01\x02\x03\x04\x05\x06\x07\x08\x01\x02\x03\x04\x05\x06\x07\x08"
# )
# for OOK on RFM69 or RFM9xFSK
# rfm.modulation_type = 1
# Send a packet. Note you can only send a packet containing up to 60 bytes for an RFM69
# and 252 bytes forn an RFM9x.

View file

@ -42,6 +42,16 @@ rfm = rfm9xfsk.RFM9xFSK(spi, CS, RESET, RADIO_FREQ_MHZ)
# rfm = rfm69.RFM69(spi, CS, RESET, RADIO_FREQ_MHZ)
# For RFM69 only: Optionally set an encryption key (16 byte AES key). MUST match both
# on the transmitter and receiver (or be set to None to disable/the default).
# rfm.encryption_key = None
# rfm.encryption_key = (
# b"\x01\x02\x03\x04\x05\x06\x07\x08\x01\x02\x03\x04\x05\x06\x07\x08"
# )
# for OOK on RFM69 or RFM9xFSK
# rfm.modulation_type = 1
# uncommnet to Disable the RadioHead Header
# rfm.radiohead = False