However, we have inadvertently misunderstood the functionality of this command as being the same as it was in pre-gateway-rs helium miner. This was not a problem with the old hm-miner container, as the region check command on the old miner only ever returned the asserted region plan, and never something configured in a settings file. Hence why this only started happening after the move to hm-gatewayrs container.
If there is a region set in the settings.toml file or using a GW_REGION environment variable this command will output the contents of the file/envvar until it gets the region directly from the config service. As we are running this check before we run the helium_gateway server at startup (and only once), this means that the region file never gets correctly updated with the correct frequency.
This is a problem in certain circumstances:
in situations like the change of frequency plan in Australia from AS923_1 to AU915 the gateway-rs will be running using the correct frequency plan, however the packet-forwarder will be using an incorrect config.
if a customer from one region plan area sells their miner to someone from another region plan area, it will not work correctly until a factory reset is performed.
The only way to fix this currently is a factory reset (it will never resolve itself otherwise).
The way to solve this is to periodicially run the region-checker script (that populates the region file at /var/pktfwd/region) and if an updated one is found then restart the packet-forwarder container.
In this file https://github.com/NebraLtd/hm-gatewayrs/blob/main/gen-region.sh we use
helium_gateway info region
which outputs the region from the region config oracle service.However, we have inadvertently misunderstood the functionality of this command as being the same as it was in pre-gateway-rs helium miner. This was not a problem with the old hm-miner container, as the region check command on the old miner only ever returned the asserted region plan, and never something configured in a settings file. Hence why this only started happening after the move to hm-gatewayrs container.
If there is a region set in the settings.toml file or using a GW_REGION environment variable this command will output the contents of the file/envvar until it gets the region directly from the config service. As we are running this check before we run the helium_gateway server at startup (and only once), this means that the region file never gets correctly updated with the correct frequency.
This is a problem in certain circumstances:
The only way to fix this currently is a factory reset (it will never resolve itself otherwise).
The way to solve this is to periodicially run the region-checker script (that populates the region file at /var/pktfwd/region) and if an updated one is found then restart the packet-forwarder container.