ESP32_LoRaWAN
ESP32_LoRaWAN copied to clipboard
Changing APP EUI, KEY and DEV EUI without changing defined in the library
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.
This is very easy to do, thank you for your suggestion, maybe we will make adjustments in the next version.
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.
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.
@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
@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);
@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
what parameters?
The dev addr , netsessionkey.... But i found it thanks for the response