Browse Source

2022-04-11 / Alston
Actions
1. Fix the problem of pingping DNS server with static IP
2. Fix the problem that the authentication fails and cannot be authorized again
3. Fix the problem of taking evccid for single connector
4. Fix re-trigger relay on command when GFD fail
Files
1. As follow commit history

root 3 years ago
parent
commit
9b36147724

+ 12 - 3
EVSE/Projects/DS60-120/Apps/Module_EvComm.c

@@ -3985,6 +3985,15 @@ void AuthorizeByCcid(byte _index)
 	{
 		if (_chargingData [_index]->ConnectorPlugIn)
 		{
+			byte targetID = _chargingData [_index]->Evboard_id;
+
+			if (gun_count == 1 &&
+					_chargingData [_index]->Type == _Type_CCS &&
+					ShmDcCommonData->CcsVersion == _CCS_VERSION_CHECK_TAG_V015S0)
+			{
+				targetID += 1;
+			}
+
 			if (ShmDcCommonData->_authWithCcidFlag [_index] == _CCID_NONE)
 			{
 				if (printLogRecord)
@@ -3993,7 +4002,7 @@ void AuthorizeByCcid(byte _index)
 				if (strcmp ( (char *) _chargingData [_index]->EVCCID, "" ) == EQUAL)
 				{
 					SendCommunicationOnly ( _index );
-					GetEvccIdReq ( _index, _chargingData [_index]->Evboard_id );
+					GetEvccIdReq ( _index, targetID);
 				}
 				else
 					ShmDcCommonData->_authWithCcidFlag [_index] = _CCID_GET;
@@ -4281,7 +4290,7 @@ int main(int argc, char *argv[])
 						continue;
 
 					if (_chargingData[_index]->Type == _Type_CCS)
-						GetEvccIdReq(_index, _chargingData[_index]->Evboard_id);
+						GetEvccIdReq(_index, targetID);
 
 					// 開始確認車端是否同意開始充電 : 1.SOC, 2.Target Vol, 3.Target Cur, 4.Charging remaining time
 					GetOutputReq(_index, targetID);
@@ -4338,7 +4347,7 @@ int main(int argc, char *argv[])
 					if (priorityLow % 5 == 1)
 					{
 						if (_chargingData[_index]->Type == _Type_CCS)
-							GetEvccIdReq(_index, _chargingData[_index]->Evboard_id);
+							GetEvccIdReq(_index, targetID);
 
 						// 取得車端電池資訊 : 1.AC or DC ? 2.Total battery cap, 3.Max battery vol, 4.Max battery cur
 						GetEvBatteryInfo(_index, targetID);

+ 2 - 1
EVSE/Projects/DS60-120/Apps/Module_InternalComm.c

@@ -1148,7 +1148,8 @@ void SetK1K2RelayStatus(byte index)
 	}
 
 	if (_chargingData[index]->SystemStatus < SYS_MODE_PREPARE_FOR_EVSE ||
-			_chargingData[index]->SystemStatus == SYS_MODE_FAULT)
+			_chargingData[index]->SystemStatus == SYS_MODE_FAULT ||
+			_chargingData[index]->GroundFaultStatus == GFD_FAIL)
 	{
 		if (_chargingData[index]->Evboard_id == 0x01)
 		{

+ 10 - 2
EVSE/Projects/DS60-120/Apps/main.c

@@ -217,7 +217,7 @@ bool isModelNameMatch = true;
 
 int rfidFd = -1;
 char* rfidPortName = "/dev/ttyS2";
-char* fwVersion = "V2.05.00.0000.00";
+char* fwVersion = "V2.06.00.0000.00";
 
 sqlite3 *localDb;
 bool isDb_ready;
@@ -1549,7 +1549,7 @@ void InitEthernet()
 	system("killall udhcpc");
 	system("rm -rf /etc/resolv.conf");
 	system("echo nameserver 8.8.8.8 > /etc/resolv.conf");		//Google DNS server
-	system("echo nameserver 180.76.76.76 > /etc/resolv.conf");	//Baidu DNS server
+	system("echo nameserver 180.76.76.76 >> /etc/resolv.conf");	//Baidu DNS server
 	//system("/sbin/ifconfig eth0 down;/sbin/ifconfig eth0 up");
 
 	if(ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient == 0)
@@ -3785,8 +3785,10 @@ void ScannerCardProcess()
 			else
 			{
 				// LCM => Authorize fail
+				PRINTF_FUNC("_LCM_AUTHORIZ_FAIL \n");
 				ShmSysConfigAndInfo->SysInfo.SystemPage = _LCM_AUTHORIZ_FAIL;
 				strcpy((char *)ShmSysConfigAndInfo->SysConfig.UserId, "");
+				ShmDcCommonData->_CcidAuthProcessStep = _CCID_NONE;
 			}
 			ClearAuthorizedFlag();
 		}
@@ -8674,6 +8676,8 @@ void RecordGfdResult(byte index)
 		{
 			// GFD 錯誤停止
 			RecordAlarmCode(index, "012234");
+			ocpp_set_stopReason_by_cmd(index, "Other");
+			ChargingAlarmProcess(index);
 		}
 		else if (chargingInfo[index]->GroundFaultStatus == GFD_WARNING)
 		{
@@ -8687,6 +8691,8 @@ void RecordGfdResult(byte index)
 		{
 			// GFD 錯誤停止
 			RecordAlarmCode(index, "012236");
+			ocpp_set_stopReason_by_cmd ( index, "Other" );
+			ChargingAlarmProcess ( index );
 		}
 		else if (chargingInfo[index]->GroundFaultStatus == GFD_WARNING)
 		{
@@ -8700,6 +8706,8 @@ void RecordGfdResult(byte index)
 		{
 			// GFD 錯誤停止
 			RecordAlarmCode(index, "012235");
+			ocpp_set_stopReason_by_cmd(index, "Other");
+			ChargingAlarmProcess ( index );
 		}
 		else if (chargingInfo[index]->GroundFaultStatus == GFD_WARNING)
 		{