|
@@ -37,6 +37,7 @@ uint32_t startTimeQueue;
|
|
uint8_t isWebsocketSendable = 1;
|
|
uint8_t isWebsocketSendable = 1;
|
|
uint8_t counterLwsRestart = 0;;
|
|
uint8_t counterLwsRestart = 0;;
|
|
uint8_t counterQueueSent = 0;
|
|
uint8_t counterQueueSent = 0;
|
|
|
|
+uint8_t counterConnect = 0;
|
|
|
|
|
|
//=================================
|
|
//=================================
|
|
// Common routine
|
|
// Common routine
|
|
@@ -359,6 +360,7 @@ void* ConnectWsServer(void* data) //int ConnectWsServer()
|
|
struct lws_context_creation_info ContextInfo;
|
|
struct lws_context_creation_info ContextInfo;
|
|
struct lws_client_connect_info ConnInfo;
|
|
struct lws_client_connect_info ConnInfo;
|
|
int use_ssl=0;
|
|
int use_ssl=0;
|
|
|
|
+ counterConnect += 1;
|
|
|
|
|
|
// If internet available synchronize datetime with ntp server
|
|
// If internet available synchronize datetime with ntp server
|
|
if(GetInternetConn() == 1)
|
|
if(GetInternetConn() == 1)
|
|
@@ -466,6 +468,9 @@ void* ConnectWsServer(void* data) //int ConnectWsServer()
|
|
goto end;
|
|
goto end;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ counterConnect=0;
|
|
|
|
+ DEBUG_INFO("counterConnect: %d\n", counterConnect);
|
|
|
|
+
|
|
end:
|
|
end:
|
|
pthread_exit(NULL/*(void *) fname*/);
|
|
pthread_exit(NULL/*(void *) fname*/);
|
|
}
|
|
}
|
|
@@ -991,6 +996,12 @@ void* processWatchdog()
|
|
startTimeDog = time((time_t*)NULL);
|
|
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)
|
|
if(system("pidof -s Module_PhBackend > /dev/null") != 0)
|
|
{
|
|
{
|