Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the AT command to reset USB cellular modem?

What is the AT command sequence used to reset a USB cellular modem?

Is there a single AT command that can be used? Or does it require a sequence of several in order to reset a USB cellular modem?

I have a Huawei E272 and E220 however I am also interested in a general command sequence if there is any standard AT command.

like image 727
Lin Avatar asked Feb 17 '15 11:02

Lin


3 Answers

Resetting the modem is a manufacturer-specific AT command.

There is a spec available online for Huawei AT commands here.

Look at section 3.10 +CFUN

The EXECUTION command is used to set the MS mode or restart the MS

AT+CFUN has 2 parameters:

AT+CFUN=[fun[,rst]] 

These 2 parameters fun and rst are defined as follows:

fun:
0 Set as minimum functionality mode (set the RF off but keep the SIM power on, previous mode must not be offline)
1 Set as online mode (default value) (previous mode must not be offline)
4 Set as offline mode (previous mode must not be FTM)
5 Set as offline FTM (previous mode must be online)
6 Reset MS (previous mode must be offline)
7 Set as RFoff mode (about radio frequency)

rst: Whether to restart MS before setting
0 Not restart MS before setting. (Default)
1 Restart MS before setting. (fun must be 1)

like image 183
user1725145 Avatar answered Oct 19 '22 21:10

user1725145


There seems to be a generally used or defacto standard AT command for turning off and turning on a USB cellular modem.

To turn the modem off use: AT+CFUN=0 and to turn the modem on use: AT+CFUN=1. The AT command must be terminated by a carriage return and it must be sent through the Virtual Serial Port that is assigned to the USB modem.

I used the following procedure to test with a PANTECH UML290 USB cellular modem with Verizon as the carrier.

First step was to determine the Virtual Serial Port in use through which I would send the AT commands. I used the Device Manager application from the Control Panel to find the USB modem and to then see what COM port it was using. screen shot of using Device Manager to see COM port assigned to USB modem

Next I used the HyperTerm application to open a connection to the Virtual Serial Port assigned to the USB modem as shown in Device Manager. The HyperTerm application is an older modem and serial ports application that came with Windows XP and earlier. For Windows 7 and later see HyperTerminal Alternatives for Windows 7.

I then used AT+CFUN=0 to turn off the USB modem. Then I used ipconfig /all to examine the LAN adapters in my system which showed the PANTECH UML290 as "Media disconnected".screen shot of cmd shell window with results of ipconfig /all after using AT+CFUN=0 to turn off USB modem.

I then used AT+CFUN=1 to turn the USB modem back on. I used the ipconfig /all command to display the status of the LAN adapters in my system. After using the command a second time after a few seconds wait, the displayed status showd the PANTECH UMO290 up and running.screen shot of cmd shell window with results of ipconfig /all after using AT+CFUN=1 to turn on USB modem.

For a fuller description of the AT+CFUN=0 command see page 12 of AT Commands GSM Reference Guide from MultiTech Systems which has this to say:

This command selects the mobile station’s level of functionality. When the application wants to stop the product with a power off, or if the application wants to force the product to execute an IMSI DETACH procedure, then it must send: AT+CFUN=0 (equivalent to AT+CPOF). This command executes an IMSI DETACH and makes a backup copy of some internal parameters in SIM and in EEPROM. The SIM card cannot then be accessed. If the mobile equipment is not powered off by the application after this command has been sent, a re-start command (AT+CFUN=1) will have to issued to restart the whole GSM registration process. If the mobile equipment is turned off after this command, then a power on will automatically restart the whole GSM process. The AT+CFUN=1 command restarts the entire GSM stack and GSM functionality: a complete software reset is performed.

This description appears to apply to how this AT command is generally implemented by USB cellular modem providers.

Addendum I: Command Line Utility

I wrote a simple command line utility with Visual Studio C++ that can be used to send a command string to a serial port. The source is located in my Github repository at https://github.com/RichardChambers/writereadport

The utility can be used in a shell or command file and has both a command line interface for a single AT command or a console mode. It is primitive but does the job I needed at the time.

like image 32
Richard Chambers Avatar answered Oct 19 '22 19:10

Richard Chambers


ITU V250 (https://www.itu.int/rec/T-REC-V.250-200307-I/en) specifies ATZ as beeing the reset command:

6.1.1 Reset to default configuration

Syntax Z[< value>] Description

This command instructs the DCE to set all parameters to their factory defaults(...)

If you issue the command ATZ, you should have you modem reset and get an OK. Read the spec for more information about the <values> parameter if needed.

like image 2
mszmurlo Avatar answered Oct 19 '22 20:10

mszmurlo