joinOTAA() in sketch "LoRaSendAndReceive" and other examples from this lib gives false error "Something went wrong …" #139
Labels
topic: documentation
Related to documentation for the project
type: imperfection
Perceived defect in any part of project
MKRWAN 1310 ARD-078 1.2.3 with MKRWAN.h 1.1.0 <-> TTN v3
I cannot find any return value table in the documentation for
joinOTAA()
. Perhaps one of the developers can help in answering that.I've got problems as well using the sketch LoraSendAndReceive and FirstConfiguration with EU868 parameter. The sketch hangs at
modem.joinOTAA()
in the following infinitewhile (1)
loop:MKRWAN/examples/LoraSendAndReceive/LoraSendAndReceive.ino
Lines 33 to 37 in 45cb552
The problem is identified by me to be in the context of
modem.joinOTAA()
. Therefore I suppose the problem is band (US or EU) independent. Upon successful connection with TTN v3 (I can seeAccept join-request
Successfully processed join-request
Forward join-accept message
in the TTN dashboard), my MKR WAN 1310 puts out a connect return value of0
. As far as I know that is a correct behaviour for a successful connect. But the sketch checks for!connected
and throws the error then because it evaluates the return valueconnected = 0
. And 0 is by definition a binaryfalse
.As a workaround I changed the check to
if (connected != 0)
so everything goes well after that, the sketch can continue to the main loop and I can successfully send messages to TTN v3.What is the right return value from
joinOTAA()
for a successful connection with TTN v3?The text was updated successfully, but these errors were encountered: