ESP32_LoRaWAN icon indicating copy to clipboard operation
ESP32_LoRaWAN copied to clipboard

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

Open DeveloppeurPascal opened this issue 5 years ago • 8 comments

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.

DeveloppeurPascal avatar Sep 10 '19 12:09 DeveloppeurPascal

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

DestinyFxxker avatar Sep 16 '19 11:09 DestinyFxxker

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 avatar Sep 16 '19 11:09 DeveloppeurPascal

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 avatar Sep 16 '19 11:09 DeveloppeurPascal

@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

Ajaynithish avatar Dec 21 '19 11:12 Ajaynithish

@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);

DestinyFxxker avatar Dec 23 '19 10:12 DestinyFxxker

@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

Ajaynithish avatar Dec 30 '19 08:12 Ajaynithish

what parameters?

Heltec-Aaron-Lee avatar Jan 03 '20 09:01 Heltec-Aaron-Lee

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

Ajaynithish avatar Jan 03 '20 11:01 Ajaynithish