How to ping using AT commands

Checking the data connection after a successful network attachment can help debug issues further. Performing a ping with your modem is an opportune way to test this.

Warning: This article requires knowledge of connecting to your device's cellular module/modem.

In this guide we'll go through how to ping Google's primary DNS server, that is the server with the IP 8.8.8.8, with these modems:

The overall structure for pinging 8.8.8.8 with all the modems is:
  1. Set the APN
  2. Attach to the network

  3. Establish a data connection
  4. Ping 8.8.8.8

There will be some slight variation depending on the manufacturer and or specific modem.

Note: You will most likely be able to use the same approach for each of the manufacturers' other modems, but there might be slight variations, so please consult the documentation, your supplier, or the manufacturer themselves if it does not work.


No matter which modem you are using the result should be the following in the Live Monitor:ping-google

Performing ping from specific modules

Quectel's BG96

  1. Set the APN

    • Issue AT+CGDCONT=1,"IP","onomondo", this defines the PDP context

  2. Attach to the network

    • Check the connection with AT+COPS? – the modem might already have connected when it was booted up, if this isn't the case then do the following:

      • Issue AT+COPS=0, this will make the modem automatically choose a network

    • Wait for AT+CEREG? or AT+CGREG? to return x,5, where x doesn't matter

  3. Establish a data connection

    • Issue AT+QIACT=1,1 which activates the PDP context

  4. Ping 8.8.8.8

    • Issue AT+QPING=1,"8.8.8.8",5,5, this pings 8.8.8.8 five times with a timeout of five seconds

SIMCom's SIM7070G

  1. Set the APN

    • Issue AT+CNCFG=0,1,"onomondo", this defines the PDP context

  2. Attach to the network

    • Check the connection with AT+COPS? – the modem might already have connected when it was booted up, if this isn't the case then do the following:

      • Issue AT+COPS=0, this will make the modem automatically choose a network

    • Wait for AT+CEREG? or AT+CGREG? to return x,5, where x doesn't matter

  3. Establish a data connection

    • Issue AT+CNACT=0,1 which activates the PDP context

  4. Ping 8.8.8.8

    • Select PDP context ID for pinging AT+SNPDPID=0

    • Issue AT+SNPING4="8.8.8.8",5,16,5000, this pings 8.8.8.8 five times with a timeout of five seconds

Thales' PLS62-W

  1. Set the APN

    • Issue AT+CGDCONT=1,"IP","onomondo", this defines the PDP context

  2. Attach to the network

    • Check the connection with AT+COPS? – the modem might already have connected when it was booted up, if this isn't the case then do the following:

      • Issue AT+COPS=0, this will make the modem automatically choose a network

    • Wait for AT+CEREG? or AT+CGREG? to return x,5, where x doesn't matter

  3. Establish a data connection

    • Issue AT^SICA=1,1 which activates the PDP context

    • Get the IP of your device with AT+CGPADDR=1, this is not optional

  4. Ping 8.8.8.8

    • Issue AT^SISX=Ping,1,"8.8.8.8",5,5000, this pings 8.8.8.8 five times with a timeout of five seconds

Telit's LE910C1

  1. Set the APN

    • Issue AT+CGDCONT=1,"IP","onomondo", this defines the PDP context

  2. Attach to the network

    • Check the connection with AT+COPS? – the modem might already have connected when it was booted up, if this isn't the case then do the following:

      • Issue AT+COPS=0, this will make the modem automatically choose a network

    • Wait for AT+CEREG? or AT+CGREG? to return x,5, where x doesn't matter

  3. Establish a data connection

    • Issue AT#SGACT=1,1 which activates the PDP context

  4. Ping 8.8.8.8

    • Issue AT#PING="8.8.8.8",5, this pings 8.8.8.8 five times with a timeout of five seconds