ESP32 OTA using External modem Internet Connectivity, HTTP.h and Update.h Library.

Heet_Shukla
Posts: 2
Joined: Thu Mar 28, 2024 12:46 pm

ESP32 OTA using External modem Internet Connectivity, HTTP.h and Update.h Library.

Postby Heet_Shukla » Thu Mar 28, 2024 12:50 pm

I'm trying OTA Firmware update of ESP32 using Cavlii C16Qs. I'm trying to Connect internet with ESP32 using Cavlii C16Qs. Basically issue is I'm Not getting Internet Connectivity using "AT+PPPSTART" and Cavli C16Qs modem. Cavlii C16Qs is use for Providing a LTE Network. I'm trying to Internet Connection using "AT+PPPSTART" Command. https://cavli.atlassian.net/servicedesk ... /343015460 This is the link of Document for AT Commands Details. So what should I change in the below code so that esp 32 can get internet connectivity through Cavlii C16Qs? So that I can fetch the firmware file from the server.

Arduino IDE Version: 1.8.19
ESP32 Board Version: 2.0.0

[Codebox]#include <HTTPClient.h>
#include <update.h>

/* Cavli_C16QS */
String response = "";
const char *ipAddr;
String st1;
int value1, value2;
int clientID;

void setup() {
// Power up the ESP32 by toggling the PWRKEY pin
pinMode(2, OUTPUT);
digitalWrite(2, LOW);
delay(100);
digitalWrite(2, HIGH);

Serial.begin(115200);
Serial1.begin(115200, SERIAL_8N1, 32, 33); // RX, TX

//////////////////////////////////
// Send AT command via Serial to Cavli module
Serial.println("Sending ATI command to Cavli module");
Serial.println("==================================");
Serial1.print("ATI"); // Send command via Serial2
// FeedBack();
delay(1000);
while (Serial1.available()) {
char c = Serial1.read();
Serial.print(c);
}
Serial.println("Sending AT+COPS?");
//////////////////////////////////
// Read and print responses from Cavli module via Serial2
while (!(response.indexOf("+ATREADY") != -1 || response.indexOf("OK") != -1)) {
Serial1.print("AT+COPS?\r\n");
while (Serial1.available()) {
char c = Serial1.read();
response += c;
}
Serial.print("response-->");
Serial.println(response);
}
delay(1000); // Add a delay after sending the command
response = "";
//////////////////////////////////
value1 = value2 = -1;
Serial.println("Sending AT command... +CEREG? Checking network connectivity");
while (!(value1 == 0 && (value2 == 1 || value2 == 5))) {
Serial1.write("AT+CEREG?\r\n");
delay(500);
while (Serial1.available()) {
char c = Serial1.read();
response += c;
}
Serial.print("response-->");
Serial.println(response);
response = "";
}

delay(5000); // Add a delay after sending the command
response = "";
//////////////////////////////////
value1 = value2 = -1;
Serial.println("Sending AT command... +CGACT? Checking internet connectivity");
while (!(value1 == 1 && value2 == 1)) {
Serial1.write("AT+CGACT?\r\n");
delay(500);
while (Serial1.available()) {
char c = Serial1.read();
response += c;
}
Serial.print("response-->");
Serial.println(response);
response = "";
}
//////////////////////////////////
delay(500); // Add a delay after sending the command
response = "";
Serial.println("Sending AT+NETIF?");
Serial1.print("AT+NETIF?\r\n"); // Send command via Serial2
// Read and print responses from Cavli module via Serial2
while (Serial1.available()) {
char c = Serial1.read();
response += c;
}
Serial.print("response-->");
Serial.println(response);
response = "";

Serial.println("Sending AT+PPPSTART");
Serial1.print("AT+PPPSTART=?\r\n"); // Send command via Serial2
// Read and print responses from Cavli module via Serial2
while (Serial1.available()) {
char c = Serial1.read();
response += c;
}
Serial.print("response-->");
Serial.println(response);
response = "";

String _url = url_OTA_code_head + code_ver + url_OTA_code_tail;
delay(2000);

HTTPClient http;
http.begin(_url);
int httpCode = http.GET();
Serial.println(httpCode);

Serial.println("----------------------------End Setup----------------------------");

}

void loop() {
// put your main code here, to run repeatedly:

}[/Codebox]

esp-at
Posts: 200
Joined: Mon May 09, 2022 3:00 am

Re: ESP32 OTA using External modem Internet Connectivity, HTTP.h and Update.h Library.

Postby esp-at » Mon Apr 01, 2024 9:04 am

current esp-at firmware doesn't support AT+PPPSTART command, i would like to suggest you seek help from the firmware provider.

Who is online

Users browsing this forum: No registered users and 15 guests