Эх сурвалжийг харах

[Improve][AW-CCS / AX80][Module_CCS]

2022.08.15 / Folus Wen

Actions:
1. Synchronize CCS source from CCS project.

Files:
1. As follow commit history

Image version: V0.30.XX.XXXX.XX
Image checksum: XXXXXXXX

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
Folus Wen 2 жил өмнө
parent
commit
5ab513f3ba

+ 21 - 14
EVSE/Projects/AW-CCS/Apps/CCS/SeccComm.c

@@ -58,7 +58,7 @@ struct appHandEXIDocument ccs_handshake;
 struct dinEXIDocument ccs_exi_doc_DIN;
 struct iso1EXIDocument ccs_exi_doc_ISO1;
 struct iso2EXIDocument ccs_exi_doc_ISO2;
-unsigned char V2GTP_Tx_buf[V2GTP_MSG_TX_BUFFER_SIZE];   //64*1024 ﺿ65,536 = 65.5KB
+unsigned char V2GTP_Tx_buf[V2GTP_MSG_TX_BUFFER_SIZE];   //64*1024 ?65,536 = 65.5KB
 unsigned char buf_log_evcomm[SIZE_OF_LOG_BUFFER];
 unsigned char buf_log_evcomm_fork1[SIZE_OF_LOG_BUFFER];
 unsigned char buf_log_evcomm_fork2[SIZE_OF_LOG_BUFFER];
@@ -2458,7 +2458,6 @@ int MmeProcess(unsigned char *Buffer, int DataLength)
 		}
 	}
 	#endif
-
     	//[To-Do] Adding a pre-check filter mechanism for Source and Destination MAC Address
 
     	//check if the destination address is broadcast or EVSE itself, it can be ignore if not belong to itself.
@@ -2481,7 +2480,7 @@ int MmeProcess(unsigned char *Buffer, int DataLength)
 		            //SAVE_SYS_LOG_MSG_EVCOMM("[SLAC][Rx]CM_SLAC_PARM_REQ: ignored(QCA7K init...)");
 		            break;
 		        }
-	
+
 		        //Check error state
 		        state = Check_V2G_Flow_Status();
 		        if (state == Performance_Timeout ||     //253
@@ -2493,7 +2492,7 @@ int MmeProcess(unsigned char *Buffer, int DataLength)
 		        }
 	
 		        //Printing EV MAC Address
-		        SAVE_SYS_LOG_MSG_EVCOMM("[SLAC][Rx]CM_SLAC_PARM_REQ");
+		        //SAVE_SYS_LOG_MSG_EVCOMM("[SLAC][Rx]CM_SLAC_PARM_REQ");
 	
 		        //Avoid Coupled SLAC_PARM_REQ
 		        if (CheckConnectorPlugIn() == FALSE)  //12V(State 1)
@@ -2519,8 +2518,8 @@ int MmeProcess(unsigned char *Buffer, int DataLength)
 	
 	       		 //=================== Legal CM_SLAC_PARM_REQ Zone =================
 	
-	       		 Update_V2G_Flow_Status(CM_SLAC_PARM_REQ);
-	
+	       		 //Update_V2G_Flow_Status(CM_SLAC_PARM_REQ);
+
 		        #if (SLAC_FIRST_RESPONSE_METHOD == SET_5_PWM_ONCE_RX_CM_SLAC_PARM_REQ)
 		        {
 		            //Once receiving CM_SLAC_PARM_REQ, set PWM as 5%
@@ -2528,14 +2527,14 @@ int MmeProcess(unsigned char *Buffer, int DataLength)
 		            OutputCpPwmDuty(5);
 		        }
 		        #endif
-	
+
 		        //Checking if this SLAC Req comes before 5% PWM (for 15118)
-		        if(ShmInternalComm->ChargingPermission == FALSE)
+		        /*if(ShmInternalComm->ChargingPermission == FALSE)
 		        {
 		            //Sniffer_Tcpdump(ENABLE);
 		            sprintf(buf_log_evcomm, "Check Permission: %d (SLAC first => START)", ShmInternalComm->ChargingPermission);
 		            SAVE_SYS_LOG_MSG_EVCOMM(buf_log_evcomm);
-		        }
+		        }*/
 	
 		        #if (DEBUG_PRINTF_EVCOMM_DETAIL_SHOW == ENABLE)
 		        {
@@ -2683,11 +2682,10 @@ int MmeProcess(unsigned char *Buffer, int DataLength)
 		            }
 		            #endif
 		
-		            Update_V2G_Flow_Status(CM_SLAC_PARM_CONF);
 		            Rtn = sendto(RawSock, &SendMmePacket, SendMmePacketSize, 0, (struct sockaddr*)&DestSocketAddress, sizeof(struct sockaddr_ll));
-		
+		            Update_V2G_Flow_Status(CM_SLAC_PARM_CONF);
 		            DEBUG_PRINTF_EVCOMM_DETAIL("SendMmePacketSize=%d,Rtn=%d\n",SendMmePacketSize,Rtn);
-		
+
 		            ftime(&SeqStartTime);
 		            break;
 		        }
@@ -4703,7 +4701,15 @@ int SlacComm()
 	        //if(DiffTimeb(SeqStartTime, SeqEndTime)>TT_match_response)
 	        if(DiffTimeb(SeqStartTime, SeqEndTime) > TT_match_response)     //extended to 400ms due to the response of CM_ATTEN_CHAR.RSP of some EVCC is slower than 200ms.
 	        {
-	         	sprintf(buf_log_evcomm,
+	        	// Alston - 2022/07/05 : Fix can't resend Atten_char_ind problem
+	         	if(EVCOMM_SYS_INFO.CM_ATTEN_CHAR_IND_retry < 2)
+		        {
+		        	EVCOMM_SYS_INFO.CM_ATTEN_CHAR_IND_retry++;
+		        	Update_V2G_Flow_Status(CM_MNBC_SOUND_IND);
+		        }
+		        else
+		        {	
+		        	sprintf(buf_log_evcomm,
                         	"SlacComm: Wait CM_ATTEN_CHAR_RSP Timeout - TT_match_response (%.02lf of %dms)",
                         	DiffTimeb(SeqStartTime, SeqEndTime),
                         	TT_match_response);
@@ -4723,6 +4729,7 @@ int SlacComm()
 
 		         Update_V2G_Flow_Status(Sequence_Timeout);
 		         return -1;
+		       }		         	
 	        }
 	        break;
 		}
@@ -17850,7 +17857,7 @@ int main(int argc, char *argv[])
     #endif
     
     SAVE_SYS_LOG_MSG_EVCOMM("[Init]DONE");
-
+	
     while(1)
     {
         //DEBUG_PRINTF_EVCOMM_DETAIL("\nV2gFlowStatus = %d\n", V2gFlowStatus);

+ 10 - 2
EVSE/Projects/AW-CCS/Apps/CCS/SeccComm.h

@@ -83,7 +83,7 @@
 /************** V2GTP Payload Type ************/
 /**********************************************/
 //Reference:
-//Table 16 "Overview on V2GTP payload types," page 79, DIN SPEC 70121:2014-12
+//Table 16 ??"Overview on V2GTP payload types," page 79, DIN SPEC 70121:2014-12
 #define V2GTP_PAYLOAD_TYPE_SDP_REQUEST      0x9000      //SDP request message
 #define V2GTP_PAYLOAD_TYPE_SDP_RESPONSE     0x9001      //SDP response message
 #define V2GTP_PAYLOAD_TYPE_EXI_MSG          0x8001      //EXI encoded V2G Message
@@ -102,7 +102,15 @@
 #define TT_EVSE_SLAC_init                   50          //unit: sec.
 #define TT_match_sequence                   400         //unit: ms
 #define TP_match_response                   100         //unit: ms, General performance time for a response to a request
-#define TT_match_response                   (200*3)     //unit: ms, Time that the EV/EVSE shall wait for a response from the EVSE/EV
+// Alston 20220723
+//#define TT_EVSE_RESET_STATE                 3          //unit: sec.
+// Alston 20220723 end
+#ifdef DIN70122_ISO15118_VERIFICATION
+#define TT_match_response                   (200)     //unit: ms, Time that the EV/EVSE shall wait for a response from the EVSE/EV
+#else
+#define TT_match_response                   (200)     //unit: ms, Time that the EV/EVSE shall wait for a response from the EVSE/EV
+#endif
+
 #define TP_EV_batch_msg_interval            (50*3)      //unit: ms
 #define TT_EVSE_match_session               10000       //unit: ms
 #define TT_match_join                       (12000*2)   //unit: ms

+ 2 - 1
EVSE/Projects/AW-CCS/Apps/CCS/define.h

@@ -47,6 +47,7 @@
  #define PASS                1
  #define FAIL                0
 
+#define DIN70122_ISO15118_VERIFICATION
 /**************************************************************************************/
 /*********************************System Limitation**********************************/
 /**************************************************************************************/
@@ -97,7 +98,7 @@
 #define V2GT_MSG_PROTOCOL_ISO15118_2018             2    //i.e. ISO15118-20 (ISO 2)
 #define V2GT_MSG_PROTOCOL_HIGHEST_PRIORITY          255  //for auto detect highest priority protocol
 
-#define V2GT_MSG_PROTOCOL_PREFERENCE              V2GT_MSG_PROTOCOL_HIGHEST_PRIORITY // V2GT_MSG_PROTOCOL_ISO15118_2014//V2GT_MSG_PROTOCOL_HIGHEST_PRIORITY
+#define V2GT_MSG_PROTOCOL_PREFERENCE             V2GT_MSG_PROTOCOL_HIGHEST_PRIORITY// V2GT_MSG_PROTOCOL_HIGHEST_PRIORITY // V2GT_MSG_PROTOCOL_ISO15118_2014//V2GT_MSG_PROTOCOL_HIGHEST_PRIORITY
 //#define CCS_ENERGY_TRANSFER_MODE                    MODE_DC_EXTENDED
                                                     //DC: MODE_DC_EXTENDED (default)
                                                     //AC: MODE_AC_SINGLE_PHASE_CORE, MODE_AC_THREE_PHASE_CORE

+ 11 - 1
EVSE/Projects/AW-CCS/Apps/CCS/version.h

@@ -5,7 +5,7 @@
                      initiated by Joseph D. Anderson
                            (since 2019/12/03)
 =============================================================================*/
-#define FIRMWARE_VERSION            "V0.29.S0"   //8-Byte(ASCII Code), “tx.yz.ab.cd”
+#define FIRMWARE_VERSION            "V0.30.S0"   //8-Byte(ASCII Code), “tx.yz.ab.cd”
 #define HARDWARE_VERSION            "CCS_8.0x"      //8-Byte(ASCII Code): CSU-03-RW, CCS_Board, REV:5.0
 #define LINUX_IMAGE_VERSION         "dd2da761d59f2cdd4064c9d95f8c302a442d33f3 (2019-01-04)"
 #define RTC_DEFAULT_TIME            1595486300      //Epoch time (decimal)
@@ -58,6 +58,16 @@ S: CCS Board
 ================================================================================
 ====================== [Software] Version History (2020) =======================
 ================================================================================
+[VERSION] V0.30.S0
+* Release Date: 2022-08-08
+* Change:
+  1. Fix response time for SLAC+PARM_CONF
+  2. Fix can't resend Atten_char_ind problem
+* File
+  1. SeccComm.c version.h
+  2. SeccComm.c SeccComm.h define.h
+
+
 [VERSION] V0.29.S0
 * Release Date: 2022-03-01
 * Change:

+ 24 - 17
EVSE/Projects/AX80/Apps/CCS/SeccComm.c

@@ -58,7 +58,7 @@ struct appHandEXIDocument ccs_handshake;
 struct dinEXIDocument ccs_exi_doc_DIN;
 struct iso1EXIDocument ccs_exi_doc_ISO1;
 struct iso2EXIDocument ccs_exi_doc_ISO2;
-unsigned char V2GTP_Tx_buf[V2GTP_MSG_TX_BUFFER_SIZE];   //64*1024 ﺿ65,536 = 65.5KB
+unsigned char V2GTP_Tx_buf[V2GTP_MSG_TX_BUFFER_SIZE];   //64*1024 ?65,536 = 65.5KB
 unsigned char buf_log_evcomm[SIZE_OF_LOG_BUFFER];
 unsigned char buf_log_evcomm_fork1[SIZE_OF_LOG_BUFFER];
 unsigned char buf_log_evcomm_fork2[SIZE_OF_LOG_BUFFER];
@@ -2458,7 +2458,6 @@ int MmeProcess(unsigned char *Buffer, int DataLength)
 		}
 	}
 	#endif
