Arduino MKR WAN 1300/1310
Last updated
Last updated
Arduino MKR WAN 1300/1310 is the fastest start with LoRa and the Internet of Things. It’s the perfect introduction to IoT for your organization, and is also used in education. Arduino MKR WAN 1300/1310 uses its LoRa connectivity to connect to the internet from anywhere in the world where there is LoRa coverage.
When ordering the Arduino MKR WAN 1300/1310 make sure that an antenna is included in the order since it's not delivered with the board
To connect the Arduino MKR WAN 13X0 to the computer you must use a USB cable.
Download the Arduino IDE and follow the installer. We'll use it later on to program the Arduino MKR WAN 13X0.
Connect your Arduino MKR WAN 13X0 to your computer.
From the Tools menu, under Board, under Arduino SAMD boards (32-bits ARM Cortex M0+), select Arduino MKR WAN 1300 or 1310.
If the board is not available go to Tool menu, under Board select Board Manager and search for the Arduino SAMD boards (32-bits ARM Cortex M0+). Click install to install the board.
Also from the Tools menu, under Port, make sure the correct COM port is selected. If you have multiple options, select the one stating Arduino MKR WAN 13X0. If nonee of your ports is labelled that way, disconnect your Arduino MKR WAN 13X0, reopen the menu, check which COM port disappeared, reconnect the Arduino MKR WAN 13X0 and choose the previously identified COM port.
We will now test whether the Arduino MKR WAN 13X0 device is working by letting a LED blink.
In the Arduino IDE go to File, under Examples, under 01. Basics, select Blink
From the Sketch menu, click Upload or select the big arrow on the left of the Arduio IDE to send the software to the Arduino MKR WAN 13X0. If all went well it will say Uploading complete in the bottom of the Arduino IDE and the LED on the Arduino MKR WAN 13X0 board will blink!
The LoRa connectivity on your Arduino MKR WAN 13X0 device is managed by the Murata CMWX1ZZABZ module. With the following steps we check whether this module works correctly.
In the Arduino IDE select from the sketch menu, under Include Library select Manage Libraries. Search for MKRWAN and select the 1.1.0 version.
After the library is downloaded go to File, under Examples, under MKRWAN select FirstConfiguration.
Upload the sketch to the Arduio MKR WAN 13X0
Meanwhile, from the Tools menu, open the Serial Monitor. Here we will find the unique Device EUI. Store the value in a text file. You'll need it when adding the device to KPN Things.
If your device has not the latest firmware version you can load the MKRWANFWUpdate_standalone.ino sketch via File, under Examples, MKRWAN to update the device firmware.
Open the KPN Things Portal. Go to the All Devices page and click on Add new Device.
Select the Own LoRa device (preset connectivity) device type
Enter a name for your Arduino MKR WAN 13X0 device
Click Add Device to continue
DevEUI: the value you retrieved from the LoRa module in the step Test your Arduino MKR WAN 13X0 device
AppEUI: you can use the following value: 0059AC00000FFFFF
AppKey: Every device should have its own unique AppKey, since it is the root security key of your device. You can generate a unique AppKey here: https://www.loratools.nl/#/keys
Click Add Network Info to save the network information and then Finish to continue.
Store these three values somewhere, because you will be needing them to program your device later on.
You are now on the Device Detail Page. In the LoRa tab you will see the network status. This can temporarily be Pending creation, but if you refresh the page it should switch to Active. This means your device is correctly registered to the network.
If the network status sticks to Pending creation, you could try to delete the Device and and provision again (Restart at step Add device)
If the Network Status ended up in Failed, something has gone wrong. Most likely the DevEUI is already registered through another application or account. Please make sure you remove the device registration from the other application or account and re-add the device in the Things Portal.
From the Sketch menu in your Arduino IDE click on Include Library, Manage Libraries...
Now, in the Library Manager, search for ThingsML and click Install. When the installation is finished, click on the Library manager icon to close the left window.
From the File menu, click on Examples.
Now find ThingsML, then select Arduino, MKR_WAN_1300, and within that choose Arduino_mkr_wan_1300_example.
A sketch will open. Now update the values for the variables AppEUI
, and AppKey
in the code with the values you entered earlier in the Portal. The DevEUI
is automatically filled in on the background.
Upload the sketch to your Arduino MKR WAN 13X0 and open the Serial Monitor. You will see your module version and if your device is successfully connected and joined the network. At some point you will see the following:
If you see something else instead of connected
, move closer to your window or walk out into the garden to improve reception from the LoRa network. Then disconnect and reconnect the Arduino MKR WAN 13X0 to your computer. You probably need some more coverage to be able to join the network.
After joining, your Arduino MKR WAN 13X0 will send a message every 300 seconds containing a fixed temperature “measurement” in ThingsML format. Read more about ThingsML.
Now your Arduino MKR WAN 13X0 has joined and is sending data, you could visit the LoRa Data tab on your Device Detail Page in the Portal. You should see your Join request and Join accept appear like in the screenshot below and at this point you will see more data as well.
You now successfully connected your Arduino MKR WAN 13X0 device to KPN Things! To further setup your data flow in KPN Things, you can go to the next step: Configure a flow