Pico LTE troubleshooting

Debug mode, AT commands, slow connections, network registration, GPS fix, example application errors and CME error codes of the Pico LTE and its SDK.

Debug output, AT commands, network registration, application errors and error codes of the Pico LTE and the Pico LTE SDK.

Turn on debug mode

With debug mode on, the SDK prints detailed output while your program runs:

from pico_lte.common import debug

debug.set_level(0)

Send AT commands

AT commands read the state of the LTE module. Send one from your program:

from pico_lte.utils.atcom import ATCom

# Instantiate the ATCom object
atcom = ATCom()

# Send the AT command to the module
at_command = "AT+CSQ"
response = atcom.send_at_comm(at_command)

# Print the response of the module
print(response)

To put a " in a command, write the string between single quotes, or escape the quote with a backslash:

at_command = 'AT+QIOPEN=0,0,"TCP","000.000.000.000",0,0,0'
at_command = "AT+QIOPEN=0,0,\"UDP SERVICE\",\"000.000.000.000\",0,0,0"

The parameters of send_at_comm(); only command is required:

ParameterTypeUse
commandstrThe AT command. Positional: send_at_comm("AT").
desiredstr or list, default NonePhrases that mean success: if one is in the response, the function returns SUCCESS.
faultstr or list, default NonePhrases that mean failure: if one is in the response, the function returns ERROR. For example send_at_comm("AT+CREG?", desired=["+CREG: 0,1", "+CREG: 0,5"], fault="+CREG: 0,2").
timeoutint, default 5Seconds to wait for the response.
line_endbool, default TrueAppends \r to the command.
urcbool, default FalseReceives unsolicited result codes (URCs), messages that do not answer a command. Needed for AT+QHTTPPOST, AT+QHTTPGET, AT+QHTTPPUT, AT+QHTTPREAD and AT+QHTTPURL, and to send request headers and bodies without AT commands.

{'response': 'timeout', 'status': 2} means the LTE module is off: press the PWRKEY button to turn it on. The status LED starts blinking.

Useful commands:

CommandUseExample
AT+CMEETurns extended error reporting on or off: detailed error codes.AT+CMEE=1
AT+CREGThe network registration status.AT+CREG?
AT+CSQThe signal quality and the received signal strength (RSSI).AT+CSQ
AT+QNWINFOThe registered network, such as its MCC (mobile country code) and MNC (mobile network code).AT+QNWINFO
AT+CGACTActivates or deactivates a PDP context for data.AT+CGACT=1,1
AT+CGATTAttaches the module to, or detaches it from, the packet data service.AT+CGATT=1
AT+COPSSelects the operator, automatically or manually.AT+COPS=0 (automatic)
AT+CGPADDRThe IP address of a PDP context.AT+CGPADDR=1

All commands: the AT commands manual in the module documents.

The connection takes long

The BG95-M3 connects over LTE-M (eMTC) and GSM; NB-IoT is disabled. By default it scans eMTC, then NB-IoT, then GSM: where eMTC is not available, it falls back to GSM, which can take long. Set the scan sequence to shorten it; the setting is saved in the module, so it is needed once:

from pico_lte.utils.atcom import ATCom
from pico_lte.modules.base import Base

atcom = ATCom()
base = Base(atcom)

"""
Scan sequence (default 00):
* 00 --> Automatic (eMTC, NB-IoT, GSM)
* 01 --> GSM first
* 02 --> eMTC first
"""
response = base.config_network_scan_sequence("01")

print(response)

The board does not register on the network

+CREG: 0,2, from your program or AT+CREG?, means the board is not registered:

  • The first registration can take longer, up to 5 minutes.
  • In Sixfab Connect, check that the asset is Active and that the account balance is sufficient.

The GPS fix takes long

A fix usually takes a few minutes, depending on the antenna and the position of the board; under open sky it is much faster.

Example applications

The examples list their own errors and fixes:

CME error codes

+CME ERROR: <err> reports an error of the module or the network. Like ERROR, it stops the rest of the command line. AT+CMEE sets the format of <err>, numeric or verbose. Common codes:

CodeMeaning
3Operation not allowed
4Operation not supported
30No network service
31Network timeout
103Memory full, cannot store entry
106Undefined error
107Unsupported operation
111Invalid text string length
160SIM not ready after reset
171SIM busy
172SIM wrong
193SIM not ready
194SIM not ready after reset
300ME failure
302Operation not allowed
303Operation not supported
304Invalid PDU mode
305Invalid text mode
310(U)SIM not inserted
313(U)SIM failure
314(U)SIM busy
315(U)SIM wrong
320Memory failure
331No network
332Network timeout
382Phone failure
500Unknown
512(U)SIM not ready
513SIM busy
517Invalid service mode
703HTTP(S) busy
705HTTP(S) no GET/POST/PUT requests
706HTTP(S) network busy
710HTTP(S) network error
711HTTP(S) URL error
714HTTP(S) DNS error

The BG95 has more codes: see the AT commands manual in the module documents.

The Pico does not respond

If no other way reaches the Pico, erase its flash: copy the flash reset UF2 file from the Raspberry Pi documentation to the Pico in BOOTSEL mode. It deletes every file, MicroPython included: install MicroPython and the SDK again.