Derived PHY connectors
Some additional connectors are available as they rely on existing modulations, allowing easy configuration and usage.
LoRa connector
A whad.phy.connector.lora.LoRa
connector is available and acts as a
wrapper for the underlying LoRa modulation. This connector will automatically
enables this modulation but also provides methods to configure a LoRa receiver
or transmitter, as well as sniffing packets.
For instance, to configure a LoRa interface for sniffing:
from whad.device import WhadDevice
from whad.phy.connector.lora import LoRa
# Create our device
device = WhadDevice.create("uart0")
# Create our LoRa connector
lora = LoRa(device)
# Configure our LoRa sniffer
lora.sf = 7
lora.cr = 45
lora.bw = 250000
lora.preamble_length = 12
lora.syncword = b"\x12"
lora.enable_crc(True)
lora.enable_explicit_mode(True)
# Start sniffing
lora.start()
This module provides the whad.phy.connector.lora.LoRa
connector that wraps PHY’s
default whad.phy.connector.Phy
connector and make it easier to receive
and send LoRa packets.
- class whad.phy.connector.lora.LoRa(device: WhadDevice = None)[source]
LoRa modulation/demodulation connector.
- property bw
Current bandwidth.
- property cr
Current coding rate.
- property crc_enabled
Current CRC configuration.
- enable_explicit_mode(enabled: bool)[source]
Enable or disable explicit mode (variable packet length).
- property explicit_mode
Current packet type (check if Explicit mode is set)
- property invert_iq
Current IQ inversion setting
- property preamble_length
Current preamble size (in symbols).
- property sf
Current spreading factor.
- property syncword
Current configured synchronization word.