فهرست منبع

[Improve][AW-Regular / AW-CCS / Modularization][main / Module_OcppBackend]

2021.08.17 / Folus Wen

Actions:
1. OcppBackend change AuthorizeRemoteTxRequests key as R/W.
2. OcppBackend enable charging profile synchroniz relative purpose in charging & suspended mode.
3. AW-Regular / AW-CCS enable authorize follow AuthorizeRemoteTxRequests key when remote start transaction.
4. AW-Regular conbine AW-ChargeLab factory default value.

Files:
1. As follow commit history

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

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
FolusWen 3 سال پیش
والد
کامیت
5128facb73

+ 9 - 9
EVSE/Modularization/ocppfiles/MessageHandler.c

@@ -2053,7 +2053,7 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
 		{
 			if(txProfile.ChargingSchedule.Duration != -1)
 			{
-				txProfile.ChargingSchedule.Duration = ((strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "Charging")==NULL) || (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEV")==NULL) || (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEVSE")==NULL))?txProfile.ChargingSchedule.Duration:((txProfile.ChargingSchedule.Duration-getStartStop(ShmOCPP16Data->StartTransaction[(connectorId==0?0:connectorId-1)].Timestamp, compositeProfile->ChargingSchedule.StartSchedule))<0?
+				txProfile.ChargingSchedule.Duration = ((strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "Charging")==NULL) && (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEV")==NULL) && (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEVSE")==NULL))?txProfile.ChargingSchedule.Duration:((txProfile.ChargingSchedule.Duration-getStartStop(ShmOCPP16Data->StartTransaction[(connectorId==0?0:connectorId-1)].Timestamp, compositeProfile->ChargingSchedule.StartSchedule))<0?
 																																								  0:
 																																								 (txProfile.ChargingSchedule.Duration-getStartStop(ShmOCPP16Data->StartTransaction[(connectorId==0?0:connectorId-1)].Timestamp, compositeProfile->ChargingSchedule.StartSchedule)));
 			}
@@ -2062,7 +2062,7 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
 			{
 				if(txProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod != -1)
 				{
-					txProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod = ((strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "Charging")==NULL) || (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEV")==NULL) || (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEVSE")==NULL))?txProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod:((txProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod-getStartStop(ShmOCPP16Data->StartTransaction[(connectorId==0?0:connectorId-1)].Timestamp, compositeProfile->ChargingSchedule.StartSchedule))<0?
+					txProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod = ((strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "Charging")==NULL) && (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEV")==NULL) && (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEVSE")==NULL))?txProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod:((txProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod-getStartStop(ShmOCPP16Data->StartTransaction[(connectorId==0?0:connectorId-1)].Timestamp, compositeProfile->ChargingSchedule.StartSchedule))<0?
 																																																												0:
 																																																											   (txProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod-getStartStop(ShmOCPP16Data->StartTransaction[(connectorId==0?0:connectorId-1)].Timestamp, compositeProfile->ChargingSchedule.StartSchedule)));
 
@@ -2197,7 +2197,7 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
 		{
 			if(defaultTxProfile.ChargingSchedule.Duration != -1)
 			{
-				defaultTxProfile.ChargingSchedule.Duration = ((strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "Charging")==NULL) || (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEV")==NULL) || (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEVSE")==NULL))?defaultTxProfile.ChargingSchedule.Duration:((defaultTxProfile.ChargingSchedule.Duration-getStartStop(ShmOCPP16Data->StartTransaction[(connectorId==0?0:connectorId-1)].Timestamp, compositeProfile->ChargingSchedule.StartSchedule))<0?
+				defaultTxProfile.ChargingSchedule.Duration = ((strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "Charging")==NULL) && (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEV")==NULL) && (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEVSE")==NULL))?defaultTxProfile.ChargingSchedule.Duration:((defaultTxProfile.ChargingSchedule.Duration-getStartStop(ShmOCPP16Data->StartTransaction[(connectorId==0?0:connectorId-1)].Timestamp, compositeProfile->ChargingSchedule.StartSchedule))<0?
 																																								  0:
 																																								 (defaultTxProfile.ChargingSchedule.Duration-getStartStop(ShmOCPP16Data->StartTransaction[(connectorId==0?0:connectorId-1)].Timestamp, compositeProfile->ChargingSchedule.StartSchedule)));
 			}
