Device is not setting the user data rate and tx power, on reset. #94
Labels
bug
Something isn't working
cube mx
Issue related to the Cube MX tool rather than the firmware published within this repository
internal bug tracker
Issue confirmed and reported into a ticket in the internal bug tracking system
lorawan
LoraWAN-related issue or pull-request.
Describe the set-up
The board is NUCLEO-WL55JC1
STM32 CubeIDE v1.15.1
STM32 CubeMx v6.10
Describe the bug (skip if none)
I setted the default data rate (say DR4)and Tx power using he cubeMx in LoraWan_end_node example(although its occuring even in the other LoRaWan examples). On device reboot, on first attempt, device tries to connect with the default data rate DR4. On second attempt it switch to DR0, since its in the join parameters. But, even after the device has been joined, its not using the user setted data rate ie DR4, it continues in the DR0.
How to reproduce the bug (skip if none)
Additional context.
In the generated code, the user parameters has been setted in the file lora_app, using the variable LmHandlerParams.
When the device do not receive the answer from the gateway, the MLME_JOIN event occurs, in the file LmHandler.c,
There are 2 functions called , LmHandlerGetTxDatarate and LmHandlerGetTxPower has been called, to set the data rate and the Tx power for the join parameters.
In the function LmHandlerGetTxDatarate, at line 1000, we are setting the data rate to variable name LmHandlerParams.
LmHandlerParams is copied from the user device LmHandler values, which has to be used.
.
This alter the user defined values, causing the issue. On commenting the line 1000, resolves the issue.
Is there is any specific reason, that we are setting the LmHandlerParams, over riding the user values? As these function are not in the original LoRaMac Node repo.
This might be the case for the Tx Power also, although I did not tested it.
The text was updated successfully, but these errors were encountered: