This is the API V2 documentation. To switch out of beta revert back to our API V1.

Open SidemenuDocs
Docs
Close Sidemenu

AT Commandsat-commands

This document contains some useful AT commands to interact with Raspberry Pi HAT cellular modules.

Prerequisites:prerequisites-

  1. 1Make sure the raspberry Pi is up-to-date and the serial port is enabled. To enable the serial port run this command and then follow the prompts as shown:
  • sudo raspi-config
  • Choose Interfacing Options (5):
    wireless_7600_b
  • Choose P6 Serial:
    wireless_7600_c
  • Press No to the prompt below then Reboot.
    wireless_7600_d
  1. 2The package, screen, should be installed by default on your Linux distro. If not, you can install it via, sudo apt or sudo yum install screen. You may also use minicom if you want additional customization. screen defaults to ttyS0 unless otherwise specified.

Now that you know how to run AT commands on your device, here are some common commands that you can use.

CommandsWhat does it do?Sample Reponses
ATSame thing as "Hey!" in real life. This is used to check if you are able to communicate with the device.OK
AT+COPS=?To see all available carriers. This command will also filter out carriers that are not compatible with the SIM card.0, 1, "T-Mobile" or 0, 4, "AT&T"
AT+COPS = (#, #)Check the current network. Obtain two #'s from the above command. For example, if you want to connect to T-Mobile, you would do AT+COPS=(0,1)."T-Mobile" or "AT&T"
AT+CCIDCheck the SIM ID IMEI NUMBEROK
AT+CREG?Network Registration Status. You can run the AT+CREG=? for available flags.(#, "Current Network Name", PLMN #)OK
AT+COPS=?List of available networks. This response is valuable to switch carriers.(4, "Network Name", PLMN #), (2, "Network Name 2", PLMN #2) ...
AT+COPS = 1, 0 "Carrier Name"Manually connect to a network. This is also known as PLMN selection.If all went well, you should get an OK response. If there is an error, it will reply back with CME ERROR. The error usually occurs if your provider's SIM does not support the carrier you are connecting to. Please check with your wireless provider on the list of providers that is supported in your area.
AT+BANDSManually select a cellular band. This shouldn't be used often unless you are having issues with network congestion. The numbers seen in the sample result is different for every device.OK 0100004000 B12 045000000 B5

Issuesissues

Raspberry Pi 4 has intermittent issues recognizing which USB port to use for serial communication. Even if you specify ttyUSB3 or ttyS0, the Pi often thinks that there is a separate serial port located on the device. In order to fix this issue, we recommend using a bluetooth keyboard and mouse - this will mitigate the confusion the Pi goes through.

Was this page helpful?was-this-page-helpful