@@ -2206,7 +2206,7 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
 			{
 				if(defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod != -1)
 				{
-					defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod = ((strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "Charging")==NULL) || (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEV")==NULL) || (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEVSE")==NULL))?defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod:((defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod-getStartStop(ShmOCPP16Data->StartTransaction[(connectorId==0?0:connectorId-1)].Timestamp, compositeProfile->ChargingSchedule.StartSchedule))<0?
+					defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod = ((strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "Charging")==NULL) && (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEV")==NULL) && (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEVSE")==NULL))?defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod:((defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod-getStartStop(ShmOCPP16Data->StartTransaction[(connectorId==0?0:connectorId-1)].Timestamp, compositeProfile->ChargingSchedule.StartSchedule))<0?
 																																																												0:
 																																																											   (defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod-getStartStop(ShmOCPP16Data->StartTransaction[(connectorId==0?0:connectorId-1)].Timestamp, compositeProfile->ChargingSchedule.StartSchedule)));
 
@@ -2352,7 +2352,7 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
 		{
 			if(maxProfile.ChargingSchedule.Duration != -1)
 			{
-				maxProfile.ChargingSchedule.Duration = ((strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "Charging")==NULL) || (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEV")==NULL) || (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEVSE")==NULL))?maxProfile.ChargingSchedule.Duration:((maxProfile.ChargingSchedule.Duration-getStartStop(ShmOCPP16Data->StartTransaction[(connectorId==0?0:connectorId-1)].Timestamp, compositeProfile->ChargingSchedule.StartSchedule))<0?
+				maxProfile.ChargingSchedule.Duration = ((strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "Charging")==NULL) && (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEV")==NULL) && (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEVSE")==NULL))?maxProfile.ChargingSchedule.Duration:((maxProfile.ChargingSchedule.Duration-getStartStop(ShmOCPP16Data->StartTransaction[(connectorId==0?0:connectorId-1)].Timestamp, compositeProfile->ChargingSchedule.StartSchedule))<0?
 																																								  0:
 																																								 (maxProfile.ChargingSchedule.Duration-getStartStop(ShmOCPP16Data->StartTransaction[(connectorId==0?0:connectorId-1)].Timestamp, compositeProfile->ChargingSchedule.StartSchedule)));
 			}
@@ -2361,7 +2361,7 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
 			{
 				if(maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod != -1)
 				{
-					maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod = ((strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "Charging")==NULL) || (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEV")==NULL) || (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEVSE")==NULL))?maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod:((maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod-getStartStop(ShmOCPP16Data->StartTransaction[(connectorId==0?0:connectorId-1)].Timestamp, compositeProfile->ChargingSchedule.StartSchedule))<0?
+					maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod = ((strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "Charging")==NULL) && (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEV")==NULL) && (strstr((char*)ShmOCPP16Data->StatusNotification[(connectorId==0?0:connectorId-1)].Status, "SuspendedEVSE")==NULL))?maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod:((maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod-getStartStop(ShmOCPP16Data->StartTransaction[(connectorId==0?0:connectorId-1)].Timestamp, compositeProfile->ChargingSchedule.StartSchedule))<0?
 																																																											    0:
 																																																											   (maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod-getStartStop(ShmOCPP16Data->StartTransaction[(connectorId==0?0:connectorId-1)].Timestamp, compositeProfile->ChargingSchedule.StartSchedule)));
 
@@ -12935,7 +12935,7 @@ int initialConfigurationTable(void)
 	char sstr[256]={0};
 	int c = 0;
 	char *loc;
-	int	confVersion = 4;
+	int	confVersion = 5;
 
 	DEBUG_INFO("initialConfigurationTable...version: %d\n", confVersion);
 	//start_t = clock();
@@ -12984,7 +12984,7 @@ int initialConfigurationTable(void)
 		strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizeRemoteTxRequests].ItemName, "AuthorizeRemoteTxRequests");
 		strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizeRemoteTxRequests].ItemData, "FALSE" );
 
-		fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","AuthorizeRemoteTxRequests", "true", ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizeRemoteTxRequests].ItemData);
+		fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","AuthorizeRemoteTxRequests", "false", ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizeRemoteTxRequests].ItemData);
 
 		//BlinkRepeat
 		ShmOCPP16Data->ConfigurationTable.CoreProfile[BlinkRepeat].ItemAccessibility = 1;
@@ -13837,7 +13837,7 @@ void StoreConfigurationTable(void)
 	strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizeRemoteTxRequests].ItemData, "TRUE" );
 	*/
 
