🛠 Démarrer le module radio et rejoindre un réseau LoRaWAN

Arduino MKR WAN 1300 · intermediaire · Schéma : IMG-mkr-wan-1300-intermediaire-1-mkrwan-scan-module-join.svg — module LoRa Murata et jointe OTAA vers une passerelle LoRaWAN

Objectives

This tutorial replaces the classic "Wi-Fi scan": the board has no Wi-Fi module (no ESP32/NINA). The confirmed hardware equivalent is the Murata CMWX1ZZABZ LoRa radio module, a second CPU (STM32L0) that drives the SX1272 transceiver and communicates via AT commands over SPI. We start the module, read its identifier, and then join a LoRaWAN network using OTAA (The Things Network or a private server).

Hardware

Complete Code

#include <MKRWAN.h>

LoRaModem modem;   // module Murata câblé en SPI interne
String appEui = "0080000000000001";
String appKey = "00112233445566778899AABBCCDDEEFF";

void setup {
  Serial.begin(115200);
  while (!Serial) {}
  if (!modem.begin(EU868)) {   // bande de TA carte
    Serial.println("Module KO - firmware probablement obsolete");
    while (1) {}
  }
  Serial.print("fw="); Serial.println(modem.version);
  Serial.print("DevEUI="); Serial.println(modem.deviceEUI);
  if (!modem.joinOTAA(appEui, appKey)) {
    Serial.println("Join echoue : cles, couverture, gateway ?");
    while (1) {}
  }
  modem.minPollInterval(60);   // le firmware impose >= 1 msg / 2 min
  Serial.println("JOIN OK");
}

void loop { delay(1000); }

Expected Verification

The monitor displays the AT firmware version, the DevEUI (to be registered on TTN), and then "JOIN OK". The server shows the corresponding OTAA join.

Common Errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials