Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

joinOTAA() in sketch "LoRaSendAndReceive" and other examples from this lib gives false error "Something went wrong …" #139

Open
mac-arno opened this issue Dec 4, 2024 · 0 comments
Labels
topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project

Comments

@mac-arno
Copy link

mac-arno commented Dec 4, 2024

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 infinite while (1) loop:

int connected = modem.joinOTAA(appEui, appKey);
if (!connected) {
Serial.println("Something went wrong; are you indoor? Move near a window and retry");
while (1) {}
}

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 see Accept join-request Successfully processed join-request Forward join-accept message in the TTN dashboard), my MKR WAN 1310 puts out a connect return value of 0. 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 value connected = 0. And 0 is by definition a binary false.

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?

@mac-arno mac-arno changed the title joinOTAA() joinOTAA() in sketch "LoRaSendAndReceive" and other examples from this lib gives false error "Something went wrong …" Dec 4, 2024
@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: documentation Related to documentation for the project labels Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants