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

Test LoRaWAN LinkCheck & DeviceTime #968

Closed
HeadBoffin opened this issue Feb 13, 2024 Discussed in #967 · 2 comments · Fixed by #980
Closed

Test LoRaWAN LinkCheck & DeviceTime #968

HeadBoffin opened this issue Feb 13, 2024 Discussed in #967 · 2 comments · Fixed by #980
Assignees
Labels
bug Something isn't working

Comments

@HeadBoffin
Copy link
Collaborator

Discussed in #967

Originally posted by michapr February 13, 2024
Hi,

using the LoRaWAN_End_Device_Reference.ino I cannot get valid results for the LinkCheck and DeviceTime values.
Connection itself is ok, I can see the transferred data in TTN console.

code (from examples file):

    uint8_t margin = 0;
    uint8_t gwCnt = 0;
    if(node.getMacLinkCheckAns(&margin, &gwCnt)) {
      Serial.print(F("[LoRaWAN] LinkCheck margin:\t"));
      Serial.println(margin);
      Serial.print(F("[LoRaWAN] LinkCheck count:\t"));
      Serial.println(gwCnt);
    }

    uint32_t networkTime = 0;
    uint8_t fracSecond = 0;
    if(node.getMacDeviceTimeAns(&networkTime, &fracSecond, true)) {
      Serial.print(F("[LoRaWAN] DeviceTime Unix:\t"));
      Serial.println(networkTime);
      Serial.print(F("[LoRaWAN] LinkCheck second:\t1/"));
      Serial.println(fracSecond);
    }

Result:

LoRaWAN] LinkCheck margin:	0
[LoRaWAN] LinkCheck count:	0
[LoRaWAN] DeviceTime Unix:	0
[LoRaWAN] LinkCheck second:	1/0

What maybe wrong here?

Thanks!

EDIT:
another interesting detail:
If add the request
node.sendMacCommandReq(RADIOLIB_LORAWAN_MAC_LINK_CHECK);
I will get an answer for
node.getMacDeviceTimeAns(&networkTime, &fracSecond, true)
(with same results as above...)

@HeadBoffin HeadBoffin self-assigned this Feb 13, 2024
@HeadBoffin
Copy link
Collaborator Author

Will test and respond by Thursday pm GMT latest.

@HeadBoffin
Copy link
Collaborator Author

It isn't working as expected, code has been identified, unexpected meeting has been scheduled so this is likely to be fixed early next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants