![]() |
|
Sim7600E kc868_A4S GSM SIM Internet Is not working - 4G and 3G Enabled - Printable Version +- Smart Home Automation Forum (https://www.kincony.com/forum) +-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20) +--- Forum: KC868-A4S (https://www.kincony.com/forum/forumdisplay.php?fid=41) +--- Thread: Sim7600E kc868_A4S GSM SIM Internet Is not working - 4G and 3G Enabled (/showthread.php?tid=8035) |
Sim7600E kc868_A4S GSM SIM Internet Is not working - 4G and 3G Enabled - venuakil2 - 05-01-2025 Hi, I am Sim7600E kc868_A4S Model to call website URL after Internet activation. SIM Yellow Light is blinking. SIM call and SMS are working. But, Internet is not working. I have changed SIM Provider APN details #include <HardwareSerial.h> // Define SIM7600 UART #define MODEM_RX 13 // Connect to SIM7600 TX #define MODEM_TX 15 // Connect to SIM7600 RX HardwareSerial sim7600(1); // Use UART1 const char* APN = "du"; // Set your network APN const char* USER = ""; // Usually blank const char* PASS = ""; // Usually blank void setup() { Serial.begin(115200); // USB serial sim7600.begin(115200, SERIAL_8N1, MODEM_RX, MODEM_TX); // UART1 delay(5000); // Give time to power up Serial.println("Initializing SIM7600..."); // Disable echo for clean output sendATCommand("ATE0", "OK", 1000); // Basic check if (!retryCommand("AT", "OK", 2000, 3)) { Serial.println("SIM7600 not responding!"); while (1); } // SIM card check if (!sendATCommand("AT+CPIN?", "READY", 2000)) { Serial.println("SIM Card not ready!"); while (1); } // Set LTE-only mode sendATCommand("AT+CNMP=38", "OK", 3000); sendATCommand("AT+CMNB=1", "OK", 3000); // Set APN String apnCmd = "AT+CGDCONT=1,\"IP\",\"" + String(APN) + "\""; sendATCommand(apnCmd.c_str(), "OK", 3000); // Attach to network if (!sendATCommand("AT+CGATT=1", "OK", 10000)) { Serial.println("Failed to attach to network!"); while (1); } // Activate PDP if (!sendATCommand("AT+CGACT=1,1", "OK", 10000)) { Serial.println("Failed to activate PDP!"); while (1); } // Show IP printIPAddress(); } void loop() { // Optional: monitor SIM7600 data or implement HTTP } // ========== AT COMMAND HELPERS ========== bool sendATCommand(const char* cmd, const char* expected, uint32_t timeout) { sim7600.flush(); sim7600.println(cmd); Serial.print(">> "); Serial.println(cmd); uint32_t start = millis(); String response; while (millis() - start < timeout) { while (sim7600.available()) { char c = sim7600.read(); Serial.write©; response += c; if (response.indexOf(expected) != -1) { return true; } } } Serial.println("\n!! Timeout or Unexpected response:"); Serial.println(response); return false; } bool retryCommand(const char* cmd, const char* expected, uint32_t timeout, int retries) { for (int i = 0; i < retries; i++) { if (sendATCommand(cmd, expected, timeout)) return true; delay(1000); } return false; } void printIPAddress() { Serial.println("Checking IP with AT+CGPADDR=1..."); sim7600.println("AT+CGPADDR=1"); delay(1000); String response; while (sim7600.available()) { char c = sim7600.read(); Serial.write©; response += c; } int ipStart = response.indexOf(",\"") + 2; int ipEnd = response.indexOf("\"", ipStart); if (ipStart > 1 && ipEnd > ipStart) { String ip = response.substring(ipStart, ipEnd); Serial.print("Assigned IP: "); Serial.println(ip); } else { Serial.println("No IP Address Assigned"); } } OutPut 13:57:40.249 -> >> AT 13:57:42.215 -> !! Timeout or Unexpected response: 13:57:49.212 -> SIM7600 not responding! Note : SIM calling is working Note 2: SIM SMS are working. Only Internet is not activated. I have to call website URL after Internet connected. RE: Sim7600E kc868_A4S GSM SIM Internet Is not working - 4G and 3G Enabled - admin - 05-01-2025 we have demo code for SMS and CALL. SIM7600 support MQTT connection. what function you want to use? do you want use SIM7600 to visite internet webpage? or ? RE: Sim7600E kc868_A4S GSM SIM Internet Is not working - 4G and 3G Enabled - venuakil2 - 05-02-2025 Hi , Thank you for Reply. I have to Send call API URL with Post JSON Data and Connect WiFiClient socket for Heartbeat and communication purpose. HTTPClient http; WiFiClient client; client.connect(serverIP, 80); void sendTelemetry() { HTTPClient http; DynamicJsonDocument doc(512); doc["serialNumber"] = device_serial_number; // alarmSystem.config.deviceID; doc["temperature"] = alarmSystem.sensors.temperature; doc["humidity"] = alarmSystem.sensors.humidity; doc["current_mA"] = alarmSystem.sensors.current_mA; doc["status"] = static_cast<int>(alarmSystem.currentState); doc["doorOpen"] = alarmSystem.sensors.doorOpen ? 1 : 0; doc["waterLeakage"] = alarmSystem.sensors.waterLeak ? 1 : 0; doc["acPowerFailure"] = alarmSystem.sensors.powerFail ? 1 : 0; doc["fire"] = alarmSystem.sensors.fire ? 1 : 0; doc["temperature_alarm"] = 0; if (alarmSystem.sensors.temperature > alarmSystem.config.tempThreshold) { doc["temperature_alarm"] = 1; } String payload; serializeJson(doc, payload); sensorData=payload; http.begin(serverURL + "/alarm_device_status"); http.addHeader("Content-Type", "application/json"); int httpCode = http.POST(payload); //Serial.println(serverURL); if (httpCode > 0) { Serial.println("HTTP Response: " + String(httpCode)); } else { Serial.println("HTTP Error: " + String(httpCode)); } http.end(); } RE: Sim7600E kc868_A4S GSM SIM Internet Is not working - 4G and 3G Enabled - venuakil2 - 05-02-2025 Can I use Configure PPP connection? RE: Sim7600E kc868_A4S GSM SIM Internet Is not working - 4G and 3G Enabled - admin - 05-03-2025 i am not tested with pppoe connection, only have used mqtt. if esp32 work as a router with sim7600e, i think it's not very suitable. |