Hello @helixembedded
When you enable multiple regions in the STM32CubeMX configuration GUI, the firmware will include the necessary code and configurations to support all the selected regions. This means that the device will have the capability to operate in any of the enabled regions, but only one region can be active at any given time. The "Active region" setting determines which region the device will use for its LoRaWAN operations. Even though multiple regions are enabled, the device can only operate in one region at a time. The active region is typically defined in the lora_app.h file with a line like:
#define ACTIVE_REGION LORAMAC_REGION_EU868
This setting must match one of the regions defined in lorawan_conf.h:
#define REGION_EU868
#define REGION_US915
The active region must be one of the enabled regions in lorawan_conf.h for the device to function correctly.
The "Enable Hybrid mode" setting is used to manage the channel mask configuration for regions like US915, where there are a large number of channels. Enabling hybrid mode allows the device to use a subset of channels, which can be beneficial in environments with limited network infrastructure. This setting is defined in lorawan_conf.h:
#define HYBRID_ENABLED 1
When hybrid mode is enabled, the device will use a predefined subset of channels, which can help in scenarios where the gateway supports only a limited number of channels.
If a device moves from one region to another (e.g., from the EU to the US), the active region must be updated to match the new region. This can be done through a downlink message from the network server. The downlink message can instruct the device to change its active region by updating the ACTIVE REGION macro. This approach ensures that the device operates correctly in the new region without manual intervention. The Downlink must happen on the last Communication before changing the region.
PS: in this case, don't forget to change the Region definition to use a Variable and not a Macro so you can update it.
Best Regards.
STTwo-32