Action disabled: source
language:

Ai-Thinker Technology

GSM/GPRS operation example



GSM/GPRS operation example

Note: The operation example on this page uses the serial port assistant for development demonstration.

Please look carefully at the list on the right, press the module to find the function you need

Update history

Release Notes:

 
  March 26, 2018:
  Firmware version: A9/A9_gV02.00.20180327RC
  Add to:
      1. A9G GPS low power consumption mode
      2. A9/A9G HTTP and MQTT functions
      3. A9/A9G module serial port low power consumption and GPIO low power consumption
  optimization:
      1. A9/A9G AT+RST command is optimized
      2. A9/A9G AT+LOCATION command is optimized
              

A9/A9G(GPRS)

Module soft reset and shutdown

AT+RST=X X=1 means soft restart, X=2 means shutdown Example AT+RST=1 Software restart Init… +CREG: 2 +CTZV: 18/03/30, 06:59:43, +08 +CREG: 1 +CTZV: 18/03/30, 06:59:44, +08 OK A9/A9G V02.00.20180327RC Ai_Thinker_Co.LTD READY

Example 2: AT+RST=2 Run this command and the module will enter the off state, provided that the power supply of the module is VBAT3.5V~4.2V ===== Phone reception ===== Related instructions ATDxxxxx;xxx is the phone number Example Call ATD10086 OK +CIEV: “CALL”,1 +CIEV: “SOUNDER”,1 Bell +CIEV: “SOUNDER”,0 Hang up +CIEV: “CALL”,0 BUSY Display BUSY Receive a short message (If you want to use the call reminder function, please use AT+CLIP=1; note that this function must require your SIM card to bring the call reminder function) RING RING ===== SMS settings ===== Related instructions AT+CPMS=“SM”,“SM”,“SM” Set the SMS storage unit AT+CMGF=0/1 Set the message format, 1 is text format to read, 0 is pud format to read AT+CMGR=x Read the message content, x is the first few messages AT+CMGL=4/“ALL” View the list of short messages Read parameter 4 in PUD format, send AT+CMGL=“ALL” in txt format AT+CMGD=1 Delete SMS. If AT+CMGD=1,4 ​​is used to delete all SMS Example To AT+CPMS=“SM”,“SM”,“SM” Set the SMS storage unit, and you can also check the SMS capacity +CPMS: 0,50,0,50,0,50 OK To AT+CMGF=1 Set to TXT format to read OK

+CIEV: “MESSAGE”,1 SMS received, including phone number, time and content +CMT: “+86xxxxxxxxxxx”,,“2017/10/09,09:14:52+08” 111 +CIEV: “MESSAGE”,1 +CMT: “+86xxxxxxxxxxx”,,“2017/10/09,09:16:25+08” 222 AT+CMGF=0 Set to PUD format to accept OK To +CIEV: “MESSAGE”,1 Receive SMS with PUD, the content includes phone number, time and content +CMT: ,23 0891683110602305F0240D91687186935218F500007101909061452303B3D90C To +CIEV: “MESSAGE”,1 +CMT: ,23 0891683110602305F0240D91687186935218F500007101909071202303341A0D AT+CMGL=4 List all SMS → pud format, use this command with parameter 4 +CMGL: 1,1,,23 0891683110602305F0240D91687186935218F500007101909041252303B1580C +CMGL: 2,1,,23 0891683110602305F0240D91687186935218F50000710190906152230332990C +CMGL: 3,1,,23 0891683110602305F0240D91687186935218F500007101909061452303B3D90C +CMGL: 4,1,,23 0891683110602305F0240D91687186935218F500007101909071202303341A0D OK

AT+CMGF=1 Set to TXT format to read OK AT+CMGL=“ALL” List all short messages → txt format, use this command parameter as ALL +CMGL: 1,“REC READ”,“+86xxxxxxxxxxx”,,“2017/10/09,09:14:52+08” 111 +CMGL: 2,“REC READ”,“+86xxxxxxxxxxx”,,“2017/10/09,09:16:25+08” 222 +CMGL: 3,“REC READ”,“+86xxxxxxxxxxx”,,“2017/10/09,09:16:54+08” 333 +CMGL: 4,“REC READ”,“+86xxxxxxxxxxx”,,“2017/10/09,09:17:02+08” 444 OK

