|
@@ -36,8 +36,9 @@ unsigned char StartTransactionIdTagTemp[20]={0};
|
|
|
uint32_t startTimeDog;
|
|
|
uint32_t startTimeQueue;
|
|
|
uint8_t isWebsocketSendable = 1;
|
|
|
-uint8_t counterLwsRestart = 0;;
|
|
|
+uint8_t counterLwsRestart = 0;
|
|
|
uint8_t counterQueueSent = 0;
|
|
|
+uint8_t counterConnect = 0;
|
|
|
|
|
|
sqlite3 *db;
|
|
|
char *errMsg = NULL;
|
|
@@ -416,6 +417,7 @@ void* ConnectWsServer(void* data) //int ConnectWsServer()
|
|
|
struct lws_context_creation_info ContextInfo;
|
|
|
struct lws_client_connect_info ConnInfo;
|
|
|
int use_ssl=0;
|
|
|
+ counterConnect += 1;
|
|
|
|
|
|
// If internet available synchronize datetime with ntp server
|
|
|
if(GetInternetConn() == 1)
|
|
@@ -523,6 +525,9 @@ void* ConnectWsServer(void* data) //int ConnectWsServer()
|
|
|
goto end;
|
|
|
}
|
|
|
|
|
|
+ counterConnect=0;
|
|
|
+ DEBUG_INFO("counterConnect: %d\n", counterConnect);
|
|
|
+
|
|
|
end:
|
|
|
pthread_exit(NULL/*(void *) fname*/);
|
|
|
}
|
|
@@ -1264,6 +1269,12 @@ void* processWatchdog()
|
|
|
|
|
|
startTimeDog = time((time_t*)NULL);
|
|
|
}
|
|
|
+
|
|
|
+ if(counterConnect >= 2)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("Connect OCPP server timeout over 3 count.\n");
|
|
|
+ system("pkill OcppBackend");
|
|
|
+ }
|
|
|
|
|
|
/*
|
|
|
if(system("pidof -s Module_PhBackend > /dev/null") != 0)
|