-
     	//[To-Do] Adding a pre-check filter mechanism for Source and Destination MAC Address
 
     	//check if the destination address is broadcast or EVSE itself, it can be ignore if not belong to itself.
@@ -2481,7 +2480,7 @@ int MmeProcess(unsigned char *Buffer, int DataLength)
 		            //SAVE_SYS_LOG_MSG_EVCOMM("[SLAC][Rx]CM_SLAC_PARM_REQ: ignored(QCA7K init...)");
 		            break;
 		        }
-	
+
 		        //Check error state
 		        state = Check_V2G_Flow_Status();
 		        if (state == Performance_Timeout ||     //253
@@ -2493,7 +2492,7 @@ int MmeProcess(unsigned char *Buffer, int DataLength)
 		        }
 	
 		        //Printing EV MAC Address
-		        SAVE_SYS_LOG_MSG_EVCOMM("[SLAC][Rx]CM_SLAC_PARM_REQ");
+		        //SAVE_SYS_LOG_MSG_EVCOMM("[SLAC][Rx]CM_SLAC_PARM_REQ");
 	
 		        //Avoid Coupled SLAC_PARM_REQ
 		        if (CheckConnectorPlugIn() == FALSE)  //12V(State 1)
@@ -2519,8 +2518,8 @@ int MmeProcess(unsigned char *Buffer, int DataLength)
 	
 	       		 //=================== Legal CM_SLAC_PARM_REQ Zone =================
 	
-	       		 Update_V2G_Flow_Status(CM_SLAC_PARM_REQ);
-	
+	       		 //Update_V2G_Flow_Status(CM_SLAC_PARM_REQ);
+
 		        #if (SLAC_FIRST_RESPONSE_METHOD == SET_5_PWM_ONCE_RX_CM_SLAC_PARM_REQ)
 		        {
 		            //Once receiving CM_SLAC_PARM_REQ, set PWM as 5%
@@ -2528,14 +2527,14 @@ int MmeProcess(unsigned char *Buffer, int DataLength)
 		            OutputCpPwmDuty(5);
 		        }
 		        #endif
-	
+
 		        //Checking if this SLAC Req comes before 5% PWM (for 15118)
-		        if(ShmInternalComm->ChargingPermission == FALSE)
+		        /*if(ShmInternalComm->ChargingPermission == FALSE)
 		        {
 		            //Sniffer_Tcpdump(ENABLE);
 		            sprintf(buf_log_evcomm, "Check Permission: %d (SLAC first => START)", ShmInternalComm->ChargingPermission);
 		            SAVE_SYS_LOG_MSG_EVCOMM(buf_log_evcomm);
-		        }
+		        }*/
 	
 		        #if (DEBUG_PRINTF_EVCOMM_DETAIL_SHOW == ENABLE)
 		        {
@@ -2683,11 +2682,10 @@ int MmeProcess(unsigned char *Buffer, int DataLength)
 		            }
 		            #endif
 		
-		            Update_V2G_Flow_Status(CM_SLAC_PARM_CONF);
 		            Rtn = sendto(RawSock, &SendMmePacket, SendMmePacketSize, 0, (struct sockaddr*)&DestSocketAddress, sizeof(struct sockaddr_ll));
-		
+		            Update_V2G_Flow_Status(CM_SLAC_PARM_CONF);
 		            DEBUG_PRINTF_EVCOMM_DETAIL("SendMmePacketSize=%d,Rtn=%d\n",SendMmePacketSize,Rtn);
-		
+
 		            ftime(&SeqStartTime);
 		            break;
 		        }