AT+CMGR=1 Read the first SMS +CMGR: “REC READ”,“+86xxxxxxxxxxx”,,“2017/10/09,09:14:52+08” 111 OK AT+CMGR=2 Read the second message +CMGR: “REC READ”,“+86xxxxxxxxxxx”,,“2017/10/09,09:16:25+08” 222 OK

AT+CMGR=3 Read the third message +CMGR: “REC READ”,“+86xxxxxxxxxxx”,,“2017/10/09,09:16:54+08” 333 AT+CMGD=1 Delete the first SMS OK

AT+CMGD=2 Delete the second message. Remember that after deleting the first message, the content of the second message will not automatically go to the first message, but still occupy the second message, but when all messages are deleted, After receiving the SMS, it will be automatically arranged to the position of the first message OK AT+CMGD=3 Delete the third SMS OK

AT+CPMS=“SM”,“SM”,“SM” Check the SMS capacity +CPMS: 1,50,1,50,1,50 OK AT+CMGL=“ALL” After deleting 3 messages, check the message list, only 1 message remains +CMGL: 4,“REC READ”,“+86xxxxxxxxxxx”,,“2017/10/09,09:17:02+08” 444 OK

AT+CMGD=1,4 ​​Delete all SMS OK send messages AT+CMGF=1 Send in text mode AT+CMGS=“xxxxxxxxxxx(telephone number)” Return>, then enter the content of the txt to be sent, send the data, and then cancel the “send new line” option, check the “HEX (hexadecimal sending)” option, Finally, send 0x1a. Send SMS in Chinese In addition, you can use PUD encoding to send information: AT+CMGS=XX The number of bytes to be sent

xxxxxxxxxxxxxxxxxxxxx PUD code (the final operation method is similar to the txt operation method) +CMGS: 0 OK ===== Base station positioning (including simplified instructions) ===== Related instructions AT+CREG? Query the registration status of the network

At+LOCATION=X (simplified version) Note that before using the base station positioning function, you must first AT+CGATT=1; AT+CGDCONT=1,“IP”,“cmnet”;AT+CGACT=1,1; the three commands can be executed after the network is attached and activated. Example Pre-optimization instructions → AT+CREG=1 =1 is to query the network status, the default value is 1 when the module is powered on OK AT+CREG? +CREG: 1,1 AT+CREG=2 =2 is the base station positioning OK AT+CREG? +CREG: 2,1,“xxxx”,“xxxx”,2 The intermediate parameter is hexadecimal, the first string is LAC, and the second string is CI Base station location can be inquired on this website: http://www.gpsspg.com/bs.htm Simplified version command → use AT+LOCATION=1 alone, no need to set AT+CREG=2, AT+LOCATION=1(return:<latitude>,<longitude>OK) xx.xxxxx, xxx.xxxxxx (fixed to 6 digits after the decimal point) OK Return latitude and longitude directly without conversion The command →at+location needs to be connected to the Internet to obtain geographic location information, so the length of time depends on the quality of the network, and if there is no manual attachment and activation before use, it will automatically do these two things. It will take longer. If you want to be reliable and fast, it is recommended to use at+cgatt=1; at+cgdcont=1,“IP”,“cmnet”;at+cgact=1,1; Attach activation and ensure the ability to connect to the Internet ===== Get the time issued by the base station ===== Related command AT+CCLK? Instruction Interpretation The instruction is processed internally. When the module is initialized, after the module obtains the time issued by the base station, the time is stored in the RTC register of the chip, and the time can be read by using AT+CCLK?. Note that there is a problem with the time obtained with a Unicom card. Example AT+CCLK? +CCLK: “17/10/07,02:50:55+08” The time is zero time zone time, at 2:50:55 on October 7, 2017. +08 is the time zone, we are here in Dongba District, so the local time is 10:50:55 OK

HTTP

Related instructions: AT+HTTPGET=<url> Uniform resource identifier, which can be a domain name or IP address AT+HTTPPOST=<url>,<content_type>,<body_content> <content_type>: network file type and web page encoding content type <body_content>: body text Example AT+CGATT=1 Attach to the network, if you need to go online, this command is required +CGATT:1 OK

AT+CGDCONT=1,“IP”,“CMNET” Set PDP parameters OK AT+CGACT=1,1 Activate PDP, you can go online after it is activated correctly OK

AT+HTTPGET=“http://wiki.ai-thinker.com/gprs_downloadConnect to the website and request website resources OK The next message received is the response from the server To To ===== MQTT ===== Example: AT+CGATT=1 Attach to the network

 OK
 AT+CGDCONT=1,"IP","CMNET" //Set PDP parameters
 OK
 AT+CGACT=1,1 //Activate the PDP, you can go online after the correct activation
 OK
 AT+MQTTCONN="www.anthinkerwx.com",1883,"12345",120,0,"Ai-thinker","123456" //The client waits and connects to the server, and sends CONNECT at the same time
 OK// Note: (MQTT server needs to be built by yourself)
 AT+MQTTPUB="test","124563",0,0,0 //The client transmits an application message to the server
 +MQTTPUBLISH: 1, test, 6, 124563
 OK
 AT+MQTTSUB="test",1,0 //The client sends a SUB message to the server to create a subscription
 OK
 AT+MQTTDISCONN //The DISCONNECT control message sent by the client to the server indicates that the client is normally disconnected

Transparent transmission mode and heartbeat packet settings

Init…

+CREG: 3 +CIEV: service, 0 +CIEV: roam, 0 +CREG: 3 +CIEV: service, 1 +CIEV: roam, 0 +CREG: 1 +CREG: 0 +CREG: 1 A9 V01.03.20170926R Firmware version information Ai Thinker Co.LTD READY Initialization complete flag The +CIEV: service, 1, etc. in front are network registration information. When the network condition is not good, it will be output after READY, which has no effect. +CIEV: service, 1; +CREG: 1 appears; it indicates that the SIM initialization is successful and the network is normal. If the SIM card is not detected during the initialization process, NO SIM CARD will appear in the initialization message

AT+CCID Query SIM. The serial number is unique and can be used to determine whether the card is normal. If it is an IoT card purchased from Anxin, you can use this serial number to query the phone number on the official website, recharge and pay, etc. +CCID: 898607B1101700823754 OK AT+CREG=1 When =1, it is to query the network status, the default is 1 when the module is powered on AT+CREG? Query network registration status +CREG: 1,5 The first parameter 1 indicates that the network is allowed to be registered; the second parameter 5 indicates that it has been registered and is in a roaming state. If it is 1, it indicates that the local network has been registered, and other parameters indicate abnormality OK

AT+CSQ Query signal strength The first parameter is the signal strength value +CSQ: 31,99 The signal strength is 0-31, the signal strength should be kept above 23 OK

AT+CGATT=1 Attach to the network, if you need to go online, this command is required +CGATT:1 OK AT+CGDCONT=1,“IP”,“CMNET” Set PDP parameters OK

AT+CGACT=1,1 Activate PDP, you can go online after it is activated correctly OK AT+CIPSTART=“TCP”,“122.114.122.174”,46875 Connect to TCP server, CONNECT OK This is Anxin transparent transmission cloud server, please modify the port by yourself OK AT+CIPHCFG? Query the settings of the heartbeat packet +CIPHCFG:0,, The default setting of the heartbeat packet sends the heartbeat packet time interval to 0, and the following is empty OK AT+CIPHCFG=1,“55FAFBEE” Set the content of sending heartbeat packet, the length cannot be less than 3 bytes, hexadecimal format OK

AT+CIPHCFG=2,“55AFBFEE” Set the content of the received response packet, the length cannot be less than 3 bytes, in hexadecimal format OK AT+CIPHCFG=0,15 Set the time for sending heartbeat packets to 15 seconds OK

AT+CIPHCFG? Query the settings of the heartbeat packet +CIPHCFG:15,55FAFBEE,55AFBFEE Set the sending interval to 15 seconds through the above command, the last two parameters of the heartbeat packet and the response packet OK

AT+CIPHMODE=1 Start the heartbeat packet, this command can only be used after connecting to the server successfully OK AT+CIPTCFG? Query the default parameters of transparent transmission +CIPTCFG: 3,200,50,2000 3 means the maximum number of failed attempts to send, 200 is the retransmission delay, in milliseconds, 50 is the length of the packet that triggers the transmission, 2000 is the trigger transmission time, in milliseconds, counted from the input of the last character, and the delay exceeds 2000 milliseconds. The system will also automatically send data OK Please note that the setting of the heartbeat packet is not necessary. If you want to send the heartbeat packet yourself or not, you don't need to set the heartbeat packet commands that come with these modules. In addition, after the sending package of the heartbeat packet is set, it is automatically sent by the module without human control, but the response packet needs to be set by the server to be sent to the module, that is, you need to write code to return data to the module regularly. If the module does not receive the response packet from the server for more than three times, the module will automatically close the heartbeat packet, and the module will receive such data +CIPHMODE:0; OK.

AT+CIPTMODE=1 Start the transparent transmission mode, this command can only be used after connecting to the server successfully OK SEND DATA TO SERVER Data sent to the server SERVER SEND DATA TO DEVICE Received server data +++ Exit the transparent transmission mode, and the previous transmission time is more than 2 seconds, enter +++, you can exit the transparent transmission mode Note that if it is a single-chip microcomputer, do not add carriage return and line feed. If you are using Anxinke's serial debugging tool, please uncheck Send new line OK

AT+CIPHMODE=0 Exit heartbeat packet mode OK ===== Multiple links ===== Example AT+CCID Query CCID value to detect whether SIM is inserted, +CCID: 898602B8191790486325 This ID is unique AT+CREG? Query SIM's network registration status +CREG: 1,5 The first parameter 1 indicates that the network is allowed to be registered; the second parameter 5 indicates that it has been registered and is in a roaming state. If it is 1, it indicates that the local network has been registered, and other parameters indicate abnormality OK AT+CSQ Query signal strength The first parameter is the signal strength value +CSQ: 31,99 The signal strength is 0-31, the signal strength should be kept above 23 OK AT+CSQ Query signal strength The first parameter is the signal strength value CSQ: 31,99 The signal strength is 0-31, the signal strength should be kept above 23 OK AT+CGATT=1 Attach to the network, if you need to go online, this command is required +CGATT:1 OK

AT+CGDCONT=1,“IP”,“CMNET” /Set PDP parameters OK

AT+CGACT=1,1 Activate the PDP, you can go online after the correct activation OK AT+CIPSTATUS? Query ip connection status, there are 8 channels in total, and it actually supports up to 4 tcpip connections at the same time +CIPSTATUS: 0,IP GPRSACT 1, IP INITIAL 2, IP INITIAL 3. IP INITIAL 4. IP INITIAL 5. IP INITIAL 6, IP INITIAL 7, IP INITIAL OK To AT+CIPSTART=“TCP”,“122.114.122.174”,36779 Connect to TCP server, users please modify their own server CONNECT OK OK To AT+CIPSEND=5,“qwert” Send 5 bytes of characters, note that this method only supports visible characters OK

AT+CIPSEND=5 Send 5 bytes of data, this method can send any binary data 12345 OK AT+CIPSENDSend characters, ending with CTRL+Z (0x1a in hexadecimal) qwert OK

+CIPRCV:21,Server Send Data Test Receive the data sent by the server, the content can also be binary arbitrary data To AT+CIPSTATUS? Query link status +CIPSTATUS: 0,CONNECT OK 1, IP INITIAL 2, IP INITIAL 3. IP INITIAL 4. IP INITIAL 5. IP INITIAL 6, IP INITIAL 7, IP INITIAL OK

AT+CIPCLOSE Close the link OK AT+CIPMUX? /Query whether to open multiple connections +CIPMUX:0 OK To AT+CIPMUX=1 Enable multiple links OK To AT+CIPSTART=“TCP”,“122.114.122.174”,36779 Initiate the first TCP connection +CIPNUM:0 Only when you click to open multiple links, 1 is the returned link number CONNECT OK OK

