Comments (6)
Hi @MarcoBenini ,
joinOTAA
returns true
if the network was joined; the same applies to endPacket(true)
(true
is necessary since it always returns > 0 if the message is unconfirmed).
From the application side these information should be enough to track what is going on and rate limiting the requests. Am I missing something?
from mkrwan.
I think I described in a wrong way the problem.
The MKR1300 WAN doesn't complete the join since a problem of timing of the PyCom "nanogateway" and so doesn't receive the message from the LoRaWAN network server (TTN).
Using the "LoraSendAndREceive" sketch is shown after n time the error message "Something went wrong; are you indoor? Move near a window and retry".
I modified the sketch to see what was the value of connected, that is 0.
int connected = modem.joinOTAA(appEui, appKey); Serial.print("Risposta join connected: "); Serial.println(connected); if (!connected) { Serial.println("Something went wrong; are you indoor? Move near a window and retry"); while (1) {} }
And I than have
"Risposta join connected: 0
Something went wrong; are you indoor? Move near a window and retry"
So join procedure is not completed since the MK1300 doesn't receive the downlink message join accepted.
Leaving MKR1300 continue to go, without resetting and doing nothing, the LoRa module continues to send join requests.
It doesn't stop after three retries as I understood it should do, if I interpreted well the firmware code, but I could be wrong.
Before I unplugged the MKR1300 it sent more than 90 join requests in 2.5 hours.
from mkrwan.
Right, it's probably a bug in the state machine handling the requests, or more likely an external event retriggers a send()
which calls https://github.com/arduino/mkrwan1300-fw/blob/master/Projects/Multi/Applications/LoRa/AT_Slave/src/lora.c#L274 ; since this function tries to join again it may be causing the multiple retries.
from mkrwan.
Is there now a solution for this problem? At good days my mkr1300 connects instant and sometimes up to 100 join requests and still no connection (SF7)..
from mkrwan.
Are the join requests actually being transmitted? I have a situation where I call joinOTAA() and the return code confirms that I have joined the network. However, the server doesn't receive a join request.
from mkrwan.
I actually think that continue retransmissions of join requests is how LoRaWAN specifies this. Typically nodes should start out at SF7 (or rather, the fastest datarate), try a few times, and then slowly (depending on duty cycle limits) move to slower datarates (with more range).
However:
- The firmware seems to continuously retry joins, even when a full cycle fails (this is a design choice, but might not be the best one): v1 firmware and v2 firmware.
- The library has a timeout on join (which defaults to 60s and can be configured using a
joinOTAA()
parameter, or is fixed to 60s in MKRWAN_v2). This means that after 60s, the join method returns failure / timeout, triggering the error message on serial above. However, this timeout does not cancel the join process, so it continues in the background. Since 60 seconds is (by far, I think) not enough for a full join cycle through all available datarates, this results in a weird situation (but I guess that's partly because a blocking API for this kind of thing is not ideal...).
I guess the proper way to do this is to: 1) make sure the firmware only does a single join sequence (across all datarates), returning a failure somehow if that did not work, 2) make sure the (default) library join timeout is long enough to allow a full join cycle to complete (so the timeout is triggered only in weird error cases / communication failures), and 3) ensure that any running join is canceled when a timeout happens.
from mkrwan.
Related Issues (20)
- Does this library really support US915? HOT 5
- External SPI bus freezes when LoRa is enabled MKRWAN 1310 - NOT same issue as Flash contention
- Feature Request: Allow printing the RSSI values HOT 1
- Is my MKR WAN 1300 not sending proper data to TTN? HOT 2
- Add GitHub Actions workflow to synchronise with shared repository labels
- Feature Request: Allow the MKRWAN library to send and receive very simple LoRa peer-to-peer commands HOT 5
- Class A ABP mode not receiving any messages HOT 3
- Official AT Commands for firmwares? HOT 2
- Set RX2DR - Not changing value HOT 1
- Why are join/connected methods virtual? HOT 1
- More recent LoRaWAN firmware for Murata HOT 2
- USB disconnecting when connecting via modem.joinOTAA HOT 1
- Faster upload speeds HOT 1
- Firmware version mismatch HOT 1
- how to joinOTAA with different datarate HOT 2
- Use of the restart() function is not documented
- Possible bug in `arduino_read` function of "MKRWANFWUpdate_standalone" example sketch
- Setting DR doesn't work HOT 3
- Endianness AppEui HOT 3
- Unable to join through OTAA on EU868 spectrum HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mkrwan.