First Impressions of the Arduino MKR WAN 1300Follow article
A first look at the compact LoRaWAN enabled Arduino and running the example sketches.
To quote from the standard description of the Arduino MKR WAN 1300, it “is the ideal solution for makers wanting to design IoT projects with minimal previous experience in networking … ”. So ideal for me to try out.
The MKR WAN 1300 has the same form factor as the other Arduino MKR boards and offers a lot of functionality in a very small package. It uses the Atmel SAMD21 microcontroller and Murata MCWX1ZZABZ LoRa module for connectivity.
The board can be powered by two 1.5V AAA or AA batteries, else an external 5V supply via the micro USB socket, and switches automatically between the two.
To use the LoRa radio it is also necessary to connect an antenna to the U.FL connector. Also, check that the antenna is tuned for the correct frequency band for your region. I.e. one of 433, 868 or 915 MHz for LoRa.
As advised I first removed the black foam that protects the pins of the board as it is conductive and can cause erratic behaviour if the board is connected while it is in place.
I followed the guide for getting started with the MKR WAN 1300 and Arduino IDE, first of all adding the Atmel SAMD Core to the IDE boards, via Boards Manager in the “Tools” menu.
Then it is simply a case of connecting the board to your PC via the micro USB socket and selecting the board from the boards menu
And following which selecting the correct port ...
Now I was ready to upload a sketch!
It is worth noting that I tried this procedure on both Ubuntu and Windows. Drivers need to be installed on the Windows PC, which happens automatically when the board is added to the Arduino IDE, but it did take a little time so some patience was needed.
Connecting to The Things Network
I wanted to connect the board to The Things Network (TTN) as I already have an account and I know I am in range of a LoRaWAN gateway both at work and at home. Again there was a handy guide.
I needed to install the MKRWAN Library, using the Library Manager in the Sketch menu.
Searching for “mkrwan” brought up the library and I installed the latest version.
I could now see the MKRWAN Examples in the Files / Example menu.
The initial thing to do was to run the First Configuration Sketch and then open the Serial Monitor so that I could see the device EUI that I would subsequently need to add the device to an Application in the TTN console.
Armed with the EUI of the board I could now go to TTN console, set up an Application and Register the board as a Device.
If you are new to The Things Network there are good, clear instructions on how to do this here. Once that was done I could go back to the Arduino IDE and try another example.
Testing network uplink
I next opened the LoRa Send and Receive sketch, which consists of two files.
I clicked on the tab for the arduino_secrets.h file of the sketch and entered the App EUI and App Key by copying and pasting them from the Devices Overview page on the application I had created in TTN console. Going back to the main LoRa Send and Receive sketch, I checked the I had the Region for the modem set correctly and then uploaded the sketch and opened the Serial Monitor.
On the TTN console, I could see the board was connected. If I typed anything and pressed enter (or clicked send) I could see both in the Serial Monitor and on the TTN Console that whatever I typed was being converted to hex, sent and received. I now know what the ASCII hex for red-tin is!
To test downlink – sending data from TTN to the Arduino board – I went to the Device Overview page on the TTN Console and scrolled down until I could see the Downlink section. I entered data in hex format (I just copied the red-tin Hex) and clicked the Send button. The data was queued up and in due course sent, following the next uplink from the board to TTN.
LoRaWAN network operation
This downlink data queuing and then sending is by design and as all LoRaWAN Class A end devices must implement. Since this way, the device does not have to leave its radio on and constantly listen for downlink, saving power, while also managing traffic on the LoRaWAN network.
In a similar vein, I noticed I a comment in the sketch which limits uplink frequency.
// NOTE: independently by this setting the modem will // not allow to send more than one message every 2 minutes, // this is enforced by firmware and can not be changed.
And trying to send more frequently does indeed generate an error message.
This is likely so that the device complies with duty cycle limits stipulated by wireless regulatory bodies in an effort to ensure that you don’t have one or a small number of devices “hogging” the spectrum.
The fact that this board will run on batteries and its diminutive size makes it very portable – ideal for IoT applications. The MKR WAN 1300 obviously comes into its own once sensors are connected and there are examples of it being used as a GPS tracker and the possibility of connecting it to temperature and humidity sensors.