'LORAWAN_PREAMBLE_LENGTH' undeclared

Hello, everytime I try to compile and upload [example from this repo](https://github.com /HelTecAutomation/Heltec_ESP32) I receive this error:

    /home/xxx/snap/arduino/current/Arduino/libraries/ESP32_LoRaWAN-master/src/region/RegionKR920.c:635:72: note: each undeclared identifier is reported only once for each function it appears in
    /home/xxx/snap/arduino/current/Arduino/libraries/ESP32_LoRaWAN-master/src/region/RegionCN470.c: In function 'RegionCN470TxConfig':
    /home/xxx/snap/arduino/current/Arduino/libraries/ESP32_LoRaWAN-master/src/region/RegionCN470.c:550:64: error: 'LORAWAN_PREAMBLE_LENGTH' undeclared (first use in this function)
         Radio.SetTxConfig( MODEM_LORA, phyTxPower, 0, 0, phyDr, 1, LORAWAN_PREAMBLE_LENGTH, false, true, 0, 0, false, 3000 );

And I don’t know what to do with it. I tried defining LORAWAN_PREAMBLE_LENGHT, but I got the same issue. How can I fix it?

1 Like

Update the ESP32 environment.

Hello everyone and thanks for your help.
Could you please tell me how to update the ESP32 environment ? I Already update the arduino ide and also the libraries. I tried it on windows and IOS too, but i get always the same issue.
Thank you in advance.
Best regards

Hello, I have same issue, what can I do to compile this example? Best regards!

1 Like

great help :triumph:

Hi. I added line “#define LORAWAN_PREAMBLE_LENGTH 8” in file LoRaMac.h and is compiling and work OK. Cheers!

2 Likes

thank you - this worked !