FW AT command sequence and steps
Step1 : Run Group 1 - Initialize
Step2 : Run Group 2 - Waiting network registration
Step3 : Run Group 3 - Enable Internet
Step4 : A stress test loop for each secend period
-
Sec 1~9, run Sub-routine 4A: Do every 1sec to monitor network status
-
Sec 10, run Sub-routine 4B: TCP socket write, every 10sec
-
Sec 11~19, run Sub-routine 4A: Do every 1sec to monitor network status
-
Sec 20, run Sub-routine 4B: TCP socket write, every 10sec
-
Sec 21~29, run Sub-routine 4A: Do every 1sec to monitor network status
-
Sec 30, run Sub-routine 4B: TCP socket write, every 10sec
-
After then, run Sub-routine 4C: Switch to GNSS mode, obtain GPS location info and then return to WWAN mode, every 30sec.
ISSUE 1: ** in 4A step, HIGH CHANCE got long response time after a small while stress loop test, in spec sheet the Max Response Time is 300 ms
ISSUE 2: ** in 4C step, HIGH CHANCE STUCK HERE BECAUSE the “+GPS: xxx” URC not output accodringly, once happend no put, then always no “+GPS: xxx” URC output
In the spec, AT+QGPSLOC=4,2 should always report URC no matter GPS fixed or not.
Condition: LPWA BG77 module
- Power
→ Checked, no obvious power voltage drop issue, minimum VBAT > 4.8V - ATI
→ Quectel
→ BG77
→ Revision: BG77LAR02A04 - → BG77LAR02A04_01.201.01.201
-
Group 1 - Initialize
ATI
→ Quectel
→ BG77
→ Revision: BG77LAR02A04→ BG77LAR02A04_01.201.01.201
AT+CPSMS=0
AT+CGDCONT=1,“IP”,“internet.iot”
AT+QICSGP=1,1,“internet.iot”,“”,“”,1
AT+QGPSCFG=“XTRA_APN”,0,“internet.iot”
AT+CFUN=1,0
AT+QCFG=“NWSCANSEQ”,0302
AT+QCFG=“IOTOPMODE”,2,1
AT+QGPSCFG=“PRIORITY”,1 // Default: WWAN>GNSS
AT+QGPSCFG=“GNSSCONFIG”,2
AT+QGPSCFG=“XTRA_AUTODOWNLOAD”,1
AT+QGPSLOC=4,2 -
Group 2 - Waiting network registration
AT+CEREG=0
AT+CEREG? // - loop here until “+CEREG: 0,1” or “+CEREG: 0,5”, check every 1sec
AT+QNWINFO
AT+COPS=0
AT+CSQ // - loop here until escape “+CSQ: 99,99”, check every 1sec -
Group 3 - Enable Internet
AT+QIACT=1
AT+QIACT? -
Group 4 - Big Loop
4A. Sub-routine 4A: Do every 1sec to monitor network status
AT+CSQ //** // Here comes ISSUE1: HIGH CHANCE got long response time after a small while stress loop test, in spec sheet the Max Response Time is 300 ms //** AT+CEREG? AT+QENG="SERVINGCELL" AT+QIACT?
4B. Sub-routine 4B: TCP socket write, every 10sec
AT+QIACT=1 AT+QIACT? AT+QIOPEN=1,0,"TCP","aaa.bbb.ccc",88,0,0 if (got "+QIOPEN: xxxxxx" and is valid) { AT+QISTATE if (got "+QISTATE: xxxxxx" and status is 2(CONNECTED)) { AT+QISEND=0 > <data.data.data>\x1A if (got "+QIURC: "recv"") { AT+QIRD=0,200 // Read first 200 bytes AT+QIRD=0,200 // Read remain ~150 bytes } } AT+QICLOSE=0 }
4C. Sub-routine 4C: Switch to GNSS mode, obtain GPS location info and then return to WWAN mode, every 30sec.
AT+QGPSCFG="PRIORITY",0 // 1: WWAN>GNSS, 2:GNSS>WWAN AT+QIACT? AT+QGPSCFG="xtra_info" AT+QGPSXTRATIME? AT+QGPSXTRADATA? AT+QGPSLOC=4,2 // Sometimes didn't receive "+QGPS: , , , , , , , , , ," so sending this command to ensure output right things. AT+QGPS? if (got "+QGPS: 0" then enable GPS) { AT+QGPS=1 // Enable GPS // Wait 3sec } // *** // Wait "+QGPS: , , , , , , , , , ," or "+QGPS: xxxxxxxxxx" output - loop here with 60s timeout here to give enough time to get GPS signal and GPSLOC/NMEA output. // *** // Here comes ISSUE2: HIGH CHANCE STUCK HERE BECAUSE the "+GPS: xxx" URC not output accodringly, once happend no put, then always no "+GPS: xxx" URC output // In the spec, AT+QGPSLOC=4,2 should always report URC no matter GPS fixed or not. // *** if (Got GPS FIXED) // Extract GPS NMEA info { AT+QGPSGNMEA="GSV" AT+QGPSGNMEA="RMC" AT+QGPSGNMEA="GGA" } AT+QGPSEND // Disable GPS AT+QGPSCFG="PRIORITY",1 // Switch to 1: WWAN>GNSS