My first Internet access tests on a SIM7670, Error suggestions?

I have tested the SIM card with a phone, worked great. Then tested same T-Mobile SIM card using the below code, same APN as phone. The first error is from AT+HTTPINIT. Serial monitor output follows. I have checked and corrected all of the AT command syntax with the manual. I’m sure I must verify this before attempting to use MQTT. Should it concern me that +CREG: 0,6 ? Any suggestions appreciated.

Code:

#include <SoftwareSerial.h>

// Configure SoftwareSerial pins
#define SIM7600_RX_PIN 3 // Connect to SIM7600 TX
#define SIM7600_TX_PIN 4 // Connect to SIM7600 RX
#define PWRKEY_PIN 4     // Pin to power on the module

SoftwareSerial simSerial(SIM7600_RX_PIN, SIM7600_TX_PIN);

// T-Mobile APN settings (might vary by plan/location, but "fast.t-mobile.com" is common)
const char* apn = "fast.t-mobile.com";
const char* gprsUser = ""; // Usually empty for T-Mobile
const char* gprsPass = ""; // Usually empty for T-Mobile

void setup() {
// Initialize serial communication for debugging
Serial.begin(9600);
while (!Serial);
Serial.println("Starting SIM76XX Connectivity Test");

// Initialize SoftwareSerial for the SIM76XX module
simSerial.begin(9600); // Common baud rate for SIM76XX

//powerOnSIM7600();
//delay(10000); // Wait for the module to initialize and find network

// Run the connectivity test sequence
testConnectivity();
}

void loop() {
// Main loop can be empty or used for other tasks
}

void powerOnSIM7600() {
pinMode(PWRKEY_PIN, OUTPUT);
Serial.println("Powering on SIM7600 module...");
digitalWrite(PWRKEY_PIN, HIGH);
delay(1000);
digitalWrite(PWRKEY_PIN, LOW);
delay(2000); // Module needs time to power up and register on the network
Serial.println("Module powered on. Waiting for network registration...");
}

// Function to send AT commands and wait for a response
String sendATCommand(String command, unsigned long timeout) {
simSerial.println(command);
String response = "";
long time = millis();
while ((time + timeout) > millis()) {
while (simSerial.available()) {
char c = simSerial.read();
response += c;
}
if (response.indexOf("OK") != -1 || response.indexOf("ERROR") != -1 || response.indexOf("+CREG:") != -1 || response.indexOf("+CGACT:") != -1) {
break;
}
}
Serial.println("Response: " + response);
return response;
}

void testConnectivity() {
// 1. Check if the module is communicating
sendATCommand("AT", 1000);

// 2. Check SIM card readiness
sendATCommand("AT+CPIN?", 2000); // Should return "+CPIN: READY"

// 3. Check network registration status
// +CREG: 0,1 or 0,5 means registered (home network or roaming)
sendATCommand("AT+CREG?", 3000);

// 4. Check operator details (optional, helps confirm T-Mobile)
sendATCommand("AT+COPS?", 3000);

// 5. Define PDP context with the T-Mobile APN
String cmd = "AT+CGDCONT=1,"IP","" + String(apn) + """;
sendATCommand(cmd, 2000);

// 6. Activate PDP context (connect to GPRS/LTE)
sendATCommand("AT+CGACT=1,1", 4000);

// 7. Check GPRS/LTE attach status
// +CGATT: 1 means attached
sendATCommand("AT+CGATT?", 2000);

// 8. Test internet connectivity using an HTTP GET request
Serial.println("Attempting HTTP GET request...");
sendATCommand("AT+HTTPINIT", 12000); // Initialize HTTP service
delay(2000);
sendATCommand("AT+HTTPPARA="URL","http://www.google.com"", 2000); // Set URL
sendATCommand("AT+HTTPACTION=0", 5000); // Start GET request (action 0)

// Check the response code. +HTTPACTION: 0,200,X indicates success (HTTP 200 OK)
String httpResponse = sendATCommand("AT+HTTPREAD?", 3000); // Read the response body

if (httpResponse.indexOf("200") != -1) {
Serial.println("Internet connectivity test: SUCCESSFUL");
} else {
Serial.println("Internet connectivity test: FAILED (HTTP error or no response)");
}

// Clean up HTTP session
sendATCommand("AT+HTTPTERM", 2000);
}

Serial monitor
——————-
Starting SIM76XX Connectivity Test
Response: AT

OK

Response:
AT+CPIN?

+CPIN: READY

OK

Response:
AT+CREG?

+CREG: 0,
Response: 6

OK)
Response: AT+COPS?
AT+CGDCONT=1,"IP","fast.t-mobile.com"

+COPS: 0,2,"310260",7

OK
Response:

OK

Response: AT+
�)XЩaP
��

+CGATT: 1

OK
Attempting HTTP GET request...
Response:
AT+HTTPINIT

ERROR

Response: AT+HTTPPARA="URL","http://www.google.com"

OK

Response: AT+HTTPACTION=0

OK

Response:
AT+HTTPREAD?

ERROR

Internet connectivity test: FAILED (HTTP error or no response)
Response: AT+HTTPTERM

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.