فهرست منبع

[Improve][AW-CCS][main / Module_PowerShareing / Module_Wifi]

2021.08.03 / Folus Wen

Actions:
1. Local power sharging logic imrprovemnet.
2. Module_Wifi keep connection if can not access internet when local loading balance enable.

Files:
1. As follow commit history

Image version: D0.55.XX.XXXX.XX
Image checksum: XXXXXXXX

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
FolusWen 3 سال پیش
والد
کامیت
64e3630781
3فایلهای تغییر یافته به همراه17 افزوده شده و 11 حذف شده
  1. 1 1
      EVSE/Modularization/Module_Wifi.c
  2. 8 7
      EVSE/Projects/AW-CCS/Apps/Module_PowerSharing.c
  3. 8 3
      EVSE/Projects/AW-CCS/Apps/main.c

+ 1 - 1
EVSE/Modularization/Module_Wifi.c

@@ -4540,7 +4540,7 @@ void proc_sta()
 				sleep(5);
 			}
 
-			if((cnt_pingDNS_Fail >= 3) && !ShmSysConfigAndInfo->SysInfo.OcppConnStatus)
+			if((cnt_pingDNS_Fail >= 3) && !ShmSysConfigAndInfo->SysInfo.OcppConnStatus && !(ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharging && (isConnectAP() == PASS)))
 			{
 				ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectViaWiFi=1;
 				ShmSysConfigAndInfo->SysConfig.AthInterface.WifiNetworkConn=0;

+ 8 - 7
EVSE/Projects/AW-CCS/Apps/Module_PowerSharing.c

@@ -384,10 +384,11 @@ int conn_update_status(int socketFd, uint8_t pilotState, uint8_t availableCurren
 			   (ShmPowerSharing->Connection_Info[idx].presentOutputCurrent != presentCurrent) ||
 			   (ShmPowerSharing->Connection_Info[idx].acPhase != acPhase))
 			{
-				DEBUG_INFO("Connection-%d pilot state: %d \n", idx, pilotState);
-				DEBUG_INFO("Connection-%d available current: %d \n", idx, availableCurrent);
-				DEBUG_INFO("Connection-%d preset output current: %d \n", idx, presentCurrent);
-				DEBUG_INFO("Connection-%d ac power phase: %d \n", idx, acPhase);
+				DEBUG_INFO("Conn-%d pilot state: %d\n", idx, pilotState);
+				DEBUG_INFO("Conn-%d available current: %d\n", idx, availableCurrent);
+				DEBUG_INFO("Conn-%d preset output current: %d\n", idx, presentCurrent);
+				DEBUG_INFO("Conn-%d ac power phase: %d\n", idx, acPhase);
+				DEBUG_INFO("==================================\n");
 			}
 
 			ShmPowerSharing->Connection_Info[idx].isGunConnected = (2<=pilotState)&&(pilotState<=7)?YES:NO;
@@ -414,7 +415,7 @@ int conn_getOnHandCurrent(void)
 
 	result = ShmCharger->gun_info[0].primaryMcuState.rating_current - result;
 
-	DEBUG_INFO("Total on hand available current: %d\n", result);
+	DEBUG_INFO("Total available current: %d\n", result);
 	return result;
 }
 
@@ -751,7 +752,7 @@ int balance_check_loop(void)
 		// Check available power
 		if(ShmPowerSharing->hasNewConn)
 		{
-			DEBUG_INFO("New connection gun connected and re-allocate available current to each connection.\n");
+			DEBUG_INFO("Detect gun connected re-allocate available current to each connection.\n");
 
 			for(uint8_t idx=0;idx<CONNECTION_LIMIT;idx++)
 			{
@@ -783,7 +784,7 @@ int balance_check_loop(void)
 					}
 					else if(((ShmPowerSharing->Connection_Info[idx].presentOutputCurrent-1) < ShmPowerSharing->Connection_Info[idx].availableSharingCurrent) &&
 							(ShmPowerSharing->Connection_Info[idx].availableSharingCurrent < (ShmPowerSharing->Connection_Info[idx].presentOutputCurrent+1)) &&
-							(conn_getOnHandCurrent() > 2))
+							(conn_getOnHandCurrent() >= 2))
 					{
 						ShmPowerSharing->Connection_Info[idx].availableSharingCurrent += 2;
 					}

+ 8 - 3
EVSE/Projects/AW-CCS/Apps/main.c

@@ -3676,7 +3676,7 @@ void checkTask()
 		system("/root/Module_EventLogging &");
 	}
 
-	if(strcmp((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,"") != 0)
+	if((strcmp((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,"") != 0) && !ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharging)
 	{
 		if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
 		{
@@ -4872,9 +4872,14 @@ int main(void)
 						ShmCharger->isLcdOn = ON;
 
 						// If Web Server OPCC URL is empty kill Module_OcppBackend
-						if(strcmp((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,"") == 0)
+						if((strcmp((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,"") == 0) || ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharging)
 						{
-							DEBUG_INFO("URL is empty kill Module_OcppBackend...\n");
+							if(strcmp((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,"") == 0)
+								DEBUG_INFO("URL is empty kill Module_OcppBackend...\n");
+
+							if(ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharging)
+								DEBUG_INFO("Local power sharing enable kill Module_OcppBackend...\n");
+
 							system ("pkill OcppBackend");
 						}