Restrict Boron 2G or 3G connections

Hello,

Quick question and then the reason at the end on why I want to do this.

Question

Are we able to restrict the Boron 2G/3G devices to just use 3G networks?

Research

From the device APIs, it seem that we are able to tell what radio technology is being used via the getAccessTechnology() command but I don’t think the function is available to restrict the device to just use 3G networks.

As of device OS 0.9.0 the Cellular.command() was made available to send AT commands the cellular module. I am in the process of looking through the docs for these commands but if someone has done it or have insight on this, it would be appreciated.

Reason

As LTM-M is not fully established in Canada yet, we have to stick with the 2G/3G version of the Boron. Currently in Canada, Rogers is the only vendor left with a 2G network running. They plan to completely obsolete and shut off all 2G towers in Canada by end of 2020. What I do not what happening is for deployed Boron 2G/3G devices to be affected by this shutdown.

Since the shutting down of 2G is inevitable if we are able to control and restrict the Boron to just 3G networks, we can then test connectivity and avoid installing units in places with only 2G connection.

A smaller bonus is that the 3G power consumption of the Boron units is only 800mA

Sources

The command you’re looking for is AT+URAT=x. This allows you to select a specific radio access technology.

Indicates the radio access technology and may be:
• 0: GSM / GPRS / eGPRS (single mode)
• 1: GSM / UMTS (dual mode)
• 2: UMTS (single mode)
• 3: LTE (single mode)
• 4: GSM / UMTS / LTE (tri mode)
• 5: GSM / LTE (dual mode)
• 6: UMTS / LTE (dual mode)
• 7: LTE Cat.M1
• 8: LTE Cat.NB1
• 9: GPRS / eGPRS
2 Likes

@picsil thanks for the reply.

I looked through the commands manual and the “AT+URAT” define values in section 7.7.3 does not show SARA U201 under the module series.

I also posted on the Ublox forums and I was recommended the " AT+COPS" command instead in section 7.4. In the allowed values for the SARA U201 are 0 and 2. With apparently 2 being 3G in general

I will probably give both these commands a try but on first read it seems the AT+UART command may not be supported for the Ublox on the Boron.

Let me know your thoughts

AT commands manual:

Ublox forum post:

So I spend the weekend trying somethings out plus reading the AT-commands and examples sheet…

In summary I think I’ve gotten the AT+URAT=x to work, thank you @picsil for the reply. I didn’t get the AT+COPS command to work but it might be be not understanding the “AT+COPS=[mode[,format[,oper[,AcT]]]]” syntax, and there weren’t any examples of changing the value in the example document.

Now I am not really fimilar with radio access technology terminologies and I am far from being an expert, but from what I can tell + google + trail and error from the table posted by @picsil

• 0: GSM / GPRS / eGPRS (single mode)
• 1: GSM / UMTS (dual mode)
• 2: UMTS (single mode)
• 3: LTE (single mode)
• 4: GSM / UMTS / LTE (tri mode)
• 5: GSM / LTE (dual mode)
• 6: UMTS / LTE (dual mode)
• 7: LTE Cat.M1
• 8: LTE Cat.NB1
• 9: GPRS / eGPRS
  • Mode: Single/Dual/Tri mode allows your radio to switch between the number different bands i.e. 2G/3G/4G (4G being LTE?) with single mode restricting you to 1 band, dual to 2 and tri to 3
  • Band GSM/GPRS/eGPRS: I think this band is 2G, setting this to single band and using the getAccessTechnology() gives me “NET_ACCESS_TECHNOLOGY_GSM” which is said to be 2G RAT on particle’s device API docs
  • Band UMTS: I think this band is 3G, my device by default is connected to this band and getAccessTechnology() returns “NET_ACCESS_TECHNOLOGY_UMTS”.
  • Band LTE/LTE Cat.M1/LTE Cat.NB1: Did not try, theres no LTE-M publically availble in canada yet.

If anyone can confirm or correct my findings above, I would really really really appreciate it.

Assming all of the above is correct, the syntax for the AT+URAT command is AT+URAT<SelectedAcT>[,<PreferredAct>[,<2ndPreferredAct>]] (e.g. AT+URAT=x,y,z where x, y, z is your selected, preferred and second preferred). Note that in order to have a preferred act you MUST at least be operating in dual/tri mode. Same goes for the second preferred act in tri mode. So 1 variable single mode, 2 variables dual mode and 3 variables tri mode. If you have additional perferred act variables and operating in a lower mode, the variables are ignored (e.g. AT+URAT=0,0 is the same as AT+URAT=0 since 0 is for GSM single mode so the second “0” doesn’t matter)