@@ -4703,7 +4701,15 @@ int SlacComm()
 	        //if(DiffTimeb(SeqStartTime, SeqEndTime)>TT_match_response)
 	        if(DiffTimeb(SeqStartTime, SeqEndTime) > TT_match_response)     //extended to 400ms due to the response of CM_ATTEN_CHAR.RSP of some EVCC is slower than 200ms.
 	        {
-	         	sprintf(buf_log_evcomm,
+	        	// Alston - 2022/07/05 : Fix can't resend Atten_char_ind problem
+	         	if(EVCOMM_SYS_INFO.CM_ATTEN_CHAR_IND_retry < 2)
+		        {
+		        	EVCOMM_SYS_INFO.CM_ATTEN_CHAR_IND_retry++;
+		        	Update_V2G_Flow_Status(CM_MNBC_SOUND_IND);
+		        }
+		        else
+		        {	
+		        	sprintf(buf_log_evcomm,
                         	"SlacComm: Wait CM_ATTEN_CHAR_RSP Timeout - TT_match_response (%.02lf of %dms)",
                         	DiffTimeb(SeqStartTime, SeqEndTime),
                         	TT_match_response);
@@ -4723,6 +4729,7 @@ int SlacComm()
 
 		         Update_V2G_Flow_Status(Sequence_Timeout);
 		         return -1;
+		       }		         	
 	        }
 	        break;
 		}
@@ -17612,10 +17619,10 @@ int End_Process()
 	free(V2gtpMsgTxBuf);
 	//DetachShareMemory();
 	Qca7kPowerReset();  //reset QCA7000 /* +++ 20200808, vern, should disconnected PLC connection after session stop ---*/
-#ifdef	AX80
+#ifdef AX80
 	system("killall SeccComm");
