lora-discovery example

This example application runs out of the box on the STM32 LoRa Discovery Kit (B-L072Z-LRWAN1).

Prerequisites

Software

To build and flash the example, you need to have rustup. In practice you can use whatever tool you want to flash the device, but this guide will assume that probe-run is used (cargo install probe-run).

Configuring

Over The Air Authentication (OTAA) credentials will come from these entries in ~/.drogue/config.toml:

"dev-eui" = "..."
"app-eui" = "..."
"app-key" = "..."

Building

To build the firmware:

cargo build --release

Flashing

Flashing the firmware uses probe-run which auto-detects the probe connected to your device. The following command will build and flash the firmware and open the debugger console so you can see the console debug output.

cargo run --release

If you’re experiencing problems, try setting the VID:PID values to that of your probe (you can find that from lsusb once your board is powered).

cargo run --release -- --probe <VID>:<PID>

Usage

Once the device is flashed, it will connect to the local LoRaWAN network. Once the network is joined, you can press the blue button on the development kit to send a test message ping:<num-clicks>, where num-clicks is the number of times you pressed the button since resetting the board.

LEDs

The board features 4 user controllable LEDs. The program will use 3 of them to show the internal status:

Red

Will light up when starting and turn off once it joined the LoRa network.

Green

Turns on while sending the uplink message.

Blue

Can be controlled through the downlink message: led:on or led:off.