This file is included to prevent pylint failing with the following error: no-name-in-module. note: revisit/remove this file when this pylint error has been resolved.

adafruit_tinylora

CircuitPython LoRaWAN implementation for use with The Things Network.

  • Author(s): adafruit

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_tinylora.adafruit_tinylora.TTN(dev_address: bytearray, net_key: bytearray, app_key: bytearray, country: str = 'US')

TTN Class

property application_key: bytearray

Returns the TTN Application Key.

property country: str

Returns the TTN Frequency Country.

property device_address: bytearray

Returns the TTN Device Address.

property network_key: bytearray

Returns the TTN Network Key.

class adafruit_tinylora.adafruit_tinylora.TinyLoRa(spi: SPI, cs: DigitalInOut, irq: DigitalInOut, rst: DigitalInOut, ttn_config: DigitalInOut, channel: int | None = None)

TinyLoRa Interface

deinit() None

Deinitializes the TinyLoRa object properties and pins.

send_data(data: bytearray, data_length: int, frame_counter: int, timeout: int = 2) None

Function to assemble and send data :param data: data to send :param data_length: length of data to send :param frame_counter: frame counter variable, declared in code.py. :param timeout: TxDone wait time, default is 2.

send_packet(lora_packet: bytearray, packet_length: int, timeout: int) None

Sends a LoRa packet using the RFM Module :param bytearray lora_packet: assembled LoRa packet from send_data :param int packet_length: length of LoRa packet to send :param int timeout: TxDone wait time.

set_channel(channel: int) None

Sets the RFM Channel (if single-channel) :param int channel: Transmit Channel (0 through 7).

set_datarate(datarate: str) None

Sets the RFM Datarate :param datarate: Bandwidth and Frequency Plan

adafruit_tinylora_encryption

Required tinyLoRA Encryption Methods for AES and Message Integrity checks. * Author(s): adafruit

class adafruit_tinylora.adafruit_tinylora_encryption.AES(device_address: bytearray, app_key: bytearray, network_key: bytearray, frame_counter: int)

TinyLoRA AES Implementation Functions in this implementation are from and/or derived from AES-Python (https://github.com/bozhu/AES-Python) and TinyLoRa ()

calculate_mic(lora_packet: bytearray, lora_packet_length: int, mic: bytearray) bytearray

Calculates the validity of data messages, generates message integrity check bytearray.

encrypt(aes_data: bytearray) bytearray

Performs AES Encryption routine with data. :param bytearray data: Data to-be encrypted.

encrypt_payload(data: bytearray) None

Encrypts data payload. :param bytearray data: Data to-be-encrypted.

adafruit_tinylora.adafruit_tinylora_encryption.xtime(col: int) int

xtime impl. for _mix_single_column()

ttn_as

AS920 The Things Network Frequency Plans * Author(s): Brent Rubell

ttn_au

The Things Network Frequency Plans - AU915 * Author(s): Brent Rubell

ttn_cn

The Things Network Frequency Plans - CN470 * Author(s): IAMLIUBO

ttn_eu

The Things Network Frequency Plans - EU863 * Author(s): Brent Rubell

ttn_usa

The Things Network Frequency Plans - US902 * Author(s): Brent Rubell