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

[Improve][GPL][dropbear]

2022.10.26 / Folus Wen

Actions:
1. Add dropbear & terminal authentication log to /Storage/SystemLog/osAuthLog

Files:
1. As follow commit history

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

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

+ 13 - 3
EVSE/Projects/AX80/Apps/main.c

@@ -2289,7 +2289,6 @@ void InitGPIO()
 	system("echo 1 > /sys/class/gpio/gpio56/value");
 	system("echo 0 > /sys/class/gpio/gpio114/value");
 	system("echo 0 > /sys/class/gpio/gpio59/value");
-	system("echo 1 > /sys/class/gpio/gpio115/value");
 	sleep(1);
 
 	DEBUG_INFO("Initial GPIO OK\n");
@@ -4715,7 +4714,7 @@ void checkStopReason(uint8_t gun_index)
 			sprintf((char*)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "EmergencyStop");
 			memcpy((char*)ShmOCPP16Data->StopTransaction[gun_index].IdTag, (char*)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartUserId, ARRAY_SIZE(ShmOCPP16Data->StopTransaction[gun_index].IdTag));
 		}
-		else if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_A) || (ShmCharger->gun_info[gun_index].isGunUnpluggedBefore == YES))
+		else if(((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_A) || (ShmCharger->gun_info[gun_index].isGunUnpluggedBefore == YES)) && (strstr((char*)ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTransactionOnEVSideDisconnect].ItemData, "TRUE") != NULL))
 		{
 			sprintf((char*)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "EVDisconnected");
 			memcpy((char*)ShmOCPP16Data->StopTransaction[gun_index].IdTag, (char*)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartUserId, ARRAY_SIZE(ShmOCPP16Data->StopTransaction[gun_index].IdTag));
@@ -4778,7 +4777,7 @@ void checkStopReason(uint8_t gun_index)
 		{
 			sprintf((char*)ShmOCPP20Data->TransactionEvent[gun_index].transactionInfo.stoppedReason, "EmergencyStop");
 		}
-		else if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_A) || (ShmCharger->gun_info[gun_index].isGunUnpluggedBefore == YES))
+		else if(((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_A) || (ShmCharger->gun_info[gun_index].isGunUnpluggedBefore == YES)) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[TxCtrlr_StopTxOnEVSideDisconnect].variableAttribute[0].value, "true") != NULL))
 		{
 			sprintf((char*)ShmOCPP20Data->TransactionEvent[gun_index].transactionInfo.stoppedReason, "EVDisconnected");
 			memcpy((char*)ShmOCPP20Data->TransactionEvent[gun_index].idToken.idToken, (char*)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartUserId, ARRAY_SIZE(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartUserId));
@@ -5367,6 +5366,17 @@ int main(void)
 					{
 						ShmCharger->gun_info[gun_index].isGetEvCCIDTimeout = OFF;
 						refreshStartTimer(&startTime[gun_index][TMR_IDX_POWERSAVING_STATE_B]);
+
+						if((gpio_get_value(GPIO_OUT_RST_QCA) == ON) && (ShmCharger->isCcsEnable))
+							gpio_set_value(GPIO_OUT_RST_QCA, OFF);
+					}
+					else
+					{
+						if((gpio_get_value(GPIO_OUT_RST_QCA) == OFF) && (ShmCharger->isCcsEnable))
+						{
+							gpio_set_value(GPIO_OUT_RST_QCA, ON);
+							sleep(3);
+						}
 					}
 
 					if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus == SYS_MODE_ALARM) ||

+ 1 - 1
EVSE/rootfs/etc/init.d/rcS

@@ -125,7 +125,7 @@ echo 3 > /proc/sys/kernel/panic
 #swapon /dev/loop7
 
 echo -e " Starting SSH           	: \n"
-/sbin/dropbear -I 300 -T 3
+/sbin/dropbear -I 300 -T 3 >> /Storage/SystemLog/osAuthLog 2>&1
 echo -e " Starting FTPD	  		: \n"
 tcpsvd -vE 0.0.0.0 21 ftpd -w -t 30 / &
 echo -e " Starting LIGHTTPD		: \n"

+ 1 - 1
EVSE/rootfs/etc/syslog.conf

@@ -3,4 +3,4 @@
 *.crit          /Storage/SystemLog/osCritLog
 *.alert         /Storage/SystemLog/osAlertLog
 *.emerg         /Storage/SystemLog/osEmergLog
-
+auth.*		/Storage/SystemLog/osAuthLog