AT+CIPSTART=“TCP”,“www.baidu.com”,80 Initiate the second connection +CIPNUM:1 Only when you click to open multiple links, 1 is the returned link number CONNECT OK OK

AT+CIPSTART=“TCP”,“www.hao123.com”,80 Initiate the third connection +CIPNUM:2 Only when you click to open multiple links, 2 is the returned link number CONNECT OK OK

AT+CIPSTATUS +CIPSTATUS: 0,CONNECT OK 1,CONNECT OK 2,CONNECT OK 3. IP INITIAL 4. IP INITIAL 5. IP INITIAL 6, IP INITIAL 7, IP INITIAL OK

AT+CIPCLOSE=3 Close the connection with link number 3 +CME ERROR:50 Link 3 is not actually created

AT+CIPCLOSE=2 Close the connection with link number 2 OK AT+CIPCLOSE=1 Close the connection with link number 1 OK

AT+CIPSTATUS +CIPSTATUS: Only link 0 is left, the other two are closed 0,CONNECT OK 1,IP CLOSE 2,IP CLOSE 3. IP INITIAL 4. IP INITIAL 5. IP INITIAL 6, IP INITIAL 7, IP INITIAL OK To AT+CIPSTART=“TCP”,“www.baidu.com”,80 +CIPNUM:1 CONNECT OK OK To AT+CIPSTART=“TCP”,“www.hao123.com”,80 +CIPNUM:2 CONNECT OK OK To AT+CIPSTART=“UDP”,“121.41.97.28”,60006 +CIPNUM:3 UDP BIND OK OK To AT+CIPSTATUS? +CIPSTATUS: You can see that the 0-3 link numbers are all occupied, and 4 IP connections are established 0,CONNECT OK 1,CONNECT OK 2,CONNECT OK 3. SOCKET OK 4. IP INITIAL 5. IP INITIAL 6, IP INITIAL 7, IP INITIAL OK

AT+CIPSEND=0,5,“qwert”Link 0 sends 5 bytes of characters, “qwert”, this command only supports visible characters OK ===== A9/A9G uses Anxinke WeChat official account and A9Tracker_app to obtain positioning information ===== Related instructions AT+GIZQRCODE Get the QR code string to make the QR code scan code binding, or manually enter the string directly on WeChat to bind AT+GIZTRACKER=1,0,10,1 Connect to server http://wiki.ai-thinker.com/gprs/a9g/a9tracker APP docking tutorial http://wiki.ai-thinker.com/gprs/a9g/MP WeChat docking tutorial Instruction analysis AT+GIZTRACKER=< on/off >,[server],[upload interval],[use LBS],[pk],[ps] n/off value: 0/1. When this parameter is 0, it is closed, and set to 1 for automatic upload serve Select the server: 0 is the Anxinke server; 1 is the custom server (PK and PS parameters must be attached to the first use. After the connection is successful, these two parameters will be saved) up in the time interval of uploading data (s), the default value is 0 (not uploading) Use LBS value: 0/1; set 1 to obtain positioning information from LBS; set 0 to obtain positioning information from GPS. When the GPS signal is weak, you can choose to obtain information from LBS (A9 can only obtain information from LBS). The default value is 0. The key and secret of the pk ps product. These are used when creating the product by yourself. For details, see 9/A9G 10-minute docking with Gizwits Cloud to create your own product: http://www.jianshu.com/p/e3d86a263be5 Example AT+GIZQRCODE +GIZQRCODE:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxa long string

AT+GIZTRACKER=1,0,10,1 —>Parameter 3 is the time interval for uploading positioning information, and parameter 4 is to choose whether to use base station positioning function or GPS function to upload positioning information 1→LBS,0→GPS +GIZTRACKER:Start —>Return value OK +GIZWITS:sign in end +GIZWITS:conn end —>Connect to the server successfully OK

Note: This command will be saved automatically, and it will run automatically to connect to the server after booting. If you need to stop running, use At+GIZTRACKER=0;

A9/A9G 10-minute docking with Gizwits to create your own product tutorial

Function interpretation The realization of this function requires the customer to first apply for a developer account on the Gizwits official website, create a product, and obtain the Product Key and Product Secret of the product. Then, for the common reported data point types, send the data in the following way to upload to Gizwits Cloud Server.

A9G(GPS)

===== GPS (simplified version) ===== related commands AT+LOCATION=X Example At+LOCATION=0(return:<latitude>,<longitude>OK) xx.xxxxx, xxx.xxxxxx (fixed to 6 digits after the decimal point) OK

GPS positioning

Related instructions AT+GPS=1, turn on GPS AT+GPS=0, turn off GPS AT+GPS?, query GPS status AT+GPSRD=N, N is a number, it means output a NEMA message from AT serial port in N seconds. AT+LOCATION=X X=1 is the address of the base station, X=2 is the address of the GPS To Note that after the GPS is turned on, the GPS_TXD of the module will output positioning information by default at a baud rate of 9600. This does not affect the baud rate of the entire module. For example, the working baud rate of the A9G module is 115200, and the AT command is sent to turn on the GPS. At this time, GPS_TXD will output information at 9600 baud rate, and the AT serial port is still 115200. To In addition, please note that the positioning information will output GNGGA GNRMC instead of GPGGA and GPRMC. The module uses a hybrid positioning system, including GPS, BDS and GNNS (Global Navigation System). Explain the composition of the output information header, for example, GPGGA, split into GP+GGA→ positioning system + output data type, GP is the GPS positioning system, GGA is the output information of time, position, and number of satellites, similarly GNGGA is GN +GGA→Positioning system + output data type, GN is the global navigation system, GGA is the output information of time, position, and number of satellites, other instructions please follow this order. Finally, the module defaults to GPS+BDS mixed mode output, then the output information is the data at the beginning of GN, if it is set to single mode, it is the data output at the beginning of the mode, for example, if it is set to GPS mode, the output information is GPGGA. Example AT+GPS=1 Enable GPS function OK To AT+GPSRD=N Output a NEMA message in N seconds from AT serial port +GPSRD: $GNGGA,000840.261,2236.3719,N,11350.4081,E,0,0,,153.2,M,-3.2,M,,*4F $GPGSA,A,1,,,,,,,,,,,,,,,,*1E $BDGSA,A,1,,,,,,,,,,,,,,,,*0F $GPGSV,1,1,00*79 $BDGSV,1,1,00*68 $GNRMC,000840.261,V,2236.3719,N,11350.4081,E,0.000,0.00,060180,,,N*5C $GNVTG,0.00,T,,M,0.000,N,0.000,K,N*2C To AT+LOCATION = 2 Get GPS address information, the premise is that GPS can see the satellites before returning, otherwise it will return GPS NOT FIX NOW To To

GPS extended commands

Related instructions AT+GPSMD=1 GPS mode (standalone BD mode is not supported temporarily, bd system only covers Asia temporarily) AT+GPSMD=2 GPS+BD mode The module defaults to GPS+BDS mixed mode output, then the output information is the data at the beginning of GN, if it is set to single mode, it is the data output at the beginning of the mode, for example, if it is set to GPS mode, the output information is GPGGA.

Example AT+GPS=1 Turn on GPS first AT+GPSMD=x x=1 or 2, choose which mode to turn on, the default is GPS+BDS mode At+GPSRD=x Number x means x seconds, output a NEMA message from AT serial port

GPS low-power mode

Related instructions AT+GPSLP=x GPS low power settings, the value of x is 0, 1, 2 AT+GPSLP=0 Normal mode —- The current value is tested around 0.063A AT+GPSLP=1 Serial port low power consumption mode AT+GPSLP=2 GPS low power consumption mode —- The current value is tested at about 0.034A The default default mode of the module GPS is the normal mode. When the GPS mode is set, it will not take effect immediately, and it will take a while to take effect. Example: AT+GPS=1 Enable GPS AT+GPSRD=10 output a NEMA message in 10 seconds AT+GPSLP=2 Set GPS mode to low power consumption mode

AGPS

Related instructions AT+AGPS=1, turn on AGPS and turn on GPS at the same time, turn off GPS function first. AT+AGPS=0, turn off AGPS, AT+AGPS?, query the status of AGPS AT+GPSRD=N, N is a number, it means output a NEMA message from AT serial port in N seconds.

Note that AGPS is an assisted positioning function that speeds up the GPS positioning time. It is recommended to attach and activate the network before using it. Therefore, you must first use the command to attach and activate the network. Note that after turning on the GPS, the module's GPRS_RXD (because the GPS chip is connected to the gprs module for communication, so the module's GPRS_RXD is actually the TXD pin of the gps chip) will output positioning by default at a baud rate of 9600 Information, this does not affect the baud rate of the entire module. For example, the working baud rate of the A9G module is 115200. Send an AT command to turn on the GPS. At this time, GPRS_TXD will output information at a baud rate of 9600, while the AT serial port is still 115200. Example: AT+CGATT=1 Attach to the network, if you need to go online, this command is required +CGATT:1 OK AT+CGDCONT=1,“IP”,“CMNET” Set PDP parameters OK

AT+CGACT=1,1 Activate the PDP, you can go online after the correct activation OK AT+GPS=0 OK To AT+AGPS=1 +AGPS:GPD OK +AGPS:OK OK To AT+GPSRD=N OK +GPSRD: $GNGGA,050041.129,2236.1052,N,11350.2770,E,0,0,,3.2,M,-3.2,M,,*4D $GPGSA,A,1,,,,,,,,,,,,,,,,*1E $BDGSA,A,1,,,,,,,,,,,,,,,,*0F $GPGSV,4,1,14,05,59,296,,02,53,008,,06,37,068,,19,35,142,*74 $GPGSV,4,2,14,13,32,180,,12,28,252,,20,20,255,,25,15,288,*7F $GPGSV,4,3,14,17,14,145,,29,11,323,,09,10,040,,15,08,205,*76 $GPGSV,4,4,14,30,03,112,,193,,,*75 $BDGSV,1,1,00*68 ===== GPS indicator status ===== Related instructions AT+GPNT=x Set the status of GPS indicator, x=0 or x=1; AT+GPNT=0 GPS light is flashing AT+GPNT=1 GPS light is in level state

Example AT+GPNT=? Query the value of x +GPNT: (0:led flash,1:led notice) OK AT+GPNT=0 Set the status of GPS light OK

Set the low power consumption mode of the module

Related instructions:

AT+SLEEP=x Set the low power consumption mode of the module, the value of x is 0,1,2 respectively AT+SLEEP=0 Turn off low power consumption mode — The current value into low power consumption is 00.213A AT+SLEEP=1 Enter GPIO low power consumption mode, pull GPIO25 pin low to enter module low power consumption, pull high pin to exit low power consumption, GPIO25 defaults to high level AT+SLEEP=2 Serial port low power consumption mode, you can wake up through the serial port —- there is another problem

 Note: Enter the serial port low power consumption mode, in which the serial port can receive and send data, and the module will normally switch between low power consumption and normal mode.
       Enter the low power consumption mode of the GPIO port and receive data. SMS, the phone will not be woken up, need to control the pin to pull high, exit low power consumption mode
       GPIO26 is used to notify GPIO in low-power mode (if you enter GPIO low-power mode, connect the GPIO26 pin with an oscilloscope to detect the level of the GPIO26 pin to determine whether data is received)
       

Example 1 (GPIO low power consumption)

AT+SLEEP=1 GPIO low power consumption mode OK After sending the command successfully, connect the GPIO25 pin to the GND pin, and then continue to send the AT command without any effect:

Example 2 (Serial port low power consumption)

AT+SLEEP=2 //Serial port low power consumption mode
OK
//When entering the serial port with low power consumption, the current consumed by the module will be reduced, but data can still be sent
AT
OK
//When the module sends data, it will automatically exit low power consumption, and the current consumption will increase again

Tutorial: http://www.jianshu.com/p/e3d86a263be5