I wrote software to identify and control different modems using AT commands.
Everything works fine, but I'd like to know if the modem is working with GPRS, Edge, 3G or LTE.
How can I get this information?
Is it provided by the modem via unsolicited results or do I have to query the information with a specific standard command (or modem dependent command)?
I wanted to have a general solution, but this is not possible as the [AcT]
response to +CREG
and +CGREG
is not returned by my modem (GTM661W), no matter if I am connected or not.
So I played with proprietary commands for the GTM661W and managed to get information about WCDMA
-status (if WCDMA
, WCDMA + HSDPA
, WCDMA + HSUPA
or WCDMA + HSDPA + HSUPA
is used) unsing _OWCTI?
.
I tried the following commands:
_OWCTI?
=> _OWCTI: 4
_OUWCTI?
=> _OUWCTI: 0,4
_OCTI?
=> _OCTI: 0,0
This means now I am able to recognize 3G
and H
connection types, but not G
and E
.
How can I recognize G
, E
, 3G
and H
?
Unfortunately I am not able to test this any more. Therefore I am not able to accept an answer, since I can't evaluate if the solutions are working on various devices of different manufacturers.
In the 3GPP AT command spec, you can find the descriptions of +CREG, +CEREG and +CGREG.
These AT commands give an answer with possible parameters, the 5th of which is AcT, the access technology as follows:
0 GSM 1 GSM Compact
2 UTRAN
3 GSM w/EGPRS
4 UTRAN w/HSDPA
5 UTRAN w/HSUPA
6 UTRAN w/HSDPA and HSUPA
7 E-UTRAN (LTE)
You can set them to return the unsolicited +CREG/+CGREG/+CEREG replies, by sending a set command with single parameter "1", for example:
AT+CREG=1.
AT+CREG applies to circuit switched services, AT+CGREG to packet switched (GPRS), and AT+CEREG to EPS (LTE). The details of which of the above parameters are valid for which command, are given in the spec.