Yes, there is a voltage divider on ADC_BATTERY.
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.
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.
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.
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.
First of all, thank you sir for the helpful design. Any chance you got the MKR1300 fritzing part working properly, I receive an error, so it is missing on the PCB, even though it exists in the breadboard and schematics.
No, I did not.
I just used Fritzing in this case to illustrate the project and used only the breadboard…
Thanks for the info. I found a working one, so now I am making a board integration g all that good stuff you used. Thanks again for the good idea and nice execution.