This projects contains a controller class for the RN2483 LoRaWAN Transceiver module. This code origins from the course Embedded Systems at FH Münster – University of Applied Sciences. It was tested using a RP2040 as a controller to send measurement data.
To setup your local development environment install Visual Studio Code and the MicroPico extension. After that connect the Raspberry Pi Pico using a USB cabel and run your code using MicroPico. To enforce a global style please install the development requirements and after that the pre-commit hook using pre-commit install
.
- Download the latest firmware from https://micropython.org/download/RPI_PICO/ and flash the RP2040 via UF2 bootloader
- Follow the steps above to setup a local development environment
- Open the command pallete (
CTRL + SHIFT + P
) - Search for
MicroPico: Configure project
and execute it - Search for
MicroPico: Upload project to Pico
and execute it - Switch to the
main.py
and run it!
To send data create an instance of the RN2483
class using the following snippet replacing the secrets and pins with your configuration. After creating an instance you'll need to initialize the connection using (in most cases) OTAA.
rn2483: RN2483 = RN2483(
uart_id=0,
tx_pin=12,
rx_pin=13,
reset_pin=10,
app_eui="<insert_app_eui_here>",
app_key="<insert_app_key_here>",
debug=True,
wdt=machine.WDT(timeout=8000),
)
rn2483.initialize_ttn_otaa()
rn2483.send("Hello World!")