Frequency correction based on board temperature & receiver bandwidth match to allowable value #263
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request add a couple of features,
One for making possible that the board correct itself the tuned reception frequency based on measurements of current board temperature and
Another one for matching the receiver bandwidth to be set with the one value allowed by the RF modem.
The feature for frequency correction is based on the measurement of the microcontroller temperature. When this measurement is possible to be done, the microcontroller and the RF modem share the same space, and the temperature affecting each other is the same, it has been found that the frequency correction is possible keeping the board tuned to the desired satellite frequency within +/-1 KHz (although for assessing this with more confidence, more experiments are warranted, because different RF chips could exhibit different behaviours to the temperature variations). This frequency correction based on local temperature has been found satisfactory for increasing the likelihood of getting FSK packets. Basically the new feature consist on the possibility of defining a curve temperature based on a couple of temperature-frequency points determined from several measurements made on the same board to be calibrated.
The other feature, the matching of the receiver bandwidth with the one allowed by the RF modem, has been done because it has been found that when trying to configure a SX1268 board with a bandwidth that was suitable for SX1278, the board failed to be configured. The new feature check the receiver bandwidth commanded against the allowable values for the particular board where the configuration is to be loaded, and if the receiver bandwitdth does not coincide, the algorithm take the closest higher bandwidth value that is allowed by the board to be configured, set that value, and indicate in the dashboard output log that a new bandwidth has been selected. Should we disagree because we think that a lower BW value could be set, then we can manually change it, but we avoid with this feature that the board gets in a status with the radio disabled due to a wrong configuration.