@ScruffR
Hi, thanks for your comment.
My application only post message to server and does not require input from the server. So it is good to know that I don’t need to handle keepAlive function.
Since I am only using library implemented here TlsTcpClient library on WebIDE published not exactly sure why electron fails to post message to the server.
So I decided to turn Cellular off and on again to regain connection to the server as below.
void resetNetwork()
{
unsigned long connectTime = millis();
int sec = 0;
Serial.println("Cellular Off");
Cellular.off();
Serial.println("Cellular On");
Cellular.on();
Serial.println("Cellular Connect");
Cellular.connect();
while(Cellular.connecting()) {
if((millis() - connectTime) > 1000) {
connectTime = millis();
sec++;
Serial.printf("elapsed %d\r\n",sec);
}
}
STARTUP(cellular_credentials_set("TM", "", "", NULL)); /* SET APN */
}
After running above code, I finally can re-establish connection to the server.
Do you think this solution is ok?