-#else
-	system("cd /root;./reset_soft.sh");
+#else	
+    	system("cd /root;./reset_soft.sh");
 #endif
     while(1)
     {
@@ -17850,7 +17857,7 @@ int main(int argc, char *argv[])
     #endif
     
     SAVE_SYS_LOG_MSG_EVCOMM("[Init]DONE");
-
+	
     while(1)
     {
         //DEBUG_PRINTF_EVCOMM_DETAIL("\nV2gFlowStatus = %d\n", V2gFlowStatus);

+ 10 - 2
EVSE/Projects/AX80/Apps/CCS/SeccComm.h

@@ -83,7 +83,7 @@
 /************** V2GTP Payload Type ************/
 /**********************************************/
 //Reference:
-//Table 16 "Overview on V2GTP payload types," page 79, DIN SPEC 70121:2014-12
+//Table 16 ??"Overview on V2GTP payload types," page 79, DIN SPEC 70121:2014-12
 #define V2GTP_PAYLOAD_TYPE_SDP_REQUEST      0x9000      //SDP request message
 #define V2GTP_PAYLOAD_TYPE_SDP_RESPONSE     0x9001      //SDP response message
 #define V2GTP_PAYLOAD_TYPE_EXI_MSG          0x8001      //EXI encoded V2G Message
@@ -102,7 +102,15 @@
 #define TT_EVSE_SLAC_init                   50          //unit: sec.
 #define TT_match_sequence                   400         //unit: ms
 #define TP_match_response                   100         //unit: ms, General performance time for a response to a request
-#define TT_match_response                   (200*3)     //unit: ms, Time that the EV/EVSE shall wait for a response from the EVSE/EV
+// Alston 20220723
+//#define TT_EVSE_RESET_STATE                 3          //unit: sec.
+// Alston 20220723 end
+#ifdef DIN70122_ISO15118_VERIFICATION
+#define TT_match_response                   (200)     //unit: ms, Time that the EV/EVSE shall wait for a response from the EVSE/EV
+#else
+#define TT_match_response                   (200)     //unit: ms, Time that the EV/EVSE shall wait for a response from the EVSE/EV
+#endif
+
 #define TP_EV_batch_msg_interval            (50*3)      //unit: ms
 #define TT_EVSE_match_session               10000       //unit: ms
 #define TT_match_join                       (12000*2)   //unit: ms

+ 2 - 1
EVSE/Projects/AX80/Apps/CCS/define.h

@@ -47,6 +47,7 @@
  #define PASS                1
  #define FAIL                0
 
+#define DIN70122_ISO15118_VERIFICATION
 /**************************************************************************************/
 /*********************************System Limitation**********************************/
 /**************************************************************************************/
@@ -97,7 +98,7 @@
 #define V2GT_MSG_PROTOCOL_ISO15118_2018             2    //i.e. ISO15118-20 (ISO 2)
 #define V2GT_MSG_PROTOCOL_HIGHEST_PRIORITY          255  //for auto detect highest priority protocol
 
-#define V2GT_MSG_PROTOCOL_PREFERENCE              V2GT_MSG_PROTOCOL_HIGHEST_PRIORITY // V2GT_MSG_PROTOCOL_ISO15118_2014//V2GT_MSG_PROTOCOL_HIGHEST_PRIORITY
+#define V2GT_MSG_PROTOCOL_PREFERENCE             V2GT_MSG_PROTOCOL_HIGHEST_PRIORITY// V2GT_MSG_PROTOCOL_HIGHEST_PRIORITY // V2GT_MSG_PROTOCOL_ISO15118_2014//V2GT_MSG_PROTOCOL_HIGHEST_PRIORITY
 //#define CCS_ENERGY_TRANSFER_MODE                    MODE_DC_EXTENDED
                                                     //DC: MODE_DC_EXTENDED (default)
                                                     //AC: MODE_AC_SINGLE_PHASE_CORE, MODE_AC_THREE_PHASE_CORE

+ 11 - 1
EVSE/Projects/AX80/Apps/CCS/version.h

@@ -5,7 +5,7 @@
                      initiated by Joseph D. Anderson
                            (since 2019/12/03)
 =============================================================================*/
-#define FIRMWARE_VERSION            "V0.29.S0"   //8-Byte(ASCII Code), “tx.yz.ab.cd”
+#define FIRMWARE_VERSION            "V0.30.S0"   //8-Byte(ASCII Code), “tx.yz.ab.cd”
 #define HARDWARE_VERSION            "CCS_8.0x"      //8-Byte(ASCII Code): CSU-03-RW, CCS_Board, REV:5.0
 #define LINUX_IMAGE_VERSION         "dd2da761d59f2cdd4064c9d95f8c302a442d33f3 (2019-01-04)"
 #define RTC_DEFAULT_TIME            1595486300      //Epoch time (decimal)
@@ -58,6 +58,16 @@ S: CCS Board
 ================================================================================
 ====================== [Software] Version History (2020) =======================
 ================================================================================
+[VERSION] V0.30.S0
+* Release Date: 2022-08-08
+* Change:
+  1. Fix response time for SLAC+PARM_CONF
+  2. Fix can't resend Atten_char_ind problem
+* File
+  1. SeccComm.c version.h
+  2. SeccComm.c SeccComm.h define.h
+
+
 [VERSION] V0.29.S0
 * Release Date: 2022-03-01
 * Change:

+ 17 - 1
EVSE/Projects/AX80/Apps/main.c

@@ -4935,6 +4935,7 @@ void checkRfidAuthrize()
 {
 	static uint8_t isCheckdResult = FALSE;
 	static uint8_t isReadable = TRUE;
+	static uint8_t lastIdtag[ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.UserId)];
 
 	if(!ShmCharger->isAuthrizing)
 	{
@@ -5012,6 +5013,7 @@ void checkRfidAuthrize()
 				// Request authorize if isSnStart is false
 				if(!isSnStart)
 				{
+					memcpy(lastIdtag, ShmSysConfigAndInfo->SysConfig.UserId, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.UserId));
 					memcpy(ShmSysConfigAndInfo->SysConfig.UserId, bufferRFID, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.UserId));
 					refreshStartTimer(&startTime[0][TMR_IDX_AUTH]);
 					ocpp_set_auth_conf(OFF);
@@ -5090,6 +5092,9 @@ void checkRfidAuthrize()
 								{
 									setLedMotion(gun_index,LED_ACTION_IDLE);
 									ShmCharger->gun_info[gun_index].resultAuthorization = DEFAULT_RFID;
+
+									if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus == SYS_MODE_PREPARING)
+										ShmCharger->gun_info[gun_index].rfidReq = ON;
 								}
 								ShmCharger->isAuthrizing = FALSE;
 							}
@@ -5151,7 +5156,18 @@ void checkRfidAuthrize()
 						setLedMotion(gun_index,LED_ACTION_IDLE);
 
 						if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus == SYS_MODE_PREPARING) && (ShmCharger->gun_selectd == gun_index))
-							ocpp_copy_userid_from_remotestart(gun_index);
+						{
+							switch(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod)
+							{
+								case START_METHOD_BACKEND:
+									ocpp_copy_userid_from_remotestart(gun_index);
+									break;
+
+								default:
+									memcpy(ShmSysConfigAndInfo->SysConfig.UserId, lastIdtag, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.UserId));
+									break;
+							}
+						}
 					}
 				}
 			}