Now to limit your device to 3g, example 4.1.3.2, page 15 and 17.1.1 on page 117 of the AT examples helped me the most. There seems to be some presteps before you need to call AT-URAT. The steps are;

  • Deregister from network
  • Select the band you want
  • Register to network
    Cellular.command(printCallback, tech, 10000, "AT+COPS=2\r\n"); // Deregister network
    Cellular.command(printCallback, tech, 10000, "AT+URAT=2\r\n"); // Pick band 2 for 3G single, 0 for 2G single
    Cellular.command(printCallback, tech, 10000, "AT+COPS=0\r\n"); // Register network

After executing these commands, you will loose connection for a few seconds and then reconnection will automatially happen. Use the getAccessTechnology() to see what band you are on. By default it seems the boron 2g/3g is on a selected 3g band with a preferred band of 2g (i.e. it will always pick 3g unless 2g is avaible, so I think default mode is AT+URAT=1,2).

With all that being said…

  • If anyone has experience or can verify what what I posted is correct that would really be great
  • Check my terminology and implementation if possible (Maybe someone from particle? I would really appreciate it)

This implementation is probably important to those who are deploying units in areas where 2G is being EOLed.

2 Likes

I just wanted to jump in and mention that this sort of low level twiddling should be done with care and testing before deploying, and you should probably implement some sort of recovery logic that can set the factory default of AT+URAT=1,2 (for SARA-U201) since this setting will persist through power cycles.

This setting of AT+URAT=1,2 or AT+URAT=, where 1=GSM / UMTS (dual mode) and 2=UMTS (single mode) should mean that it will try DUAL mode first and prefer 3G, but be able to fallback to 2G. If that fails, it will try 3G single mode, and cycle back to DUAL mode after that fails.

So what you might try for 3G only is AT+URAT=2,1 so it will try 3G single first with DUAL as a backup

Or you can for 2G only you could try AT+URAT=0,1,2 which would try 2G single first, then the factory default strategy of DUAL then 3G single.

I haven't tested the above settings, so it would be interesting to know if they work for you.

1 Like

Thanks for the feedback.

A recovery mode is a good idea in general and I will probably experiment with it. I do want the device to “fail” when 3G is not availble but not brick the device on the spot, so perhaps I can boot it into a mode which disables “functionality” and flashes the LED red or something. If you recall, my goal is to not have units “work” (i.e. no “functionality”) in areas where 3G is NOT availble so we can recommand NOT to install them there. Refer to opening post for more information.

It will be very diffculty for me to test this since I do not have the proper equipment. The environment I live in has both 2G/3G connection readily availble so the device will sucessfully connect to it’s first preference. So i am unable to see if the device will default to its second or third preferences.

If only I had an RF box and a configurable cell repeater I could use, I would be able to isolate the particle in my desired cellular environment. If anyone does have the it would be great to find out. I wouldn’t mind helping out remotely if someone is willing to work together.

With regards to testing…

  • Printing the RAT gives me “UMTS” when on 3G single which seems correct and “2G” when switching to 2G single
  • Particle still connects to the cloud in both scenarios
  • When switching to 3G I am able to power the Boron with just a USB cable to the PC (i.e. ~500mA)
  • When switching to 2G I am unable to power the Boron with just a USB cable and need a LiPo since 2G connection seems to spike to 1800mA from the datasheet.

Last 2 test with the boron shutting off is not a great data point for “if its working” but I guess it makes sense?

@BDub Thanks for this info. Can you say what the default URAT value is for the Boron LTE so I can build in some more recovery for my devices? They’re working well on AT+URAT=7, but if there’s a good fallback I’d like to use it.

To be honest I missed that part! That's a lot of "not's" though so as I understand it you want to detect when there is "2G only" and report that. To do this I would suggest switching between 2G only AT+URAT=0 and 3G only AT+URAT=2 and use Particle.publish() to log the RAT setting you are on. If you receive messages with only 2G/GSM and no 3G/UMTS you have a BAD area for your deploy. You could pair this with GPS data as well and plot all of these points on a map. I think it would take at least 60 seconds to have some certainty that it's not going to connect, but longer is better. I'm not sure how you propose to map an area, but hanging out in one spot for longish periods of time is preferred vs. driving around over 60s to 5min per RAT that you are testing...

Depending on how large your deploy area is, it might be good to initially look at coverage map data before putting boots on the ground to physically test.

