-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ST fw update for band selection at runtime #23
Conversation
Command "+BAND" added to the predefined set of AT commands. It allows to select the frequency band at runtime. The initial band is set to the European one. If the user selects a different band, the Lora state machine is re-initialized and the desired band of frequency is enabled. In the compiler builIn options, the symbols of the frequency bands of all the regions are set to False. An interactive test is available here: https://github.com/giulcioffi/tests_MKRWAN/blob/master/band_test.ino It continuously asks the user to select a new region. After the user inserts one, the value of the frequency on the RX channel is printed. In case this value is different from the one that should be set for that region, an error message is displayed.
Can we please add a couple long overdue things to this PR to help with power consumption? The mcu cannot be in a low power sleep state when the module attempts to send a response or downlink data. This issue is somewhat manageable in situations where the module responds immediately to an AT command from the mcu. However, there are a few situations where this cannot be addressed with the current firmware. First is for class B or C device downlinks where the downlink does not correspond to an uplink RX window. Second is where the response is not immediate, such as a join command. I think these issues could be addressed in one of four ways:
I am prepared to help with this but require some feedback on the suggested solutions from @facchinm and @giulcioffi |
@facchinm Could you please merge these commits to the master-1.3.1 branch and I can pull them and test this out. |
@sslupsky sure, this is a starting point with minimal functionality (just to test runtime band switching which is the functionality I need to test the most). |
The original version of the fw set the frequency region with a define. If the user had to change it, the firmware needed to be re-compiled and flashed with the new defined frequency.
In order to overcome these steps, the fw has been updated to store the region as a variable. The initial band is set to the European one. Whenever a different band is selected by the user, the Lora state machine is re-initialized and the desired band of frequency is enabled.
Command "+BAND" has been added to the predefined set of AT commands to perform the band update. MKRWAN library has been updated to support this command (arduino-libraries/MKRWAN#78).
The user can change the frequency region by using the funciton bool begin(lora_band band).
A simple test (https://github.com/giulcioffi/tests_MKRWAN) allows to continuously change the desired region, read back the frequency of the RX channel and compare it with the expected one.