2024-09-02 12:35 PM
Solved! Go to Solution.
2024-09-03 08:41 AM - edited 2024-09-03 09:07 AM
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
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-09-03 02:50 AM
@helixembedded wrote:We have chosen this antenna for the application.
Apart from the antenna, you'll also have to ensure that all the rest of your RF hardware (filters, etc) works within the requirements of all the intended bands.
@helixembedded wrote:3. With multiple regions enabled - consider this scenario: if a device is in the EU and then moves to the US, how will that work?
The easiest solution would be to "decommission" it on leaving the EU region, and then "re-commission" it to US parameters on entering or deployment in the US.
That may be required anyhow if you're using different network operators in the different regions...
If you want that to happen automatically, you'd have to give the unit some sort of location awareness (eg, GNSS).
@helixembedded wrote:4. With multiple regions enabled, would a sensible implementation be then to implement a downlink message to set the "active region"?
How could that work?
If the device is set to EU then, when it arrives in the US, there will be no network there operating on the EU bands - so it won't be able to receive any downlink!
Do you have a network provider in mind with global coverage? Do they have any recommendations?
eg, this from TTN: https://www.thethingsnetwork.org/forum/t/gps-device-across-different-frequency-regions/29120/11
2024-09-03 03:38 AM
For the US example, the idea is that we would send a downlink message to the device to switch the active region before we ship it (we are based in the EU). We would then confirm the device is sending uplinks via our US Gateway, located in a test room at the office.
2024-09-03 04:01 AM
@helixembedded wrote:the idea is that we would send a downlink message to the device to switch the active region before we ship it (we are based in the EU).
Right - that should work.
You'd need to ensure that the unit did not transmit anything until it arrived in the new region ...
2024-09-03 08:41 AM - edited 2024-09-03 09:07 AM
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
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-09-03 08:58 AM - edited 2024-09-03 08:58 AM
@STTwo-32 wrote:The downlink message can instruct the device to change its active region by updating the ACTIVE REGION macro.
Errr ... surely, the macro is a compile-time thing - it can't be changed at run time?
So the source code would need to be modified to change this from a macro to a (non-volatile?) variable ?
2024-09-03 09:05 AM
Sorry, I've forgot to mention this. I've update it now.
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-09-04 12:43 AM
Thank you both for your detailed feedback and input @STTwo-32 and @Andrew Neil !