cancel
Showing results for 
Search instead for 
Did you mean: 

How do I set AS923 band plan for P-NUCLEO-LRWAN2 sensor?

APate.6
Associate II

The guide says that the band plan can be changed using the Lora_SetDeviceBand() function for the AT-Master example.

/**************************************************************
 * @brief  Do a request to set the country band code for LoRaWAN
 * @brief  Need to write to DCT and Reset module to enable this setting
 * @param  BAND in value 0(EU-868 Band) / 1(US-Band)
 * @retval LoRa return code
**************************************************************/
ATEerror_t Lora_SetDeviceBand(uint8_t DeviceBand);

It only shows the values for EU and US bands. What value do I use to change to using AS923? The symbol USE_BAND_868 is defined in the symbols. Does changing it to USE_BAND_923 change the band plan? I cannot find use of this symbol anywhere in the AT-Master code.

1 ACCEPTED SOLUTION

Accepted Solutions

@SYoo.1​ I managed to make it work with AS923. In lora_driver.c, you need to add the following code in the Lora_fsm function:

LoraCmdRetCode = Lora_SetDeviceBand(3);
Lora_UpdateConfigTable();

Make sure to check lora_driver.h to see if the update config function is declared. For me, that function was greyed out even though the #USE_I_NUCLEO_LRWAN1 symbol was defined so i just removed it from the code. Feel free to message me if you have any more questions.

View solution in original post

5 REPLIES 5
SYoo.1
Associate II

I have similar problem, and I don't have any idea on the procedure to change the band. Is it enough to call the function alone or we need to reset the module? It would better if the manual describes the procedure more in detail.

>>Is it enough to call the function alone or we need to reset the module? 

Strikes me that you'd have to add additional code to support a third option, and map the AS923 frequency, band and channel expectations.

>>Does changing it to USE_BAND_923 change the band plan? I cannot find use of this symbol anywhere in the AT-Master code.

Ok, if not found, then not implemented. Review those options already implemented, and add additional options in the same form/fashion, of refactor using tables as appropriate.

Remember ST's goal here is to demonstration functionality, this might represent a limited subset of use cases, not provide you with a commercially deliverable product with zero effort. Your team will need to review and understand the functionality, as provided, and then refactor to meet your own target market and customer expectations.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

@SYoo.1​ I managed to make it work with AS923. In lora_driver.c, you need to add the following code in the Lora_fsm function:

LoraCmdRetCode = Lora_SetDeviceBand(3);
Lora_UpdateConfigTable();

Make sure to check lora_driver.h to see if the update config function is declared. For me, that function was greyed out even though the #USE_I_NUCLEO_LRWAN1 symbol was defined so i just removed it from the code. Feel free to message me if you have any more questions.

@Community member​ Thank you very much for the detailed quide. According to the module(shield) manual, we need to reset the module after chaning the band. But, actually, we don't need the reset. When I first tried your suggestion, even though the band was changed(), the joing message couldn't reach to 'thethingsnetwork". I found appeui was cleared to zero(I don't know how it happens), and I corrected it with 'LoRa_SetAppID'. Then I see the join packet in '' 'thethingsnetwork". That means the join request reachs to G/W.

But the join (reply?) from the G/W is not reached to the sensor node. Now I'm checking why the join fails.

by referring "http://www.techplayon.com/lora-device-activation-call-flow-join-procedure-using-otaa-and-abp/#:~:text=By%20Personalization%20(ABP)-,Over%2DThe%2DAir%20Activation,below%20depicts%20the%20join%20procedure.", I found my mistake which I didn't check the appKey. The mistake seems to be due to an accidental reset(erase) of the module parameters such as AppEUI, AppKey, etc. I have called some API functions such as Lora_Reset, Lora_UpdateConfigTable, or/and Lora_SetDeviceBand in main.c or Lora_fsm() in lora_driver.c.

Now I'm using KR920 in P-NUCLEO-LRWAN2 with TTN. @Community member​ , @Community member​ : Thank you very much for your time to solve my problem!