Noob needs help setting MVNO's APN for RM520N-GLAA to override SIM's APN

Hi, everyone!

I am a total newbie when it comes to Quectel and other cellular modems. Please be patient with me.

I bought a Quectel RM520N-GLAA in an M.2 Ethernet/USB enclosure, and while it works, it appears to currently be using the wrong APN (for T-Mobile) when it should be using a custom APN (for US Mobile, an MVNO reselling T-Mobile and Verizon service).

I have the full AT command guide but don’t really understand it. It doesn’t spell out in clear steps how to set the APN. Currently, the only command I understand the output for is AT+CGDCONT?, which shows contexts 1 through 6, all of which have APN values that are not correct. I assume it is using cid 1, which does have a T-Mobile APN set there.

If I try to use the AT+CGDCONT=1,… command, it always says ERROR, even if I copy and paste the exact output for cid 1 shown when I run AT+CGDCONT?, with only the APN string changed.

I’ve searched the web and found some short discussions on setting the APN, but they seem to use AT commands that are for other models of modem and that are not available on the RG520N-GL. From what I can tell, there are two or three different ways to set an APN. I’d like to use the simplest method or the one closest to the factory default configuration.

Any help would be appreciated, especially an explanation of the theory behind the commands I should use.

Thanks in advance!

What is the APN value you’re trying to set?

Please post the full results from your AT+CGDCONT? command as it is.

Please also post the results from the AT+QMBNCFG="List" command.

Hi, snowgum–

The exact APN I’m trying to set is the cellular-data-only portion of the Android phone settings for US Mobile
Their website says that I must manually set this:

APN: wholesale
Username: [blank]
Password: [blank]

These values (plus others for MMS, etc) somehow get automatically detected when I insert the same SIM into an iPhone. I don’t know whether they are actually stored on the SIM or if they are auto-downloaded from the network when the SIM is inserted.

I’ll get you the output of the commands you listed soon. Thanks!

Hi, snowgum–

Here are the AT results you asked for.

First, the commands I sent using atinout:

AT+CGDCONT?
AT+CGDCONT=6,"IPV4V6","wholesale","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0,,,,,,,,,"",,,,0
AT+CGDCONT?
AT+QMBNCFG="List"

Then, the output of the above commands:

+CGDCONT: 1,"IPV4V6","fast.t-mobile.com","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0,,,,,,,,,"",,,,0
+CGDCONT: 2,"IPV4V6","ims","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0,,,,,,,,,"",,,,1
+CGDCONT: 3,"IPV4V6","sos","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,1,,,,,,,,,"",,,,1
+CGDCONT: 4,"IPV4V6","tmus","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0,,,,,,,,,"",,,,0
+CGDCONT: 5,"IPV4V6","h2g2","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0,,,,,,,,,"",,,,0
+CGDCONT: 6,"IPV4V6","pcweb.tmobile.com","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0,,,,,,,,,"",,,,0

OK

ERROR

+CGDCONT: 1,"IPV4V6","fast.t-mobile.com","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0,,,,,,,,,"",,,,0
+CGDCONT: 2,"IPV4V6","ims","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0,,,,,,,,,"",,,,1
+CGDCONT: 3,"IPV4V6","sos","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,1,,,,,,,,,"",,,,1
+CGDCONT: 4,"IPV4V6","tmus","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0,,,,,,,,,"",,,,0
+CGDCONT: 5,"IPV4V6","h2g2","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0,,,,,,,,,"",,,,0
+CGDCONT: 6,"IPV4V6","pcweb.tmobile.com","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0,,,,,,,,,"",,,,0

OK

