🛠 Première configuration du module LoRa
Objectives
Get the LoRa radio of the MKR WAN 1310 up and running: the Murata CMWX1ZZABZ module embeds a second processor (STM32L0 + Semtech SX1276 transceiver) that communicates via AT commands over SPI. We update its firmware, then check the version, band, and radio serial number (deviceEUI). Note: this board has no Wi-Fi or Bluetooth; connectivity is LoRa/LoRaWAN only.
Hardware
- 1 MKR WAN 1310 board with its penta-band antenna screwed onto the micro-UFL connector (never transmit without an antenna)
- Micro-USB cable
- MKRWAN library (v1.1.2) and ArduinoCore-samd core installed
Complete code
// Mise en route du module : version, bande, deviceEUI — MKR WAN 1310
#include <MKRWAN.h>
LoRaModem modem; // module embarqué (SPI + broches de contrôle)
void setup {
Serial.begin(115200);
while (!Serial);
// Étape 1 : lancer l'exemple MKRWAN > MKRWANFWUpdate_standalone UNE fois
// pour flasher le firmware AT récent (sinon "Firmware version mismatch").
if (!modem.begin(EU868)) { // bande choisie à l'exécution (AT+BAND)
Serial.println("Demarrage module impossible");
while (1) {}
}
Serial.print("Firmware AT : "); Serial.println(modem.version);
Serial.print("deviceEUI : "); Serial.println(modem.deviceEUI);
// Le deviceEUI sert à enregistrer l'objet sur The Things Network.
}
void loop {}
Expected verification
The console displays a firmware version (1.1.x or 1.2.x) and a 16-digit hexadecimal deviceEUI. These two values should be noted for the following LoRaWAN tutorials.
Common errors
- "Firmware version mismatch": new firmware required, first run MKRWANFWUpdate_standalone or FWUpdaterBridge.
- Forgetting the micro-UFL antenna: transmitting without a load, resulting in zero range and risk to the RF stage.
- Confusing it with the MKR WAN 1300: the 1310 uses the SX1276 (137–1020 MHz, selective 433/868/915 MHz) and changes band at runtime; some Arduino sources still mention the SX1272.
- Wrong band: EU868 in Europe; a misconfigured US915 causes impossible joins.
- Known SPI issues on the 1310 (MKRWAN issue #86): completely power cycle the board if the module stops responding.
Other tutorials for this board
Code examples for this board
join-otaa.inoArduinouplink-confirme.inoArduinodownlink.inoArduinoactivation-abp.inoArduinosuivi-adr.inoArduinoclasse-c.inoArduino