Un exemple de Lora Point to Point et Lorawan Network Application pour les Zephyr RTOS.
Testé avec les cibles suivantes:
Le dossier Lorawan contient un exemple de code pour se connecter au réseau de choses et transmettre la température et les valeurs d'humidité d'un SHTC3 de la sensive.
Lorawan Device EUI, JOIN EUI et la clé d'application doivent être entrés dans le fichier lorawan.h avant la compilation.
Le fichier prj.conf comprend des instructions pour activer votre région (fréquence):
#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
Le capteur I2C SHTC3 peut être connecté aux broches I2C allouées dans le fichier de carte pertinente pour votre cible.
L'exemple stocke le Devnonce dans NVS (stockage non volatile) selon les spécifications de Lorawan 1.0.4.
Le STM32WL5E a un IEEE 64 bits EUI stocké à 0x1fff7580. Nous pouvons lire ceci et l'utiliser comme l'appareil EUI. Actuellement, le dispositif Lorawan EUI est codé dur.
*** 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
Le dossier LORA contient un exemple de code pour permettre le test des radios LORA (communications point à point). Ceci est utile pour valider votre radio LORA fonctionne correctement avant d'essayer de se connecter aux réseaux Lorawan.
Au début, l'application écoutera les paquets sur la fréquence / canal sélectionné. Lorsque SW1 est pressé, transmettra un paquet («bonjour») dans ASCII.
Veuillez vérifier la configuration de fréquence / canal avant l'utilisation et de vous assurer que vous transmettez sur une bande autorisée pour votre pays.
*** 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