+QMBNCFG: "List",0,1,1,"Commercial-TMO",0x0A01050F,202402061
+QMBNCFG: "List",1,0,0,"ROW_Commercial",0x0A010809,202401151
+QMBNCFG: "List",2,0,0,"ROW_Generic_3GPP_PTCRB_GCF",0x0A01FF09,202203161
+QMBNCFG: "List",3,0,0,"TEF_Spain_Commercial",0x0A010C00,202302071
+QMBNCFG: "List",4,0,0,"FirstNet",0x0A015300,202206171
+QMBNCFG: "List",5,0,0,"Rogers_Canada",0x0A014800,202303141
+QMBNCFG: "List",6,0,0,"Bell_Canada",0x0A014700,202111051
+QMBNCFG: "List",7,0,0,"Telus_Jasper_Canada",0x0A01F900,202304281
+QMBNCFG: "List",8,0,0,"Telus_Consumer_Canada",0x0A01FA00,202304281
+QMBNCFG: "List",9,0,0,"Commercial-Sprint",0x0A010204,202111051
+QMBNCFG: "List",10,0,0,"VoLTE-ATT",0x0A010335,202206171
+QMBNCFG: "List",11,0,0,"CDMAless_Private-Verizon",0x0A01FD28,202304271
+QMBNCFG: "List",12,0,0,"CDMAless-Verizon",0x0A010126,202304251
+QMBNCFG: "List",13,0,0,"Swiss-Comm",0x0A010411,202304261
+QMBNCFG: "List",14,0,0,"Telia_Sweden",0x0A012400,202111051
+QMBNCFG: "List",15,0,0,"TIM_Italy_Commercial",0x0A012B00,202111051
+QMBNCFG: "List",16,0,0,"France-Commercial-Orange",0x0A010B21,202401081
+QMBNCFG: "List",17,0,0,"Commercial-DT-VOLTE",0x0A011F1F,202212061
+QMBNCFG: "List",18,0,0,"Germany-VoLTE-Vodafone",0x0A010449,202401201
+QMBNCFG: "List",19,0,0,"UK-VoLTE-Vodafone",0x0A010426,202401201
+QMBNCFG: "List",20,0,0,"Commercial-EE",0x0A01220B,202111051
+QMBNCFG: "List",21,0,0,"Optus_Australia_Commercial",0x0A014400,202111051
+QMBNCFG: "List",22,0,0,"Telstra_Australia_Commercial",0x0A010F00,202311071
+QMBNCFG: "List",23,0,0,"Commercial-LGU",0x0A012608,202111051
+QMBNCFG: "List",24,0,0,"Commercial-KT",0x0A01280B,202308031
+QMBNCFG: "List",25,0,0,"Commercial-SKT",0x0A01270A,202111051
+QMBNCFG: "List",26,0,0,"Commercial-Reliance",0x0A011B0C,202210211
+QMBNCFG: "List",27,0,0,"Commercial-SBM",0x0A011C0B,202401231
+QMBNCFG: "List",28,0,0,"Commercial-KDDI",0x0A010709,202401191
+QMBNCFG: "List",29,0,0,"Commercial-DCM",0x0A010D0D,202312201
+QMBNCFG: "List",30,0,0,"VoLTE-CU",0x0A011561,202310181
+QMBNCFG: "List",31,0,0,"VoLTE_OPNMKT_CT",0x0A0113E0,202312141
+QMBNCFG: "List",32,0,0,"Volte_OpenMkt-Commercial-CMCC",0x0A012010,202209221

OK

I expected the cid 6 entry to be updated with the new APN string value, but it stayed unchanged and said “ERROR.”

I don’t know where any of these values came from–it is possible that the seller who configured this modem put them in there or that they came from the SIM card.

Thanks!

They’re almost certainly from your active MBN (Modem Configuration Binary) file.

Ie: fast.t-mobile.com in the +QMBNCFG: results.

That file will be automatically activated on the basis of the SIM’s IMSI (identifying T-Mobile as the home network).

How did it end up in context 6? The AT command to do that would be: AT+CGDCONT=6,"IPV4V6","wholesale"

Normally, providers want to use context 1 for the data connection. A notable exception is Verison, which configures context 3 with the data APN, and context 1 with the IMS APN.

Your IMS APN is correctly placed in context 2. That and the context 3 through 6 APNs may or may not be needed for certain functionality.

To put “wholesale” into context 1, the AT command is: AT+CGDCONT=1,"IPV4V6","wholesale"

I expect it to stick, and remain there between power cycles, only being overwritten whan a different SIM is used.

It shouldn’t be necessary to disable MBN, and it’s probably best not to, other things being equal.

To disable MBN:

AT+QMBNCFG="Deactivate"
AT+QMBNCFG="AutoSel",0

To reactivate:

AT+QMBNCFG="AutoSel",1

should do the job.

1 Like

Thanks for the detailed response, snowgum!
I have to read up to understand most of what you said. (I haven’t tried anything you mentioned yet, until I understand what I’m doing.)

