Arduino MKR WAN 1300

Yes, there is a voltage divider on ADC_BATTERY.

See https://github.com/AmedeeBulle/TTNMkrWanNode/blob/master/TTNMkrWanNode/voltage.cpp

You might also want to check my example here:

I use the voltage of the battery to adjust the sleep time (function my_voltage())
My problem is that for whatever reason after a few days Lora sending fails. At least I can detect the error and can do a modem.restart() - but I would love to find out the reason.

1 Like

After having acquired a proper gateway (Lorix One), I found that downlinks seem not function when using ABP. I suppose ABP and downlinks should be unrelated, however with everything in the same position, same software except the join line changing from modem.joinOTAA to modem.joinABP, downlinks no more reach the node. Any ideas? My software is based on the LoraSendAndReceive example, with obvious adjustments. By the way, a Lora32U4 node with LMIC does not have the same issues.

Strange…
My ‘low-power’ setup ‘re-joins’ using ABP, and I have no issues with downlinks.

To try to isolate the issue, does that happen at all SF? (SF12 being different as downlinks are sent at RX2 if my memory serves well…)

So, SF9-12 no downlinks with ABP, SF7-SF8 yes (different frequency and SF). However, with OTAA also SF12 allows downlinks (at SF9 869.525). Mmm.

Interesting…

I don’t have a device I can play with to confirm, but I have to admit I sometime “lost connection” to my device at high SF during development, but I could not reproduce later on, and I assumed it was my fault as I was cutting power too soon…
(I say “lost connection” because I use downlinks to configure, so if I can’t use downlinks I have to physically reset them).

I would say, if you can reproduce with the latest firmware (1.1.9) and (a slightly modified) LoraSendAndReceive, file a bug with mkrwan1300-fw

Done, at this point I am sure. I have also some idea on why and how to cure it, but I never used AT commands directly so I need some time.
With OTAA the node receives the configuration:

Note that The Things Network uses the non-standard SF9BW125 data rate for RX2 in Europe. If your devices use OTAA, this will be configured automatically when they join. If your devices use ABP, you’ll need to program this RX2 data rate into the devices in order to make them work with TTN.

So, likely when using ABP the firmware is not configured to receive on RX2 at 869.525, SF9. There is no direct command for setting both, but through AT seems possible.

Not sure about that…
Depending what need to be changed. If it is just the RX2 data rate and frequency it can be done easily.

I just had an answer on Github that everything seems ok… but I sure I have this issue. I will try again today, when I have some time. However yes, I think at least RX2 data rate and frequency could be sufficient (I found the AT commands, not yet tried).
Not sure is the right place, however in lora.c : https://github.com/arduino/mkrwan1300-fw/blob/63787fe5ed8bd07119caba20d2065a26004b2261/Middlewares/Third_Party/Lora/Core/lora.c#L659
those defaults seem based on a condition that is not satisfied.

Just to know: it is indeed an issue, but due to the fact that TTN does not use the standard SF12 for sending downlinks in this case, but SF9. The firmware implements the standard. I modified MKRWAN.h to allow to set DR for RX2.

1 Like

Did anyone try long duty cycle ?
I have a mkr wan 1300 with a DHT22. I use the RTC lib to wake it up every period, read T and H, store it in a buffer and send it every 12 periods.
The LoRa modem is joined through OTAA, the DHT22 is re-intialized every period.
If the period is a minute, everything works fine. It the period is one hour and I send the buffer after 3 readings, it’s also cool.
But if the period is 1h and I try to send the buffer after 12 periods, it fails.

Did anyone cross the same kind of trouble ? Should I add a modem.restart() every time I want to send ?

Thx, it’s a pain to debug code running with such long periods

I bought two MKR 1300 units and was hoping to connect them trough The things network but no luck so far. With firmware ARD-078 1.1.9 and MKRWAN 1.0.10 library I get activation done but after that it’s complete silence and no bits traveling either direction. Wonder how this can be. Here are the details that TTN console gives me about the activation:

“frequency”: 868.1,
“modulation”: “LORA”,
“data_rate”: “SF7BW125”,
“coding_rate”: “4/5”,
“channel”: 0,
“rssi”: -122,
“snr”: -4

I can connect two units with point-to-point connection so it seems like there is something wrong either in the way I try to talk to The things network or the connection itself.

Which sketch are you using? By the way, RSSI seems very low. Is the gateway far?

Hi!

I am using the example sketch from MKRWAN lib documentation so I suppose it should be okay. Gateway is probably some 8 kilometers from where I am so that explains bad RSSI. I think I turn other of the MKR 1300 units to one channel gateway and see what results I get.

Are you sure joining succeeded? In case try with ABP, or try with an higher SF. By the way, there is no single channel gateway implementation for MKR WAN 1300 (and do not trust the “Error sending message” message on the serial console).

Hi ggeorgiou007,

I’m dealing with the same issue with the MKR 1300 using a I2C connection to an ads1115.
I’m sending data every 20’ everything works fine and after 2 days, data is no longer transmitted.

Since then, have you found the reason or a workaround?

Regards.

Hi everyone, I already met some of you guys on other forums and github issues, good to know you keep this conversation going here.
I can see this is a quite broad topic, but please move it to another one if my question is offtopic.

I’ve been struggling with MKRWAN1300 for about 6 months and - like many of you - faced some troubles. To make it work a little more reliable I changed the MKRWAN.h improving the joiOTAA function because it was frequently losing the modem answer. On my system I have a loraserver as the Network Server and the ADRACKReq messages works just fine! When I set on the NS that I have channels 1-8 enable, on the first message from the device that reaches the network it sends a downlink with the channel configuration in the ADRACKReq MAC command and the device configures itself correctly based on it.
One problem I have now is that when I need to power off/reset my device I don’t want to go trhough the OTAA process everytime, so I keep the NetworkAddres, NetworkSkey and AppSKey values saved then I run a local ABP join which doesn’t send a Join Request message. This is also working correctly, BUT, in this case the NS doesn’t sends a ADRACKReq MAC command since it considers that the session is the same and no parameters was changed.
So, this whole story was to ask: Is there a way to ask (force) to the Network Server to send to the device a ADRACKReq MAC command?

Here: Does ADR require the use of confirmed uplinks? , @arjanvanb suggests that the end device should trigger it, but I see no further information about how this could be done.
If you have some clue about how to do this on the MKRWAN1300, please share.
Thanks in advance.

That’s not enough; you also need to store the counters, the ADR state, and much more; see OTAA best practice: how to not join every time? I’d assume that would also solve your problem.

OK, I’ll check it!
Thanks a lot for the help. But, on my current tests I’m only keeping those data and it’s working quite well (I don’t use the counters). My only real problem now is that the device sends over all the channels, and the current version of the modem on MKRWAN1300 doesn’t have an AT command to mask the channels, so I would need to receive it from the NS.

But TTN surely will. If your device is starting at zero again, then TTN will reject your messages.

(You should store the network settings as well, like mentioned in the linked topic.)

1 Like