RFC: Configure RF band via EEPROM?

Some of my sensors operate in the 915 MHz frequency band. According to the documentation, one needs to recompile the firmware with the environment variable BAND=915 to enable this frequency band. Although I know how to do that, having to recompile every firmware just to be able to use it in a different frequency band is a bit annoying.

Is there a better way to do this? If not, what do you think would be a good mechanism for such infrequently changed parameters?

From a quick glance at the SPIRIT1 source code, it seems this particular parameter does not need to be compile-time and could very well be configured via the EEPROM. We could define a small set of core module configuration parameters and manage those via the twr_config functions. To make it easy to change the parameters, we could extend “bcf eeprom” to allow something like:

bcf eeprom set BAND=915

Then maybe one could flash a prebuilt firmware onto the core module with “bcf flash” and set the correct RF band with “bcf eeprom”?

-Jan

Yes, the BAND could be made reconfigurable now. We’ve added that as a quick solution for US in the Bigclown/Tower beginings. It really does not need to be compile-time defined.

Since those days, we’ve added quite comfort EEPROM library including twr_config
https://tower.hardwario.com/en/latest/firmware/how-to-eeprom-twr_config/

Other new thing is a AT command interface with low-power function when you disconnect USB cable. You can use AT commands to configure some functionality. In example below we configure PIR Module sensitivity, so you can easily add BAND here.

UPDATE:
More info on AT command usage is here. https://tower.hardwario.com/en/latest/tutorials/lora-at-commands-configuration/
We use it in all our LoRa firmwares to save configuration to LoRa Module EEPROM, so you can learn something from those firmwares but they doesn’t contain twr_config in Core Module.

If you plan to extend some default firmwares like Climate with this functionality, we would definitely merge your improvements.

In many firmwares it makes sense to add more configuration like transmission period, hysteresis which says when the measured value is send immediatelly when for example temperature changes by some value.