AT+URAT=7,8 is the factory default for Boron LTE, but this is one modem that we change the default for on Gen 2 and Gen 3 devices within system firmware. If we detect URAT=7,8 we will change it to URAT=7 (Cat-M1 only). The reason for this is there is a bug in u-blox firmware that will get stuck scanning (or potentially take a REALLY long time to scan through all of the Cat-NB1 bands before it will switch back to Cat-M1). So since we currently don't support Cat-NB1 (nor does AT&T at this time), we force the connection to Cat-M1. So if you are using Cat-M1, your best bet is to keep AT+URAT=7. If you are using a 3rd party SIM that doesn't use AT&T, you might need to look into more options for fine tuning the bands that are used.. but you'll likely still not want to change the URAT setting. The command to look at is AT+UMNOPROF.

@BDub I am playing with more Ublox commands and was reading the examples docs in more detail:

I think the below comment is incorrect, but let me know if you think otherwise:

This setting of AT+URAT=1,2 or AT+URAT=, where 1=GSM / UMTS (dual mode) and 2=UMTS (single mode) should mean that it will try DUAL mode first and prefer 3G, but be able to fallback to 2G. If that fails, it will try 3G single mode, and cycle back to DUAL mode after that fails.

So what you might try for 3G only is AT+URAT=2,1 so it will try 3G single first with DUAL as a backup

Or you can for 2G only you could try AT+URAT=0,1,2 which would try 2G single first, then the factory default strategy of DUAL then 3G single.

So from page 17 of the doc...

AT+URAT=0,2 and AT+URAT=2,0 are allowed but the second parameter is ignored. The second parameter applies only to GSM / UMTS dual-mode Radio Access technology (first parameter equal to 1). In the read command and with this setting, the second parameter of the information text response can be omitted.

Now going back to the tabel...

• 0: GSM / GPRS / eGPRS (single mode)
• 1: GSM / UMTS (dual mode)
• 2: UMTS (single mode)
• 3: LTE (single mode)
• 4: GSM / UMTS / LTE (tri mode)
• 5: GSM / LTE (dual mode)
• 6: UMTS / LTE (dual mode)
• 7: LTE Cat.M1
• 8: LTE Cat.NB1
• 9: GPRS / eGPRS

So the reason why AT+URAT=1,2 works is because 1 stands for dual mode with the option of 2g/3g connection. The second parameter 2 which is 3G is the preferred network so essentially this means "Dual 2G/3G mode with 3G prefered". If 3G is not availble in this case, process of elimination occurs and 2G will get picked up. Therefore, if you want to try 2G first rather that 3G I think its AT+URAT=1,0.

2 parameters will only work if the first parameter is a dual band option and 3 parameters will work if the first paramter is a triple band option.

AT+URAT<SelectedAcT>[,<PreferredAct>[,<2ndPreferredAct>]] (e.g. AT+URAT=x,y,z where x, y, z is your selected, preferred and second preferred).

Some examples with my layman terms, first paramter indicates the number of availble bands, second and third option are band preferences.

  • 1,0 = Try 2G first and then 3G
  • 1,2 = Try 3G first and then 2G
  • 4,0,2 = Try 2G and then 3G and then LTE
  • 0 = Just try 2G
  • 2 = Just try 3G

I have a boron 2g/3g and I have a 2g tower very close and 3g towers are futher. I get 9-20% on 3g. What is the syntax for me to tell it to only use 2g? I want to see if this fixes the problem. It is not for production. Also when the connection is below 25% the functions never publish to the cloud. I can update the firmware and confirm it by changing the blink LEDs program in the loop, but my functions don’t show up on the cloud. I declare them correctly and name them first thing in setup(). I have C++ experience and have read the API on functions so I know it must take a single string and return an int. All of that is ok and the functions show up… when I have strong signal. I can ping it fine and I get check the health. All things fine. I ordered an aftermarket antenna and extender to try, but I would like to understand the problem. I have even been playing around with Particle.keepAlive() in casee TMobile changes some logic in their code to open up more bandwidth due to CoronaVirus home users.

@bgould the anwser is littarely in the post before yours. The command should be AT+URAT=0

Note that you will have to deregister, pick your band and then register as per my post in Restrict Boron 2G or 3G connections for this work. I suggest doing this in setup() as I have found that it works better this way.

Just wanted to confirm. It is my first time using an IOT device other than arduino. Thank you!

@bgould all good, just pointing out incase you missed it. Post back if you have any issues. Best of luck!

I’m sorry to jump onto an old thread, but I also have to restrict a Boron to 3G.
The provided samples seem to work fine, at least on my bench, does anybody know if the AT+URAT=2 setting will stay permanent, or do I have to call it every time when the device restarts after a power disconnection?

It looks like AT+URAT setting is saved in non-volatile memory in the cellular modem.

Wow, thanks for the super fast reply!