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

Changing APP EUI, KEY and DEV EUI without changing defined in the library #16

Open
DeveloppeurPascal opened this issue Sep 10, 2019 · 8 comments

Comments

@DeveloppeurPascal
Copy link

An idea for a next release of this library.

It is convenient to have OTAA parameters (APP_EUI, APPKEY, DEV_EUI) as defined in the library when you only have one device, but when you have several devices it is useless. It must be possible to change them as a variable in the code of our programs.

As it stands, the proposed library does not allow to industrialize the work with Heltec cards. That's a pity.

@DestinyFxxker
Copy link
Contributor

This is very easy to do, thank you for your suggestion, maybe we will make adjustments in the next version.

@DeveloppeurPascal
Copy link
Author

Thanks.
For the others I fixed the problem for me by changing values to DevEui[], AppEui[] and AppKey[] global variables as first lines of setup() function.

The last great limit is for the LICENSE variable and MCU activation.

@DeveloppeurPascal
Copy link
Author

For automating DevEui, I change it from ChipId with this code :

uint64_t chipid = ESP.getEfuseMac();
for (int i = 0; i < 8; i++) {
if (i < 2) {
DevEui[i] = 0;
}
else {
DevEui[i] = chipid % 256;
chipid = chipid / 256;
}
}

So if ChipId is 12 34 56 78 9A BC, my DevEui will be 00 00 BC 9A 78 56 34 12.

@Ajaynithish
Copy link

@DeveloppeurPascal where to mention the user data in this library? i can't find one
void PrepareMsgFrame( uint8_t port, uint8_t Msg2Send[], uint8_t length ) is this is the one? @solotaker @Heltec-Aaron-Lee @gibus27

@DestinyFxxker
Copy link
Contributor

@DeveloppeurPascal where to mention the user data in this library? i can't find one
void PrepareMsgFrame( uint8_t port, uint8_t Msg2Send[], uint8_t length ) is this is the one? @solotaker @Heltec-Aaron-Lee @gibus27

Yes, use like this:

      uint8_t msg[] = "Msg test 43";
      PrepareMsgFrame( AppPort, msg , sizeof(msg)-1);

@Ajaynithish
Copy link

@DeveloppeurPascal how did you defined the parameters outside the library. I've been trying it for weeks, all I get is ERROR:undefined reference. any one any hint @solotaker @gibus27 @Heltec-Aaron-Lee

@Heltec-Aaron-Lee
Copy link
Contributor

what parameters?

@Ajaynithish
Copy link

The dev addr , netsessionkey.... But i found it thanks for the response

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

No branches or pull requests

4 participants