Un ejemplo de Lora Point to Point y Lorawan Network Aplicación para los RTO Zephyr.
Probado con los siguientes objetivos:
La carpeta Lorawan contiene un código de ejemplo para conectarse a la red de cosas y transmitir valores de temperatura y humedad desde un Sensirion SHTC3.
Lorawan Device EUI, Únase EUI y la clave de aplicación debe ingresarse en el archivo Lorawan.h antes de la compilación.
El archivo PRJ.Conf incluye declaraciones para habilitar su región (frecuencia):
#LORAMAC_REGION_AS923=y
LORAMAC_REGION_AU915=y
#LORAMAC_REGION_CN470=y
#LORAMAC_REGION_CN779=y
#LORAMAC_REGION_EU433=y
#LORAMAC_REGION_EU868=y
#LORAMAC_REGION_KR920=y
#LORAMAC_REGION_IN865=y
#LORAMAC_REGION_US915=y
#LORAMAC_REGION_RU864=y
El sensor I2C SHTC3 se puede conectar a los pines I2C asignados en el archivo de placa relevante para su objetivo.
El ejemplo almacena el devnonce en NVS (almacenamiento no volátil) según las especificaciones de Lorawan 1.0.4.
El STM32WL5E tiene un EUI IEEE de 64 bits almacenado en 0x1FFF7580. Podemos leer esto y usarlo como el dispositivo EUI. Actualmente, el dispositivo Lorawan EUI está codificado.
*** Booting Zephyr OS build zephyr-v3.2.0-3920-g5787c69b9ce5 ***
Zephyr LoRaWAN Node Example
Board: lemon_iot_lora_rak3172
NVS: ID 1, DevNonce: 8
Starting LoRaWAN stack.
Joining network using OTAA, dev nonce 8, attempt 1: Timed-out waiting for response.
Joining network using OTAA, dev nonce 9, attempt 2: Join successful.
Sending Temp 27.77 RH 50.1
Sending Temp 27.47 RH 51.2
La carpeta Lora contiene código de ejemplo para permitir la prueba de las radios Lora (comunicaciones de punto a punto). Esto es útil para validar su radio Lora funciona correctamente antes de intentar conectarse a Lorawan Networks.
Cuando se inicia, la aplicación escuchará los paquetes en la frecuencia/canal seleccionado. Cuando se presiona SW1, transmitirá un paquete ('hola') en ASCII.
Verifique la configuración de frecuencia/canal antes de su uso y asegúrese de transmitir en una banda permitida para su país.
*** Booting Zephyr OS build zephyr-v3.2.0-3920-g5787c69b9ce5 ***
LoRa Point to Point Communications Example
LoRa Device Configured
XMIT 6 bytes: 0x48 0x65 0x6c 0x6c 0x6f 0x00
XMIT 6 bytes: 0x48 0x65 0x6c 0x6c 0x6f 0x00
XMIT 6 bytes: 0x48 0x65 0x6c 0x6c 0x6f 0x00
XMIT 6 bytes: 0x48 0x65 0x6c 0x6c 0x6f 0x00
XMIT 6 bytes: 0x48 0x65 0x6c 0x6c 0x6f 0x00
RECV 6 bytes: 0x48 0x65 0x6c 0x6c 0x6f 0x00 RSSI = -75dBm, SNR = 8dBm
RECV 6 bytes: 0x48 0x65 0x6c 0x6c 0x6f 0x00 RSSI = -75dBm, SNR = 8dBm
RECV 6 bytes: 0x48 0x65 0x6c 0x6c 0x6f 0x00 RSSI = -75dBm, SNR = 9dBm
RECV 6 bytes: 0x48 0x65 0x6c 0x6c 0x6f 0x00 RSSI = -74dBm, SNR = 9dBm
RECV 6 bytes: 0x48 0x65 0x6c 0x6c 0x6f 0x00 RSSI = -74dBm, SNR = 9dBm
RECV 6 bytes: 0x48 0x65 0x6c 0x6c 0x6f 0x00 RSSI = -74dBm, SNR = 8dBm