# Arduino MKR WAN 1300

**URL:** <https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050>\
**Category:** End Devices (Nodes)\
**Created:** [January 26, 2018, 10:29am UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050 "2018-01-26T10:29:46Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![gonzalo](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/gonzalo/32/40499_2.png) [@gonzalo](https://www.thethingsnetwork.org/forum/u/gonzalo)\
**Post date:** [January 26, 2018, 10:29am UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050/1 "2018-01-26T10:29:46Z")

</div>

Here’s a bit of info and examples to get started with the Arduino MKR WAN 1300:

# Official reference:

- [https://www.arduino.cc/en/Guide/MKRWAN1300](https://www.arduino.cc/en/Guide/MKRWAN1300)
- [https://www.arduino.cc/en/Guide/Cores](https://www.arduino.cc/en/Guide/Cores)
- [LoRa library documentation](https://www.arduino.cc/en/Reference/MKRWAN)
- [LoRa library source](https://github.com/arduino-libraries/MKRWAN)

# Official tutorials:

- [Send and receive example](https://www.arduino.cc/en/Tutorial/MKRWANLoraSendAndReceive)

# Other tutorials:

- [Getting started](https://github.com/gonzalocasas/arduino-mkr-wan-1300)

---

<div class="post-metadata">

**Author:** ![xoseperez](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/xoseperez/32/44865_2.png) [@xoseperez](https://www.thethingsnetwork.org/forum/u/xoseperez)\
**Post date:** [January 31, 2018, 9:00am UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050/2 "2018-01-31T09:00:26Z")

</div>

I have also been playing with this board and I liked it.

There are still some quirks to the MKRWAN library but the developers at Arduino are actively supporting and updating it.

I have wraped up a post about my experiences using it with PlatformIO, you can read it here:

> **[Arduino MKR WAN 1300 - Tinkerman](http://tinkerman.cat/arduino-mkr-wan-1300/)**
>
> Build and flash an Arduino MKR WAN 1300 with PlatformIO still requires some hacking but it works just great. The Things Network is getting closer...

---

<div class="post-metadata">

**Author:** ![ursm](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/ursm/32/46475_2.png) [@ursm](https://www.thethingsnetwork.org/forum/u/ursm)\
**Post date:** [January 31, 2018, 6:55pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050/3 "2018-01-31T18:55:34Z")

</div>

as Tinkerman mentioned, the example for OTAA works out of the box.  
for ABP you need to upgrade the firmware to _ARD-078 1.1.3_.  
dont be suprised: the FW upload starts immediately after you loaded the upload program ( MKRWANFWUpdate\_standalone )

---

<div class="post-metadata">

**Author:** ![aschroeder](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/aschroeder/32/7857_2.png) [@aschroeder](https://www.thethingsnetwork.org/forum/u/aschroeder)\
**Post date:** [April 20, 2018, 11:01am UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050/4 "2018-04-20T11:01:00Z")

</div>

Just made my first steps with these module using Gonzalos OTAA examples.

The module is always sending packets using SF12 BW125.

Is it possible to set the data rate using the ‘official’ arduino library (MKRWAN.h)?

Seems as if ADR doesnt work ☹

---

<div class="post-metadata">

**Author:** ![gonzalo](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/gonzalo/32/40499_2.png) [@gonzalo](https://www.thethingsnetwork.org/forum/u/gonzalo)\
**Post date:** [April 23, 2018, 1:24am UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050/5 "2018-04-23T01:24:34Z")

</div>

Yep, I think you’re right, there’s no ADR and it’s not possible to change the data rate manually either, at least that’s how it was last time I tried. ☹

---

<div class="post-metadata">

**Author:** ![Amedee](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/amedee/32/39610_2.png) [@Amedee](https://www.thethingsnetwork.org/forum/u/Amedee)\
**Post date:** [April 23, 2018, 5:56am UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050/6 "2018-04-23T05:56:57Z")

</div>

You can change it with AT commands, but unfortunately it is nog part of the official library.  
Easiest is probably to subclass the Arduino library and add it (on my todo list, but i am a bit out of time these days 😉 )

---

<div class="post-metadata">

**Author:** ![aschroeder](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/aschroeder/32/7857_2.png) [@aschroeder](https://www.thethingsnetwork.org/forum/u/aschroeder)\
**Post date:** [April 23, 2018, 11:23am UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050/7 "2018-04-23T11:23:18Z")

</div>

Ok, i did some small extensions to MKWAN.h.Added two public methods:

```
  bool dataRate(uint8_t dr) {
    sendAT(GF("+DR="), dr);
    if (waitResponse() != 1) {
      return false;
    }
    return true;
  }  

  bool setADR(bool adr) {
    sendAT(GF("+ADR="), adr);
    if (waitResponse() != 1) {
      return false;
    }
    return true;
  }

```

Method **dataRate** uses argument _dr_ from 0 (SF12/BW125) to 5 (SF7BW125). Value 6 didn’t work for me.  
setADR returns true but doesn’t work, as @gonzalo wrote ☹

---

<div class="post-metadata">

**Author:** ![cgeorgia](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/cgeorgia/32/20484_2.png) [@cgeorgia](https://www.thethingsnetwork.org/forum/u/cgeorgia)\
**Post date:** [May 27, 2018, 5:50pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050/8 "2018-05-27T17:50:29Z")

</div>

Has anybody tried to power these up using batteries (AA or AAA) ?  
For me it does not seem to work.  
When I power them via usb I can see messages arrive at ttn but with batteries the arduino seems to be dead (@ AA’s measured at 3.2V).  
When I power via usb while haveing the batteries connected and then remove the usb it seems to work

Regards

---

<div class="post-metadata">

**Author:** ![gonzalo](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/gonzalo/32/40499_2.png) [@gonzalo](https://www.thethingsnetwork.org/forum/u/gonzalo)\
**Post date:** [May 27, 2018, 11:21pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050/9 "2018-05-27T23:21:14Z")

</div>

I tried with LiPo and it works perfectly.

---

<div class="post-metadata">

**Author:** ![cgeorgia](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/cgeorgia/32/20484_2.png) [@cgeorgia](https://www.thethingsnetwork.org/forum/u/cgeorgia)\
**Post date:** [May 30, 2018, 9:28pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050/10 "2018-05-30T21:28:45Z")

</div>

ok thanks. I do not have a lipo battery to test. The official arduino doc clearly says that you can use a pair AA or AAA batteries but unless I got a faulty module, this does not seem to be the case

---

<div class="post-metadata">

**Author:** ![alfsolli](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/a/8c91f0/32.png) [@alfsolli](https://www.thethingsnetwork.org/forum/u/alfsolli)\
**Post date:** [May 31, 2018, 1:56pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050/11 "2018-05-31T13:56:34Z")

</div>

What voltage did this LiPo have? I’m wondering if I can use a single 18650 cell (Li-Ion) to power this board without any regulation.

---

<div class="post-metadata">

**Author:** ![ursm](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/ursm/32/46475_2.png) [@ursm](https://www.thethingsnetwork.org/forum/u/ursm)\
**Post date:** [June 1, 2018, 9:38am UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050/12 "2018-06-01T09:38:58Z")

</div>

look at the [schematic](https://content.arduino.cc/assets/MKRWAN1300-schematic.pdf)!  
Voltage at the screwconnector (X1) will **not be regulated**. connect there only 2 x AA(A) batteries.  
At Vin on the header you could connect a LiPo. that will be regulated down to 3V3, but it must not be grater than 5V in any case!

---

<div class="post-metadata">

**Author:** ![cimm](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/c/ecae2f/32.png) [@cimm](https://www.thethingsnetwork.org/forum/u/cimm)\
**Post date:** [July 25, 2018, 1:35pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050/13 "2018-07-25T13:35:09Z")

</div>

I managed to get mine powered up using 2 AA cells connected to the screw terminal. Notice that the ON LED [won’t turn on](https://store.arduino.cc/mkr-wan-1300) when it’s battery powered (this confused me for a while):

> LED ON: This LED is connected to the 5V input from either USB or VIN. It is not connected to the battery power. This means that it lits up when power is from USB or VIN, but stays off when the board is running on battery power. This maximizes the usage of the energy stored in the battery. It is therefore normal to have the board properly running on battery power without the LED ON being lit.

I simply made it blink in the `setup` part to have some visual feedback.

---

<div class="post-metadata">

**Author:** ![suendermarkus](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/suendermarkus/32/44037_2.png) [@suendermarkus](https://www.thethingsnetwork.org/forum/u/suendermarkus)\
**Post date:** [August 14, 2018, 8:33pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050/14 "2018-08-14T20:33:28Z")

</div>

First of all many thanks @gonzalo for putting this together. It managed to build my first TTN node using a MKRWAN 1300 and your instructions were extremely helpful.

After the first days of testing I arrived to similar questions as the others in terms of batteries.  
I am using 2 AAA standard batteries and ran two test cycles sending a message very 60 seconds. In both tests the node stopped sending after about 1500 uplinks, the voltage was at about 2.6V.

Therefore asking myself I should not

1. tune the code (add low power / sleep mode?)
2. use a 3.7V LiIon or LiPO battery

@ursm stated that should work via Vin, did you test it?

---

<div class="post-metadata">

**Author:** ![ursm](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/ursm/32/46475_2.png) [@ursm](https://www.thethingsnetwork.org/forum/u/ursm)\
**Post date:** [August 15, 2018, 12:50pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050/15 "2018-08-15T12:50:22Z")

</div>

> [@suendermarkus](#):
>
> ran two test cycles sending a message very 60 seconds

> [@suendermarkus](#):
>
> stopped sending after about 1500 uplinks

first I assume, without knowing your message size, that you’re violating the  
Fair Access Policy:

```plaintext
Golden rule: 30 seconds air-time per device per day
  For 10 bytes of payload, this translates in (approx.):
          20 messages per day at SF12
          500 messages per day at SF7
          more for SF7BW250 and FSK (local-area)
  Downlink bandwidth is even more restricted
  you can’t send all messages as ‘confirmed uplink’ 

```

second: No I did not test it, I only made a statement about proper voltage and it’s connection.

---

<div class="post-metadata">

**Author:** ![JamesConway](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jamesconway/32/16062_2.png) [@JamesConway](https://www.thethingsnetwork.org/forum/u/JamesConway)\
**Post date:** [August 15, 2018, 2:51pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050/16 "2018-08-15T14:51:46Z")

</div>

Thanks, @gonzalo for the information. Does anyone have a tutorial on connecting an Arduino Wan 1300 to Pycom LoPy nano Gateway by any chance?

---

<div class="post-metadata">

**Author:** ![suendermarkus](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/suendermarkus/32/44037_2.png) [@suendermarkus](https://www.thethingsnetwork.org/forum/u/suendermarkus)\
**Post date:** [August 15, 2018, 2:53pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050/17 "2018-08-15T14:53:20Z")

</div>

Ok thanks.

NB: I am aware I need to reduce the frequency. It was only for a fist test/simulation with a very small payload to understand the power consumption.

---

<div class="post-metadata">

**Author:** ![jbreslin](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/j/df788c/32.png) [@jbreslin](https://www.thethingsnetwork.org/forum/u/jbreslin)\
**Post date:** [August 15, 2018, 11:23pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050/18 "2018-08-15T23:23:26Z")

</div>

I believe that if you are using the MKRWAN library and the arduino firmware your attempts to send data at periods of less that 120 seconds will fail. This is hard coded and you can’t get round it but the dummy write in the library will dump your data.

The library is has a lot of blocking code delays and does not handle unexpected data or delays in connection requests well. Hopefully this will be addressed as the product matures.

There are a number of Arduino MKRWAN restrictions imposed that are not well documented but if you have a specific query I will try look at it but I am no expert on the firmware or the library.

I am not certain about ADR but if I force the datarate I get no responses from the network with anything other than setting 0…this may be just a poor signal as I am a 7km from my nearest gateways and in a rural location. I will add a local gateway soon and this should help diagnose network related issues better.

Is anyone aware if there is much effort going on to improve the library or document the firmware? Information seems hard to come by.

On the battery front I am using a 400mAh 3.2v lithium and charging it from a small solar cell. In other words I have scavanged an external LED home lamp case and push the output through a charge circuit, dc-dc booster and simple regulator. The device works away reliably but I have to top up the charge using the USB connector when working indoors.

Hope this helps,  
JohnB

---

<div class="post-metadata">

**Author:** ![UdLoRa](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/udlora/32/45330_2.png) [@UdLoRa](https://www.thethingsnetwork.org/forum/u/UdLoRa)\
**Post date:** [August 20, 2018, 9:09am UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050/19 "2018-08-20T09:09:33Z")

</div>

> [@jbreslin](#):
>
> if I force the datarate I get no responses from the network with anything other than setting 0…

I successfully send at SF7 too, likely is the distance from the gateway. However, I read somewhere that ADR is not really working.

---

<div class="post-metadata">

**Author:** ![suendermarkus](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/suendermarkus/32/44037_2.png) [@suendermarkus](https://www.thethingsnetwork.org/forum/u/suendermarkus)\
**Post date:** [August 26, 2018, 1:47pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050/20 "2018-08-26T13:47:14Z")

</div>

> [@jbreslin](#):
>
> I am not certain about ADR but if I force the datarate I get no responses from the network with anything other than setting 0…this may be just a poor signal as I am a 7km from my nearest gateways and in a rural location. I will add a local gateway soon and this should help diagnose network related issues better.

I have two MKRWANs running next to each other and I am using the MKRWAN library.  
In the code I have  
modem.setADR(true);  
modem.dataRate(5);

First one is connected on SF9BW125, the second on SF7BW125.

I recently added the ArduinoLowPower.h to reduce the power consumption (time will show if that really helps)

[Next page](https://www.thethingsnetwork.org/forum/t/arduino-mkr-wan-1300/12050.md?page=2)