An answer to your question: “How did it end up in context 6?”
I arbitrarily chose cid 6 when I attempted to run the command to set/write it. The reason was that I suspected that context 1 was important (and you confirm this by saying "context 1 for the data connection). I was thinking that I could test changing any entry by first testing on something I am pretty sure is not being used. But, the result of attempting to change cid 6 or cid 1 was ERROR in both cases. I did try a few days ago to run this command, and it did not work:

AT+CGDCONT=6,“IPV4V6”,“wholesale”

It gave the dreaded ERROR response.

I will try it again, though, to be sure.

Also, I will go read up on MBN to determine if I want to disable it or not.

And, not sure if this helps, but I took the same SIM and put it in a PinePhone Pro (running a Quectel EG25-G and Mobian LINUX). It did require that I manually input the correct APN of “wholesale” before any data would flow. I am more sure now after this test that once I figure out how to put in the correct APN of “wholesale” in the RM520N-GLAA, it will pass data properly.

A word of warning when using copy-and-paste for commands on this web site:

ASCII double quotes get changed to unicode double quotes in posts, so commands with them embedded will always return “ERROR”. That’s unless “Preformatted text” is chosen for the commands when posting.

An alternative is to use a generic MBN file that doesn’t set the data APN. In your case that’d be:

AT+QMBNCFG="Deactivate"
AT+QMBNCFG="AutoSel",0
AT+QMBNCFG="Select","ROW_Commercial"

That should read “Commercial-TMO”.

Likewise, my “Verison” should read “Verizon”.

Sorry for the delay–as a new user I am not allowed to post too often.

Thanks for the tip about copy and paste. It wasn’t the issue, luckily.

It turns out that I was misremembering the command I had typed–I was typing in an additional values after “wholesale” such as <PDP_addr> that looks mandatory due to the bold text in the AT command guide. In other words, I had never tried only AT+CGDCONT=1,“IPV4V6”,“wholesale” alone but had put extra commas and blanks afterward.

So, good news–with only AT+CGDCONT=1,“IPV4V6”,“wholesale” I was able to set the APN for the active context using the active MBN.

It seems to be working, but the real test will be how long it works before it fails. Prior to this, I was able to get a few hours out of the prior configuration before the modem would refuse to pass data. I suspect that perhaps T-Mobile was allowing some grace amount of data without a properly-configured APN before cutting me off. Setting the correct APN (such as when I tried using the PinePhone Pro) immediately got around the cutoff.

If it fails again, I will try your next suggestion of using MBN ROW_Commercial. I found this other discussion that has success using a generic MBN. It’s basically the same advice you gave:

For now, I’m riding on the hope that the one command sticks, survives reboots and disconnects, so long as I don’t change the SIM.

Thanks again for your help! I learned quite a lot from you and watching the Quectel Technical Video Demo on MBNs on this forum. I still need to learn more of the theory, but at least the modem now works.

As a general rule, square brackets in AT command syntax indicate optional arguments.

AT+CGDCONT is a 3GPP (industry standard) command. Quectel proprietary commands generally begin “AT+Q”.

In the 3GPP 27.007 AT commands document, this command begins:

AT+CGDCONT=<cid>[,<PDP_type>[,<APN>[,<PDP_addr>[,<d_comp>[,<h_comp>[,<IPv4AddrAlloc>[,<request_type>

making only the first argument <cid> obligatory. This syntax simply removes the corresponding entry (if it’s not active at the time).

There can be many reasons for this. You might be able to run the modem in ECM mode, and that might result in 100% up-time. I’ve got a Quectel EM06-E that’s run 24/7 for over four years in ECM mode without a single apparent connection failure.

In ECM mode, the modem itself is responsible for reestablishing any failed connection, and does so almost instantaneously.

What does the AT command AT+QCFG="usbnet" return?

0 - QMI mode
1 - ECM mode
2 - MBIM mode

The AT command to change mode is AT+QCFG="usbnet",<mode>

Inadequate power supply is a very common cause of modem spontaneous halts or restarts, especially with 5G-capable modems.

1 Like

Hi, snowgum–

You must be clairvoyant! Today I woke up, the modem was working fine, albeit the internet access was very slow, and then it stopped working mid-afternoon.

I am very sure it’s not the APN any more. I check and double-check and it always says “wholesale” in context 1. It could be any of the possible causes you mention including insufficient power (I have an MCUZone MR5210P M.2 to USB+2.5Gbps Ethernet unit–it says input voltage 5V to 12V but doesn’t mention how many Amps are required.)

I know for sure that I’m on the edge of a T-Mobile cell where both voice calls and data with any of my devices are poor/unreliable. I just took the same US Mobile SIM and put it in my PinePhone Pro, and it is having a hard time getting an acceptable internet speed too. So at this time, I suspect that the current challenge I face is poor signal quality leading to frequent switching between bands and/or a signal so poor that data will not pass reliably.

I have read one comment on a forum saying that MCUZone’s provided antennae are awful, and based on their advertised specs, (that they are 12dBi), I tend to believe the complaint. No ordinary dipole antenna is going to be able to reach 12dBi–they typically max out at about 5.5dBi. Chances are high that these are cheap 2 to 3dBi antennae. (Also, the Gl-Inet router shows that the Quectel modem considers certain stats of the signal to be Poor or Fair.) So I ordered some more trustworthy 5.5dBi antenna made by TE Connectivity.

Hopefully that will be the last issue I need to fix for 100% up-time.

I will get back to you on the output of the AT+QCFG=“usbnet” command. I know that both the USB and the Ethernet interfaces are enabled, but I don’t know what mode they are in.

I might also be suffering from this problem:

The symptoms are nearly identical to mine, though I am also having problems when running on USB only.

Is there a command or way to run a hardware self-test on the Quectel RM520N-GL modem itself?

I will probably buy the alternate adapter board that iamromulan recommended and transfer the modem across, unless the modem fails its self-test, if such a test exists.

I’m not aware of a suitable modem self-test command.

AT commands which are useful for looking at the serving and neighbour cell environment are:

AT+QENG="servingcell"
AT+QENG="neighbourcell"

What model GL-iNet router are you using?

Thanks, snowgum, for all your help and theory/explanations!

I’m running a Gl-Inet Slate AX (GL-AXT1800). It’s got the latest firmware on it (which may also be suspect based on some discussions in their forum).

The output from AT+QCFG=“usbnet” is:

+QCFG: "usbnet",1

OK

A question: is the auto-connect feature only available when using the Ethernet port in ECM mode, or is it also available when running the modem off of USB only? (I am considering replacing the MCUZone box with a Gl-Inet GL-M2 dev board that is USB only but is supported by Gl-Inet tech support.) If USB-only does not have auto-connect, that would not be a viable course of action.

The servingcell output is:

+QENG: "servingcell","SEARCH"
 
OK

The neighbourcell output is nothing, followed by OK.

I’m guessing “SEARCH” means that the modem is searching for a valid signal, which would indeed support my current hypothesis that I am unable to get a reliable signal and thus need better antennae.

That said, I am in USB tethering mode and am currently still seeing the dreaded “SIM card not registered” error that I have seen discussed on the Gl-Inet forums. I don’t know exactly what that means yet. Maybe it is in SEARCH state because the SIM is unregistered? Or perhaps the SIM is unregistered because it is in SEARCH state?

UPDATE: a few hours later, without my doing anything, the modem connected to the network and internet traffic is being passed again. This does point at poor signal in my area. Can’t wait to get those new TE Connectivity antennae that I ordered…

ECM mode is usually used via USB.

That’s not on the OpenWrt list: [OpenWrt Wiki] Table of Hardware

I was thinking you might like to try ROOter as router firmware, but that depends on the router being on that list.

http://ofmodemsandmen.com/index.html
http://aturnofthenut.com/autobuilds/

(disclaimer - I’m on the ROOter development team)

Network registration is failing there. I wonder if the SIM can be read at that point. Reading the SIM’s IMSI with the AT+CIMI command will tell you.

That’s a possible explanation, but far from conclusive.

What’s the signal like when the connection works? AT+QENG="servingcell" again.

Thanks, snowgum–

I will run those commands throughout the day and collect the output.

Re: ECM mode is usually used via USB

Nice! That means the Gl-Inet GL-M2 will be fine. I am probably going to order the board that iamromulan recommends instead, as soon as the seller’s store opens again. It’ll give me something to do differential diagnostics with vs. the MCUZone MR5210P board. If they both work, then it’ll serve as a backup unit.

Re: OpenWRT

I may switch routers in the future, but for now, the Gl-Inet travel router (with its custom version of OpenWRT) seems to be working properly, especially since I know I can tether phones via USB without trouble. My problems seem to only be with either the Quectel modem module or the MCUZone box right now, or maybe the SIM card or US Mobile service.


Re: power possibly not enough

Forgot to mention that the MCUZone MR5210P is sold by the maker with either a 5VDC 2A power supply or a 12VDC 2A power supply.

iamromulan says he uses a 5A power supply, but I figure that’s massive overkill.

Currently I am using a 1.5A power supply when on Ethernet. When using USB tethering, power is supplied over the USB port, I don’t know how much, and it probably is not enough to truly run the radio at full power. I do not know if the MCUZone box allows both the external DC power supply and the USB cable to be plugged in at the same time and don’t want to take the risk in case it blows something up.

I do know that the Gl-Inet GL-M2 dev board expects a separate power supply to be attached while the USB plug is attached to the router. Their power adapter is 12V 1.5A. Based on that and the MCUZone’s 2A, I am probably running too low a current rating. But…

The Quectel product brochure says this of the RM520N modem with typical supply voltage of 3.7V:

Power Consumption 195 μA @ Power off ; 4.7 mA @ Sleep; 40mA @ USB 2.0, Idle;
60 mA @ USB 3.0, Idle

Strangely they don’t mention the Typical current draw as they do with other modems in the same brochure. None of them mention max current draw when the radio is working as hard as it can.

The MCUZone adapter board itself probably requires some power but that isn’t specified either; it doesn’t look like I’ll be able to calculate exactly what the minimum power requirement is to run the radio at full blast.

From the RM520N-GL Hardware Design pdf:

“Ensure the continuous current capability of the power supply is 3.0 A at least.”

1 Like

Nice! Thanks for sharing that. I went and downloaded the Hardware Design guide (didn’t know it existed till you mentioned it). On page 27 it looks like they mean 3.0A at Vnom = 3.7V (the example in Fig. 5 mentions 3.3V, but I’ll assume Vnom is what they mean). That suggests at minimum the continuous power consumption should be 11.1W.

Interestingly, on page 28 they show a +5.0V input power source and mention “The typical output of the power supply is about 3.7 V and the rated load current is 5.0 A.” That would be 18.5W. MCUZone does sell 12V 2A power supplies with this board; that would be 24W. I don’t know what the USB power situation is like. If it’s at the max of 3A, then it would be 15W. If it is at the max of the USB charger I have (1.5A), it is 7.5W.

Thus it is certain I am under-powering my MCUZone MR5210P. That could be the true cause of all my problems with it.

I need to figure out how the power supply inside the MCUZone box works (it obviously steps down the input voltage to 3.8V as marked on the PCB, but we don’t know the efficiency). The box is sold as PoE-capable (doesn’t say which PoE standard). It might be that the MCUZone board’s power circuit favors a particular input voltage (probably 5.0V if I had to guess) and/or doesn’t feed enough current to the modem.

I took a look at the circuitry on the PCB and could only tell that there is a PoE daughterboard (not what PoE standard it supports). The 5V-12V barrel jack circuitry did not have an obvious linear voltage regulator that I could simply look up. The USB C port was connected through a chip with these markings L162 S813 037. I could not find that online.

At this time I have to assume that MCUZone knows what they’re doing and that the 12V 2A (24W) power supply they sell is correct and does provide the 11.1W to 18.5W the modem wants. I went with a 12V 3A (36W) power supply to overkill it by double.

So far in this quest:

a) fixed the APN issue
b) will fix the cheap antennae issue tomorrow
c) will fix the under-powered power supply issue in a week when the new 12V 3A power supply arrives
d) are there any other issues that might rear their ugly heads?

It’s probably best to raise issues as they come up, rather than go looking in advance.

That’s especially the case for me with my failing memory at 76. I often need prompting to recall things.

Good point, but if it looks like there will be too many more problems to solve, I will abandon this project and try a totally different path (probably going with a completely-assembled off-the-shelf option).

Things are looking good so far, though, just by switching from USB power to 12V 1A (though 1A is still too low).

Also, a note for other readers. The rework.network box that iamromulan is using and that I was going to buy says this in the description: “can provide max 10W for 5G modem”

10W is too low according to Quectel’s Hardware Design guide, which says that 3.7V at 3.0A = 11.1W is the minimum continuous power draw needed. I won’t be buying that box after all.

Though this box and MCUZone are not affiliated, it makes me wonder if the MCUZone box also supplies too little power to the modem regardless of input power. I need to email MCUZone and ask all these questions about their power circuitry specs.