MakeMagazinDE / LoRaWAN

Templates, Listings und anderes zum Make Special LoRaWAN
2 stars 1 forks source link

Connection interval #2

Open SirFiChi opened 1 month ago

SirFiChi commented 1 month ago

Unfortunately, I have not found out where I can set the intervals at which the data packets are sent. Every 30 seconds is clearly too high for my use case.

In User_Modules/Application/inc/app_settings.h you can apparently only set the interval for retrieving the measured values, but not the transmission times.

Perhaps this can be included. Thank you very much.

Meadowtec commented 1 month ago

ELV suggests you use a LoraWan Downlink to change the dutycycle. It's explained in the magazine. The template code even makes it persistent by writing it to the pseudo EEPROM. If you want to change it in the code, app_settings.h (#define APP_DUTYCYCLE_DEFAULT) is the correct place. However, you have to make the following change

in app.c: flash_user_func_init (true);

This writes your changed APP_DUTYCYCLE_DEFAULT to the EEPROM. If (false), the provided code reads the settings from the EEPROM and overwrites your #define APP_DUTY.... at boottine. Just make sure to change it to (false) again after one boot or your Flash storage might get worn because it is written at every boot.

As an alternative, you could invrease the version-number of the data structure in the EEPROM. I have to look up details, might take a bit....

Meadowtec commented 1 month ago

Increase of EEPROM version-number: In file flash_user_func.h increase #define EEPROM_EMU_DATA_INIT_VALUE It's explained in the magazine, page 64 / Erweiterung. This way you don't have to change flash_user_func_init(). You can even increase / decrease every time you chnage something in the EEPROM. It just has to be different for the structure to be rewritten.

SirFiChi commented 1 month ago

Okay, after all, I have to read the full magazin to understand the big picture. I'm on vacation the next three weeks. If there is a LoraWan-Gateway, I will test ... ...and hope for some examples for the other modules. ^^

Thx @Meadowtec .