-	fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","AuthorizeRemoteTxRequests", "true", (char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizeRemoteTxRequests].ItemData);
+	fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","AuthorizeRemoteTxRequests", "false", (char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizeRemoteTxRequests].ItemData);
 
 	//BlinkRepeat
 	/*

+ 86 - 2
EVSE/Projects/AW-CCS/Apps/main.c

@@ -973,6 +973,28 @@ uint8_t ocpp_compare_reserve_id_with_remote_user(uint8_t gun_index)
 	return result;
 }
 
+uint8_t ocpp_isAuthorizeRemoteStart()
+{
+	uint8_t result = NO;
+
+	if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
+	{
+		if(strstr((char*)ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizeRemoteTxRequests ].ItemData, "TRUE"))
+		{
+			result = YES;
+		}
+	}
+	else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
+	{
+		if(strstr((char*)ShmOCPP20Data->ControllerComponentVariable[AuthCtrlr_AuthorizeRemoteStart].variableAttribute[0].value, "TRUE"))
+		{
+			result = YES;
+		}
+	}
+
+	return result;
+}
+
 //======================================================
 // Check interface status
 //======================================================
@@ -5004,9 +5026,71 @@ int main(void)
 					if(isModeChange(gun_index))
 					{
 						ftime(&startTime[gun_index][TMR_IDX_AUTH]);
-						if(ShmCharger->isCcsEnable)system("/root/Module_CCS &");
+						if(ocpp_isAuthorizeRemoteStart() && (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod == START_METHOD_BACKEND))
+						{
+							DEBUG_INFO("Remote start request authorize.\n");
+							ocpp_set_auth_req(ON, "ISO14443");
+						}
+					}
+
+					if(DiffTimebWithNow(startTime[gun_index][TMR_IDX_AUTH]) > TIMEOUT_SPEC_AUTH)
+					{
+						// Authorization timeout process.
+						setSpeaker(ON,SPEAKER_INTERVAL_3COUNT);
+						setLedMotion(gun_index,LED_ACTION_RFID_FAIL);
+						sleep(3);
+						setChargerMode(gun_index, SYS_MODE_IDLE);
+						DEBUG_WARN("Authorize timeout !!!\n");
+					}
+					else
+					{
+						switch(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod)
+						{
+							case START_METHOD_BACKEND:
+								if(ocpp_isAuthorizeRemoteStart())
+								{
+									if(ocpp_get_auth_conf())
+									{
+										if(ocpp_get_auth_result(gun_index))
+										{
+											memcpy((char*)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartUserId, ShmSysConfigAndInfo->SysConfig.UserId, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.UserId));
+
+											DEBUG_INFO("Authorize pass.\n");
+											setSpeaker(ON,SPEAKER_SHORT);
+											setLedMotion(gun_index,LED_ACTION_RFID_PASS);
+											sleep(3);
+											if(ShmCharger->isCcsEnable)system("/root/Module_CCS &");
+											setChargerMode(gun_index, SYS_MODE_PREPARING);
+										}
+										else
+										{
+											DEBUG_INFO("Authorize fail.\n");
+											setSpeaker(ON,SPEAKER_INTERVAL_3COUNT);
+											setLedMotion(gun_index,LED_ACTION_RFID_FAIL);
+											sleep(3);
+											setChargerMode(gun_index, SYS_MODE_IDLE);
+										}
+
+										ocpp_set_auth_conf(OFF);
+									}
+								}
+								else
+								{
+									setSpeaker(ON,SPEAKER_SHORT);
+									if(ShmCharger->isCcsEnable)system("/root/Module_CCS &");
+									setChargerMode(gun_index, SYS_MODE_PREPARING);
+								}
+								break;
+							case START_METHOD_RFID:
+							case START_METHOD_BLE:
+							case START_METHOD_FREE:
+							default:
+								setSpeaker(ON,SPEAKER_SHORT);
+								if(ShmCharger->isCcsEnable)system("/root/Module_CCS &");
+								setChargerMode(gun_index, SYS_MODE_PREPARING);
+								break;
+						}
 					}
-					setChargerMode(gun_index, SYS_MODE_PREPARING);
 
 					break;
 				case SYS_MODE_PREPARING:

+ 19 - 0
EVSE/Projects/AW-Regular/Apps/Module_FactoryConfig.c

@@ -316,9 +316,28 @@ int main(int argc, char *argv[])
 	// Customization configuration item
 	if(strstr((char*)&SysConfig.ModelName[12], "P0") != NULL)
 	{
+		// Phihong standard configuration
 		strcpy((char*)SysConfig.OcppServerURL, "");
 		sprintf((char*)SysConfig.ChargeBoxId, "%s%s", SysConfig.ModelName, SysConfig.SerialNumber);
 	}
+	else if(SysConfig.ModelName[12] == 'A')
+	{
+		// ChargeLab customization configuration
+		strcpy((char*)SysConfig.OcppServerURL, "wss://ocpp.io");
+		sprintf((char*)SysConfig.ChargeBoxId, "%s%s", SysConfig.ModelName, SysConfig.SerialNumber);
+		strcpy((char*)SysConfig.chargePointVendor, "ChargeLab");
+
+		SysConfig.AthInterface.WifiMode = 1;		// 0: Disable 1: Infrastructure client 2: Infrastructure server	3: Ad-Hoc
+		strcpy((char*)SysConfig.AthInterface.WifiSsid, "ChargeLab-EVC");
+		strcpy((char*)SysConfig.AthInterface.WifiPassword, "evc-pwd-default-21");
+		SysConfig.AthInterface.WifiRssi = 0;		// Wifi rssi value
+		SysConfig.AthInterface.WifiDhcpServer = 0;	// 0: Enable 1: Disable
+		SysConfig.AthInterface.WifiDhcpClient = 0;	// 0: Enable 1: Disable
+
+		strcpy((char*)SysConfig.TelecomInterface.TelcomApn, "m2minternet.apn");
+
+		SysConfig.OfflinePolicy = 0;			// 0: local list, 1: Phihong RFID tag, 2: free charging, 3: no charging
+	}
 	else
 	{
 

+ 57 - 0
EVSE/Projects/AW-Regular/Apps/main.c

@@ -929,6 +929,27 @@ uint8_t ocpp_compare_reserve_id_with_remote_user(uint8_t gun_index)
 	return result;
 }
 
+uint8_t ocpp_isAuthorizeRemoteStart()
+{
+	uint8_t result = NO;
+
+	if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
+	{
+		if(strstr((char*)ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizeRemoteTxRequests].ItemData, "TRUE"))
+		{
+			result = YES;
+		}
+	}
+	else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
+	{
+		if(strstr((char*)ShmOCPP20Data->ControllerComponentVariable[AuthCtrlr_AuthorizeRemoteStart].variableAttribute[0].value, "TRUE"))
+		{
+			result = YES;
+		}
+	}
+
+	return result;
+}
 
 //======================================================
 // Check interface status
@@ -3948,6 +3969,11 @@ int main(void)
 									break;
 							}
 						}
+						else if(ocpp_isAuthorizeRemoteStart() && (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod == START_METHOD_BACKEND))
+						{
+							DEBUG_INFO("Remote start request authorize.\n");
+							ocpp_set_auth_req(ON, "ISO14443");
+						}
 					}
 					
 					if(DiffTimebWithNow(startTime[gun_index][TMR_IDX_AUTH]) > TIMEOUT_SPEC_AUTH)
@@ -3995,6 +4021,37 @@ int main(void)
 								}
 								break;
 							case START_METHOD_BACKEND:
+								if(ocpp_isAuthorizeRemoteStart())
+								{
+									if(ocpp_get_auth_conf())
+									{
+										if(ocpp_get_auth_result(gun_index))
+										{
+											memcpy((char*)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartUserId, ShmSysConfigAndInfo->SysConfig.UserId, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.UserId));
+
+											DEBUG_INFO("Authorize pass.\n");
+											setSpeaker(ON,SPEAKER_SHORT);
+											setLedMotion(gun_index,LED_ACTION_RFID_PASS);
+											sleep(3);
+											setChargerMode(gun_index, SYS_MODE_PREPARING);
+										}
+										else
+										{
+											DEBUG_INFO("Authorize fail.\n");
+											setSpeaker(ON,SPEAKER_INTERVAL_3COUNT);
+											setLedMotion(gun_index,LED_ACTION_RFID_FAIL);
+											sleep(3);
+											setChargerMode(gun_index, SYS_MODE_IDLE);
+										}
+										ocpp_set_auth_conf(OFF);
+									}
+								}
+								else
+								{
+									setSpeaker(ON,SPEAKER_SHORT);
+									setChargerMode(gun_index, SYS_MODE_PREPARING);
+								}
+								break;
 							case START_METHOD_BLE:
 							case START_METHOD_FREE:
 							default: