AT command to identify connection type

16,558

Solution 1

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.

Solution 2

AT+WS46=? returns a number with the mode used

[12 GSM Digital Cellular Systems (GERAN only) 22 UTRAN only 25 3GPP Systems (GERAN, UTRAN and E-UTRAN) 28 E-UTRAN only 29 GERAN and UTRAN 30 GERAN and E-UTRAN 31 UTRAN and E-UTRAN

GERAN is GSM EDGE Radio Acess Network which is the 2G network. UTRAN is Universal Terrestial Radio Access Network represents the 3G network. E-UTRAN (Evolved Universal Terrestial Radio Access Network) is required to support the 4G LTE network]

and AT+WS46? returns what modes are possible

Share:
16,558
AlexS
Author by

AlexS

I'm deputy head of IT department and senior software engineer with experience in high-level Cross-Platform as well as firmware development using the scrum way, clean code, TDD and CI/CD. But on top of that I think it is most important to work conscientiously. I am not a one-track specialist and I am interested in many things reaching from learning theories over handcraftship to engineering. I am enjoying combining knowledge from different areas and transferring ideas from one area to another. My center of life is next to Kaiserslautern in Germany with my family and friends.

Updated on June 19, 2022

Comments

  • AlexS
    AlexS about 2 years

    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)?

    Update

    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?


    Remark

    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.

  • AlexS
    AlexS almost 10 years
    Unfortunately I had to revoke the accept, since it doesn't work for me. (I accepted because I came over the same commands at the same time you wrote the answer and I thought 'OK, he just confirmed what I thought'.) The reason is my modem GTM67xx does not send the AcT-param in the response. Maybe there's another solution.
  • user1725145
    user1725145 almost 10 years
    Try AT_OCTI? The second parameter of the reply is the cell type, and you can set it to unsolicited responses with AT_OCTI=1. Don't know if this modem supports this particular command though.
  • user1725145
    user1725145 almost 10 years
    Also, remember that +CREG applies to circuit switched services, you might need +CGREG to get information on non-LTE packet switched networks (GPRS, HSxPA etc).
  • user1725145
    user1725145 almost 10 years
    There are actually quite a few Option AT commands to do with network type; another is AT_OUWCTI. Search "Option AT commands" on Google, and the first link is a spec from 2012. It could be that the solution turns out to be rather more complicated than the standard 3GPP AT commands.....
  • AlexS
    AlexS almost 10 years
    I tried +CREG as well as +CGREG. I will have a closer look at the option specific commands. Thank you for your patience.
  • scipilot
    scipilot over 4 years
    It's usually the other way around - for all AT commands =? returns the parameter possibilities, and the ? is the "read" command showing the mode currently used.
  • scipilot
    scipilot over 4 years
    Some modems e.g. Telit, support mode AT+CREG=2 or 3 for 4G, which includes the extra AcT information.