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

Update LoRaWAN_End_Device.ino #811

Closed
wants to merge 1 commit into from
Closed

Update LoRaWAN_End_Device.ino #811

wants to merge 1 commit into from

Conversation

amalinda
Copy link
Contributor

@amalinda amalinda commented Aug 18, 2023

As per my testing with Network Server of thingpark, I noticed the nwkKey and appKey must be formatted as follows for the join request to be accepted.

I am not sure if this is the case for other network servers too. But I believe it should be because of LoRaWAN standard. Please ignore the content , its the formatting that is important.

uint8_t nwkKey[16] = {0x42, 0x31, 0x91, 0x44, 0x91, 0x31, 0x91, 0x44, 0x91, 0x11, 0x91, 0x44, 0x92, 0x33, 0x91, 0x96}; uint8_t appKey[16] = {0x42, 0x31, 0x91, 0x44, 0x91, 0x31, 0x91, 0x44, 0x91, 0x11, 0x91, 0x44, 0x92, 0x33, 0x91, 0x96};

state = node.beginOTAA(joinEUI, devEUI, nwkKey, appKey);

As per my testing with Network Server of thingpark, I noticed the nwkKey and appKey must be formatted as follows for the join request to be accepted. 

I am not sure if this is the case for other network servers too. But I believe it should be because of LoRaWAN standard.
@jgromes
Copy link
Owner

jgromes commented Aug 18, 2023

I am not sure if this is the case for other network servers too. But I believe it should be because of LoRaWAN standard.

LoraWAN standard only mandates AES-128 encryption. That has 16-byte keys, it may very well be 16 characters long string, unless those are explicitly prohibited, which would be quite strange. As evident by the cast to uint8_t*, those strings are internally treated as 16-byte arrays.

I guess the one difference could be in the user interface of the network server - for example, TTN has the following input field for the keys in the web interface:

Screenshot_64

So you could argue that showing the string encoded as hex bytes would make it a bit easier to copy-paste them into the web interface and vice-versa ... but I fail to see much difference either way.

@amalinda
Copy link
Contributor Author

Thanks for your response @jgromes . I understand what you mean and I do agree with you.
In my case, the problem was that representing the AppKey in terms of ASCII was difficult but Actility Thingpark required AppKey/NwsKey to be in hex. One challenge could be that certain hex values, e.g., 00 to 1F, and 7F , could be challenging to be typed as ASCII.

What do you think? If you still feel its not that important, I will proceed to close the pull request :-)

@jgromes jgromes mentioned this pull request Aug 24, 2023
@jgromes
Copy link
Owner

jgromes commented Aug 24, 2023

Resolved by 95e3839

@jgromes jgromes closed this Aug 24, 2023
@jgromes
Copy link
Owner

jgromes commented Aug 24, 2023

@jgamage91 I decided to do this myself, seeing as it was mentioned in the main LoRaWAN issue by someone else.

@amalinda
Copy link
Contributor Author

amalinda commented Aug 25, 2023

Happy to see the changes absorbed nonetheless :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants