Explorar el Código

2021.06.29 / Jerry Wang

Actions:
1. merge master conflict fixed.
2. Debug get Chiller temperature issue.
3. Modify ReadCmdline get temperature function.
4. Debug RelayBoard.c PresentChargingCurrent value is not a floating problem.
5. DoComm writePresentChargingInfo() add receive power cabinet PSU voltage and current,
   and on charging state EvComm send PSU voltage and current to EV board.
6. main.c add GetFirmwareVersion() and DoComm.h CHECK_NETWORK_FAIL_COUNT set 10.
7. Version release to V1.10.

Files:
1. As follow as commit history.
Jerry_Wang hace 3 años
padre
commit
754672153f
Se han modificado 92 ficheros con 2362 adiciones y 4935 borrados
  1. 69 9
      EVSE/Modularization/WebService.c
  2. 127 0
      EVSE/Projects/AW-ChargeLab/Apps/Module_ConfigTools.c
  3. 47 1
      EVSE/Projects/AW-ChargeLab/Apps/main.c
  4. 1 0
      EVSE/Projects/AW-ChargeLab/Apps/main.h
  5. 127 0
      EVSE/Projects/AW-Regular/Apps/Module_ConfigTools.c
  6. 47 1
      EVSE/Projects/AW-Regular/Apps/main.c
  7. 1 0
      EVSE/Projects/AW-Regular/Apps/main.h
  8. 130 1201
      EVSE/Projects/DD360/Apps/CSU/main.c
  9. 1 1
      EVSE/Projects/DD360/Apps/CSU/main.h
  10. 18 4
      EVSE/Projects/DD360/Apps/Config.h
  11. 1 1
      EVSE/Projects/DD360/Apps/FactoryConfig.c
  12. 9 2
      EVSE/Projects/DD360/Apps/Makefile
  13. 20 11
      EVSE/Projects/DD360/Apps/ModuleDoComm/DoComm.c
  14. 1 1
      EVSE/Projects/DD360/Apps/ModuleDoComm/DoComm.h
  15. 0 1
      EVSE/Projects/DD360/Apps/ModuleEvComm/Module_EvCommOrg.c
  16. 21 2
      EVSE/Projects/DD360/Apps/ModuleEvComm/Module_EvRxComm.c
  17. 57 2
      EVSE/Projects/DD360/Apps/ModuleEvComm/Module_EvTxComm.c
  18. 1 0
      EVSE/Projects/DD360/Apps/ModuleEventLog/Module_EventLogging.c
  19. 9 4
      EVSE/Projects/DD360/Apps/ModuleInternalComm/RelayBoard.c
  20. 352 359
      EVSE/Projects/DD360/Apps/ReadCmdline.c
  21. 5 0
      EVSE/Projects/DD360/Apps/ShareMemory/shmMem.c
  22. 1 0
      EVSE/Projects/DD360/Apps/ShareMemory/shmMem.h
  23. BIN
      EVSE/Projects/DD360/Images/FactoryDefaultConfig.bin
  24. BIN
      EVSE/Projects/DD360/Images/ramdisk.gz
  25. BIN
      EVSE/Projects/DD360/output/FactoryConfig
  26. BIN
      EVSE/Projects/DD360/output/Module_DoComm
  27. BIN
      EVSE/Projects/DD360/output/Module_EvComm
  28. BIN
      EVSE/Projects/DD360/output/Module_EventLogging
  29. BIN
      EVSE/Projects/DD360/output/Module_InternalComm
  30. BIN
      EVSE/Projects/DD360/output/Module_LcmControl
  31. BIN
      EVSE/Projects/DD360/output/Module_PrimaryComm
  32. BIN
      EVSE/Projects/DD360/output/ReadCmdline
  33. BIN
      EVSE/Projects/DD360/output/main
  34. 130 1201
      EVSE/Projects/DD360Audi/Apps/CSU/main.c
  35. 1 1
      EVSE/Projects/DD360Audi/Apps/CSU/main.h
  36. 18 4
      EVSE/Projects/DD360Audi/Apps/Config.h
  37. 1 1
      EVSE/Projects/DD360Audi/Apps/FactoryConfig.c
  38. 9 2
      EVSE/Projects/DD360Audi/Apps/Makefile
  39. 20 11
      EVSE/Projects/DD360Audi/Apps/ModuleDoComm/DoComm.c
  40. 1 1
      EVSE/Projects/DD360Audi/Apps/ModuleDoComm/DoComm.h
  41. 0 1
      EVSE/Projects/DD360Audi/Apps/ModuleEvComm/Module_EvCommOrg.c
  42. 21 2
      EVSE/Projects/DD360Audi/Apps/ModuleEvComm/Module_EvRxComm.c
  43. 57 2
      EVSE/Projects/DD360Audi/Apps/ModuleEvComm/Module_EvTxComm.c
  44. 1 0
      EVSE/Projects/DD360Audi/Apps/ModuleEventLog/Module_EventLogging.c
  45. 9 4
      EVSE/Projects/DD360Audi/Apps/ModuleInternalComm/RelayBoard.c
  46. 352 359
      EVSE/Projects/DD360Audi/Apps/ReadCmdline.c
  47. 5 0
      EVSE/Projects/DD360Audi/Apps/ShareMemory/shmMem.c
  48. 1 0
      EVSE/Projects/DD360Audi/Apps/ShareMemory/shmMem.h
  49. BIN
      EVSE/Projects/DD360Audi/Images/FactoryDefaultConfig.bin
  50. BIN
      EVSE/Projects/DD360Audi/Images/MLO
  51. BIN
      EVSE/Projects/DD360Audi/Images/ramdisk.gz
  52. BIN
      EVSE/Projects/DD360Audi/Images/u-boot-spl.bin
  53. BIN
      EVSE/Projects/DD360Audi/Images/u-boot.img
  54. BIN
      EVSE/Projects/DD360Audi/Images/zImage
  55. BIN
      EVSE/Projects/DD360Audi/output/FactoryConfig
  56. BIN
      EVSE/Projects/DD360Audi/output/Module_DoComm
  57. BIN
      EVSE/Projects/DD360Audi/output/Module_EvComm
  58. BIN
      EVSE/Projects/DD360Audi/output/Module_EventLogging
  59. BIN
      EVSE/Projects/DD360Audi/output/Module_FactoryConfig
  60. BIN
      EVSE/Projects/DD360Audi/output/Module_InternalComm
  61. BIN
      EVSE/Projects/DD360Audi/output/Module_LcmControl
  62. BIN
      EVSE/Projects/DD360Audi/output/Module_PrimaryComm
  63. BIN
      EVSE/Projects/DD360Audi/output/ReadCmdline
  64. BIN
      EVSE/Projects/DD360Audi/output/main
  65. 130 1201
      EVSE/Projects/DD360ComBox/Apps/CSU/main.c
  66. 1 1
      EVSE/Projects/DD360ComBox/Apps/CSU/main.h
  67. 18 4
      EVSE/Projects/DD360ComBox/Apps/Config.h
  68. 1 1
      EVSE/Projects/DD360ComBox/Apps/FactoryConfig.c
  69. 9 2
      EVSE/Projects/DD360ComBox/Apps/Makefile
  70. 20 11
      EVSE/Projects/DD360ComBox/Apps/ModuleDoComm/DoComm.c
  71. 1 1
      EVSE/Projects/DD360ComBox/Apps/ModuleDoComm/DoComm.h
  72. 0 1
      EVSE/Projects/DD360ComBox/Apps/ModuleEvComm/Module_EvCommOrg.c
  73. 21 2
      EVSE/Projects/DD360ComBox/Apps/ModuleEvComm/Module_EvRxComm.c
  74. 57 2
      EVSE/Projects/DD360ComBox/Apps/ModuleEvComm/Module_EvTxComm.c
  75. 1 0
      EVSE/Projects/DD360ComBox/Apps/ModuleEventLog/Module_EventLogging.c
  76. 9 4
      EVSE/Projects/DD360ComBox/Apps/ModuleInternalComm/RelayBoard.c
  77. 352 359
      EVSE/Projects/DD360ComBox/Apps/ReadCmdline.c
  78. 5 0
      EVSE/Projects/DD360ComBox/Apps/ShareMemory/shmMem.c
  79. 1 0
      EVSE/Projects/DD360ComBox/Apps/ShareMemory/shmMem.h
  80. BIN
      EVSE/Projects/DD360ComBox/Images/FactoryDefaultConfig.bin
  81. BIN
      EVSE/Projects/DD360ComBox/Images/ramdisk.gz
  82. BIN
      EVSE/Projects/DD360ComBox/output/FactoryConfig
  83. BIN
      EVSE/Projects/DD360ComBox/output/Module_DoComm
  84. BIN
      EVSE/Projects/DD360ComBox/output/Module_EvComm
  85. BIN
      EVSE/Projects/DD360ComBox/output/Module_EventLogging
  86. BIN
      EVSE/Projects/DD360ComBox/output/Module_InternalComm
  87. BIN
      EVSE/Projects/DD360ComBox/output/Module_LcmControl
  88. BIN
      EVSE/Projects/DD360ComBox/output/Module_PrimaryComm
  89. BIN
      EVSE/Projects/DD360ComBox/output/ReadCmdline
  90. BIN
      EVSE/Projects/DD360ComBox/output/main
  91. 63 7
      EVSE/rootfs/var/www/set_charging.php
  92. 2 150
      EVSE/rootfs/var/www/set_system.php

+ 69 - 9
EVSE/Modularization/WebService.c

@@ -1479,6 +1479,7 @@ int main(int argc, char *argv[]) {
 		struct json_object *StopDateTime[3];
 		struct json_object *StartMethod[3];
 		struct json_object *ConnectorTemp[3];
+		struct json_object *ChillerTemp[3];
 		struct json_object *PresentChargingVoltage[3];
 		struct json_object *PresentChargingCurrent[3];
 		struct json_object *PresentChargingPower[3];
@@ -1501,6 +1502,7 @@ int main(int argc, char *argv[]) {
 		struct json_object *DDStopDateTime[4];
 		struct json_object *DDStartMethod[4];
 		struct json_object *DDConnectorTemp[4];
+		struct json_object *DDChillerTemp[4];
 		struct json_object *DDPresentChargingVoltage[4];
 		struct json_object *DDPresentChargingCurrent[4];
 		struct json_object *DDPresentChargingPower[4];
@@ -1765,6 +1767,12 @@ int main(int argc, char *argv[]) {
 				else{
 					ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp-60);
 				}
+				if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 255){
+					ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp);
+				}
+				else{
+					ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp-60);
+				}
 				PowerConsumption[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PowerConsumption);
 				CcsGunQty++;
 			}
@@ -1784,13 +1792,18 @@ int main(int argc, char *argv[]) {
 				StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
 				StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
 				StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
-				ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
 				if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 255){
 					ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
 				}
 				else{
 					ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp-60);
 				}
+				if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 255){
+					ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp);
+				}
+				else{
+					ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp-60);
+				}
 				PowerConsumption[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PowerConsumption);
 				GbGunQty++;
 			}
@@ -1810,13 +1823,18 @@ int main(int argc, char *argv[]) {
 				StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
 				StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
 				StartMethod[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
-				ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
 				if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 255){
 					ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
 				}
 				else{
 					ConnectorTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp-60);
 				}
+				if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 255){
+					ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp);
+				}
+				else{
+					ChillerTemp[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp-60);
+				}
 				PowerConsumption[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PowerConsumption);
 				CHAdeMOGunQty++;
 			}
@@ -1858,13 +1876,18 @@ int main(int argc, char *argv[]) {
 				StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
 				StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
 				StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartMethod);
-				ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
 				if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 255){
 					ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
 				}
 				else{
 					ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp-60);
 				}
+				if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 255){
+					ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp);
+				}
+				else{
+					ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp-60);
+				}
 				PowerConsumption[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PowerConsumption);
 				CcsGunQty++;
 			}
@@ -1884,13 +1907,18 @@ int main(int argc, char *argv[]) {
 				StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
 				StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
 				StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
-				ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
 				if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 255){
 					ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
 				}
 				else{
 					ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp-60);
 				}
+				if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 255){
+					ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp);
+				}
+				else{
+					ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp-60);
+				}
 				PowerConsumption[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PowerConsumption);
 				GbGunQty++;
 			}
@@ -1910,13 +1938,18 @@ int main(int argc, char *argv[]) {
 				StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
 				StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
 				StartMethod[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
-				ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
 				if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 255){
 					ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
 				}
 				else{
 					ConnectorTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp-60);
 				}
+				if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 255){
+					ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp);
+				}
+				else{
+					ChillerTemp[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp-60);
+				}
 				PowerConsumption[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PowerConsumption);
 				CHAdeMOGunQty++;
 			}
@@ -1958,13 +1991,18 @@ int main(int argc, char *argv[]) {
 				StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
 				StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
 				StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartMethod);
-				ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
 				if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 0 ||ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp == 255){
 					ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp);
 				}
 				else{
 					ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ConnectorTemp-60);
 				}
+				if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 0 ||ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp == 255){
+					ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp);
+				}
+				else{
+					ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].ChillerTemp-60);
+				}
 				PowerConsumption[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PowerConsumption);
 				CcsGunQty++;
 			}
@@ -1984,13 +2022,18 @@ int main(int argc, char *argv[]) {
 				StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
 				StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
 				StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartMethod);
-				ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
 				if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp == 255){
 					ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp);
 				}
 				else{
 					ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ConnectorTemp-60);
 				}
+				if(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp == 255){
+					ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp);
+				}
+				else{
+					ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].ChillerTemp-60);
+				}
 				PowerConsumption[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].PowerConsumption);
 				GbGunQty++;
 			}
@@ -2010,13 +2053,18 @@ int main(int argc, char *argv[]) {
 				StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
 				StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
 				StartMethod[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartMethod);
-				ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
 				if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp == 255){
 					ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp);
 				}
 				else{
 					ConnectorTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ConnectorTemp-60);
 				}
+				if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp == 255){
+					ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp);
+				}
+				else{
+					ChillerTemp[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].ChillerTemp-60);
+				}
 				PowerConsumption[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].PowerConsumption);
 				CHAdeMOGunQty++;
 			}
@@ -2060,13 +2108,18 @@ int main(int argc, char *argv[]) {
 				DDStartDateTime[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.StartDateTime);
 				DDStopDateTime[i] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.StopDateTime);
 				DDStartMethod[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.StartMethod);
-				DDConnectorTemp[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ConnectorTemp);
 				if(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ConnectorTemp == 0 || ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ConnectorTemp == 255){
 					ConnectorTemp[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ConnectorTemp);
 				}
 				else{
 					ConnectorTemp[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ConnectorTemp-60);
 				}
+				if(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ChillerTemp == 0 || ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ChillerTemp == 255){
+					ChillerTemp[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ChillerTemp);
+				}
+				else{
+					ChillerTemp[i] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.ChillerTemp-60);
+				}
 				DDPowerConsumption[i] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[i].GeneralChargingData.PowerConsumption);
 			}
 		}
@@ -2267,6 +2320,7 @@ int main(int argc, char *argv[]) {
 			json_object_object_add(ChargingInfo1,"StopDateTime",StopDateTime[0]);
 			json_object_object_add(ChargingInfo1,"StartMethod",StartMethod[0]);
 			json_object_object_add(ChargingInfo1,"ConnectorTemp",ConnectorTemp[0]);
+			json_object_object_add(ChargingInfo1,"ChillerTemp",ChillerTemp[0]);
 			json_object_object_add(ChargingInfo1,"PresentChargingVoltage",PresentChargingVoltage[0]);
 			json_object_object_add(ChargingInfo1,"PresentChargingCurrent",PresentChargingCurrent[0]);
 			json_object_object_add(ChargingInfo1,"PresentChargingPower",PresentChargingPower[0]);
@@ -2287,6 +2341,7 @@ int main(int argc, char *argv[]) {
 			json_object_object_add(ChargingInfo2,"StopDateTime",StopDateTime[1]);
 			json_object_object_add(ChargingInfo2,"StartMethod",StartMethod[1]);
 			json_object_object_add(ChargingInfo2,"ConnectorTemp",ConnectorTemp[1]);
+			json_object_object_add(ChargingInfo2,"ChillerTemp",ChillerTemp[1]);
 			json_object_object_add(ChargingInfo2,"PresentChargingVoltage",PresentChargingVoltage[1]);
 			json_object_object_add(ChargingInfo2,"PresentChargingCurrent",PresentChargingCurrent[1]);
 			json_object_object_add(ChargingInfo2,"PresentChargingPower",PresentChargingPower[1]);
@@ -2307,6 +2362,7 @@ int main(int argc, char *argv[]) {
 			json_object_object_add(ChargingInfo3,"StopDateTime",StopDateTime[2]);
 			json_object_object_add(ChargingInfo3,"StartMethod",StartMethod[2]);
 			json_object_object_add(ChargingInfo3,"ConnectorTemp",ConnectorTemp[2]);
+			json_object_object_add(ChargingInfo3,"ChillerTemp",ChillerTemp[2]);
 			json_object_object_add(ChargingInfo3,"PresentChargingVoltage",PresentChargingVoltage[2]);
 			json_object_object_add(ChargingInfo3,"PresentChargingCurrent",PresentChargingCurrent[2]);
 			json_object_object_add(ChargingInfo3,"PresentChargingPower",PresentChargingPower[2]);
@@ -2334,6 +2390,7 @@ int main(int argc, char *argv[]) {
 				json_object_object_add(DDChargingInfo1,"StopDateTime",DDStopDateTime[0]);
 				json_object_object_add(DDChargingInfo1,"StartMethod",DDStartMethod[0]);
 				json_object_object_add(DDChargingInfo1,"ConnectorTemp",DDConnectorTemp[0]);
+				json_object_object_add(DDChargingInfo1,"ChillerTemp",DDChillerTemp[0]);
 				json_object_object_add(DDChargingInfo1,"PresentChargingVoltage",DDPresentChargingVoltage[0]);
 				json_object_object_add(DDChargingInfo1,"PresentChargingCurrent",DDPresentChargingCurrent[0]);
 				json_object_object_add(DDChargingInfo1,"PresentChargingPower",DDPresentChargingPower[0]);
@@ -2354,6 +2411,7 @@ int main(int argc, char *argv[]) {
 				json_object_object_add(DDChargingInfo2,"StopDateTime",DDStopDateTime[1]);
 				json_object_object_add(DDChargingInfo2,"StartMethod",DDStartMethod[1]);
 				json_object_object_add(DDChargingInfo2,"ConnectorTemp",DDConnectorTemp[1]);
+				json_object_object_add(DDChargingInfo2,"ChillerTemp",DDChillerTemp[1]);
 				json_object_object_add(DDChargingInfo2,"PresentChargingVoltage",DDPresentChargingVoltage[1]);
 				json_object_object_add(DDChargingInfo2,"PresentChargingCurrent",DDPresentChargingCurrent[1]);
 				json_object_object_add(DDChargingInfo2,"PresentChargingPower",DDPresentChargingPower[1]);
@@ -2374,6 +2432,7 @@ int main(int argc, char *argv[]) {
 				json_object_object_add(DDChargingInfo3,"StopDateTime",DDStopDateTime[2]);
 				json_object_object_add(DDChargingInfo3,"StartMethod",DDStartMethod[2]);
 				json_object_object_add(DDChargingInfo3,"ConnectorTemp",DDConnectorTemp[2]);
+				json_object_object_add(DDChargingInfo3,"ChillerTemp",DDChillerTemp[2]);
 				json_object_object_add(DDChargingInfo3,"PresentChargingVoltage",DDPresentChargingVoltage[2]);
 				json_object_object_add(DDChargingInfo3,"PresentChargingCurrent",DDPresentChargingCurrent[2]);
 				json_object_object_add(DDChargingInfo3,"PresentChargingPower",DDPresentChargingPower[2]);
@@ -2394,6 +2453,7 @@ int main(int argc, char *argv[]) {
 				json_object_object_add(DDChargingInfo4,"StopDateTime",DDStopDateTime[3]);
 				json_object_object_add(DDChargingInfo4,"StartMethod",DDStartMethod[3]);
 				json_object_object_add(DDChargingInfo4,"ConnectorTemp",DDConnectorTemp[3]);
+				json_object_object_add(DDChargingInfo4,"ChillerTemp",DDChillerTemp[3]);
 				json_object_object_add(DDChargingInfo4,"PresentChargingVoltage",DDPresentChargingVoltage[3]);
 				json_object_object_add(DDChargingInfo4,"PresentChargingCurrent",DDPresentChargingCurrent[3]);
 				json_object_object_add(DDChargingInfo4,"PresentChargingPower",DDPresentChargingPower[3]);

+ 127 - 0
EVSE/Projects/AW-ChargeLab/Apps/Module_ConfigTools.c

@@ -247,6 +247,7 @@ int main(void)
 		printf("\n  system: system configuration menu.");
 		printf("\n  ocpp: ocpp configuration menu.");
 		printf("\n  network: netwok configuration menu.");
+		printf("\n  test: charger start/stop test.");
 		printf("\n  upgrade: trigger firmware upgrade.");
 		printf("\n  save: Save config.");
 		printf("\n  exit: Exit config tools.");
@@ -261,6 +262,8 @@ int main(void)
 			printf("\n ***** system configuration menu ******************");
 			printf("\n  modelname: EVSE model name.");
 			printf("\n  serialnumber: EVSE serial number.");
+			printf("\n  authentication: Authentication function.");
+			printf("\n  rfidendian: RFID read endian.");
 			printf("\n *************************************************");
 			printf("\n  Please input operation item: ");
 			scanf("%s", &cmd[0]);
@@ -305,6 +308,34 @@ int main(void)
 					strcpy((char*)&ShmSysConfigAndInfo->SysConfig.SerialNumber[0], (char*)&cmd[0]);
 				}
 			}
+			else if(strcmp(cmd, "authentication") == 0)
+			{
+				memset(cmd, 0x00, ARRAY_SIZE(cmd));
+				printf("\n *************************************************");
+				printf("\n  0: Enable.");
+				printf("\n  1: Disable.");
+				printf("\n *************************************************");
+
+				printf("\n  Current mode: %d", ShmSysConfigAndInfo->SysConfig.AuthorisationMode);
+				printf("\n  Please input authentication mode: ");
+				scanf("%s", &cmd[0]);
+
+				ShmSysConfigAndInfo->SysConfig.AuthorisationMode = ((0<=atoi(cmd))&&(atoi(cmd)<=1)?atoi(cmd):0);
+			}
+			else if(strcmp(cmd, "rfidendian") == 0)
+			{
+				memset(cmd, 0x00, ARRAY_SIZE(cmd));
+				printf("\n *************************************************");
+				printf("\n  0: Little endian.");
+				printf("\n  1: Big endian.");
+				printf("\n *************************************************");
+
+				printf("\n  Current mode: %d", ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian);
+				printf("\n  Please input rfid endian mode: ");
+				scanf("%s", &cmd[0]);
+
+				ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian = ((0<=atoi(cmd))&&(atoi(cmd)<=1)?atoi(cmd):0);
+			}
 		}
 		else if(strcmp(cmd, "ocpp") == 0)
 		{
@@ -312,6 +343,9 @@ int main(void)
 			printf("\n *************************************************");
 			printf("\n  ocppurl: OCPP backend server url.");
 			printf("\n  cboxid: Charger box id.");
+			printf("\n  vender: Charger point vender.");
+			printf("\n  offlinepolicy: Charger off line policy.");
+			printf("\n  localloadbalance: Charger local load balance.");
 			printf("\n *************************************************");
 			printf("\n  Please input operation item: ");
 			scanf("%s", &cmd[0]);
@@ -356,6 +390,55 @@ int main(void)
 					strcpy((char*)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId[0], (char*)&cmd[0]);
 				}
 			}
+			else if(strcmp(cmd, "vender") == 0)
+			{
+				memset(cmd, 0x00, ARRAY_SIZE(cmd));
+				printf("\n *************************************************");
+				printf("\n  Current OCPP vender: %s", ShmSysConfigAndInfo->SysConfig.chargePointVendor);
+				printf("\n  0: Keep current config.");
+				printf("\n  1: Input new charger box id.");
+				printf("\n *************************************************");
+				printf("\n  Please input operation item: ");
+				scanf("%s", &cmd[0]);
+
+				if(atoi(cmd) == 1)
+				{
+					printf("\n  Please input OCPP vender: ");
+					scanf("%s", &cmd[0]);
+
+					memset(&ShmSysConfigAndInfo->SysConfig.chargePointVendor[0], 0x00, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.chargePointVendor));
+					strcpy((char*)&ShmSysConfigAndInfo->SysConfig.chargePointVendor[0], (char*)&cmd[0]);
+				}
+			}
+			else if(strcmp(cmd, "offlinepolicy") == 0)
+			{
+				memset(cmd, 0x00, ARRAY_SIZE(cmd));
+				printf("\n *************************************************");
+				printf("\n  0: Local list.");
+				printf("\n  2: Free charging.");
+				printf("\n  3: Deny charging.");
+				printf("\n *************************************************");
+
+				printf("\n  Current mode: %d", ShmSysConfigAndInfo->SysConfig.OfflinePolicy);
+				printf("\n  Please input off line policy mode: ");
+				scanf("%s", &cmd[0]);
+
+				ShmSysConfigAndInfo->SysConfig.OfflinePolicy = ((0<=atoi(cmd))&&(atoi(cmd)<=3)&&(atoi(cmd)!=1)?atoi(cmd):0);
+			}
+			else if(strcmp(cmd, "localloadbalance") == 0)
+			{
+				memset(cmd, 0x00, ARRAY_SIZE(cmd));
+				printf("\n *************************************************");
+				printf("\n  0: Disable.");
+				printf("\n  1: Enable.");
+				printf("\n *************************************************");
+
+				printf("\n  Current mode: %d", ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharging);
+				printf("\n  Please input local load balance mode: ");
+				scanf("%s", &cmd[0]);
+
+				ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharging = ((0<=atoi(cmd))&&(atoi(cmd)<=1)?atoi(cmd):0);
+			}
 		}
 		else if(strcmp(cmd, "network") == 0)
 		{
@@ -532,6 +615,50 @@ int main(void)
 				}
 			}
 		}
+		else if(strcmp(cmd, "test") == 0)
+		{
+			memset(cmd, 0x00, ARRAY_SIZE(cmd));
+			printf("\n ***** test menu ******************");
+			printf("\n  start: EVSE start charging request.");
+			printf("\n  stop: EVSE stop charging request.");
+			printf("\n  cancel: return to main menu.");
+			printf("\n *************************************************");
+			printf("\n  Please input operation item: ");
+			scanf("%s", &cmd[0]);
+
+			if(strcmp(cmd, "start") == 0)
+			{
+				memset(cmd, 0x00, ARRAY_SIZE(cmd));
+				printf("\n  Please input gun index(1~2): ");
+				scanf("%s", &cmd[0]);
+
+				if((0 < atoi(cmd)) && (atoi(cmd) < 3))
+				{
+					ShmSysConfigAndInfo->SysInfo.AcChargingData[atoi(cmd)-1].schedule.isTriggerStart = ON;
+				}
+				else
+				{
+					printf("\n  Invalid input gun_index.");
+				}
+			}
+			else if(strcmp(cmd, "stop") == 0)
+			{
+				memset(cmd, 0x00, ARRAY_SIZE(cmd));
+				printf("\n  Please input gun index(1~2): ");
+				scanf("%s", &cmd[0]);
+
+				if((0 < atoi(cmd)) && (atoi(cmd) < 3))
+				{
+					ShmSysConfigAndInfo->SysInfo.AcChargingData[atoi(cmd)-1].schedule.isTriggerStop = ON;
+				}
+				else
+				{
+					printf("\n  Invalid input gun_index.");
+				}
+			}
+			else if(strcmp(cmd, "cancel") == 0)
+			{}
+		}
 		else if(strcmp(cmd, "upgrade") == 0)
 		{
 			printf("\n  Firmware upgrade trigger.");

+ 47 - 1
EVSE/Projects/AW-ChargeLab/Apps/main.c

@@ -34,6 +34,9 @@
 #define TIMEOUT_SPEC_PROFILE_PREPARE	5000
 #define TIMEOUT_SPEC_PWN_CHANGE			5000
 
+#define SPEC_TEMPERATURE_WARN			75
+#define SPEC_TEMPERATURE_RECOVER		65
+
 #define MtdBlockSize 					0x300000
 
 #define DB_FILE							"/Storage/ChargeLog/localCgargingRecord.db"
@@ -1611,7 +1614,7 @@ int LoadSysConfigAndInfo(struct SysConfigData *ptr)
 	free(buf);
 
 	system("rm -f /mnt/EvseConfig.bin");
-
+	
 	// SysConfig in flash is empty (0xffffffff)
 	if((strlen((char*)ShmSysConfigAndInfo->SysConfig.ModelName) > ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.ModelName)) ||
 	   (strlen((char*)ShmSysConfigAndInfo->SysConfig.SerialNumber) > ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.SerialNumber)) ||
@@ -4218,6 +4221,17 @@ int main(void)
 						// Checking profile id > 0 and current time is between charging profile validFrom & validTo
 						checkChargingProfileLimit(gun_index);
 
+						// If temperature warning derating PWM duty 20%
+						if(ShmSysConfigAndInfo->SysInfo.SystemAmbientTemp >= SPEC_TEMPERATURE_WARN)
+						{
+							ShmCharger->gun_info[gun_index].tempCoefficient = 0.8;
+						}
+						else if(ShmSysConfigAndInfo->SysInfo.SystemAmbientTemp <= SPEC_TEMPERATURE_RECOVER)
+						{
+							ShmCharger->gun_info[gun_index].tempCoefficient = 1.0;
+						}
+						ShmCharger->gun_info[gun_index].targetCurrent = (ShmCharger->gun_info[gun_index].targetCurrent==0?ShmCharger->gun_info[gun_index].targetCurrent:(((ShmCharger->gun_info[gun_index].targetCurrent*ShmCharger->gun_info[gun_index].tempCoefficient)>=6) ?	(ShmCharger->gun_info[gun_index].targetCurrent*ShmCharger->gun_info[gun_index].tempCoefficient):6));
+
 						// Determine max charging current to MCU
 						if(ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent == 0)
 						{
@@ -4522,6 +4536,38 @@ int main(void)
 							}
 						}
 
+						// Charging profile preparation
+						if(DiffTimebWithNow(startTime[gun_index][TMR_IDX_PROFILE_PREPARE]) > TIMEOUT_SPEC_PROFILE_PREPARE)
+						{
+							if(!ocpp_get_profile_conf(gun_index))
+							{
+								ocpp_set_profile_req(gun_index, ON);
+								ftime(&startTime[gun_index][TMR_IDX_PROFILE_PREPARE]);
+							}
+							else
+							{
+								ocpp_set_profile_conf(gun_index, OFF);
+							}
+						}
+
+						// Check target current if charging profile limit > 0
+						checkChargingProfileLimit(gun_index);
+						if(ShmCharger->gun_info[gun_index].targetCurrent > 0)
+						{
+							setRelay(gun_index, ON);
+						}
+
+						// Debug information
+						if(DiffTimebWithNow(startTime[gun_index][TMR_IDX_LOGPPRINTOUT]) > TIMEOUT_SPEC_LOGPPRINTOUT)
+						{
+							DEBUG_INFO("=============================================================\n");
+							DEBUG_INFO("ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent: %d\n", ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent);
+							DEBUG_INFO("ShmCharger->gun_info[%d].primaryMcuCp_Pwn_Duty.max_current: %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current);
+							DEBUG_INFO("ShmCharger->gun_info[%d].targetCurrent: %d\n", gun_index, ShmCharger->gun_info[gun_index].targetCurrent);
+							DEBUG_INFO("=============================================================\n");
+							ftime(&startTime[gun_index][TMR_IDX_LOGPPRINTOUT]);
+						}
+
 						if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_C) &&
 						   (ShmCharger->gun_info[gun_index].rfidReq != ON) &&
 						   (ShmCharger->gun_info[gun_index].bleConfigData.isRequestStop != ON)  &&

+ 1 - 0
EVSE/Projects/AW-ChargeLab/Apps/main.h

@@ -413,6 +413,7 @@ typedef struct GUN_INFO
 	Set_Led_Brightness								setLedBrightness;
 	uint8_t											chargingMode;
 	uint16_t										targetCurrent;
+	float											tempCoefficient;
 	uint16_t										isAuthPassEnd:1;
 	uint16_t										rfidReq:1;
 	uint16_t										isGunPlugged:1;

+ 127 - 0
EVSE/Projects/AW-Regular/Apps/Module_ConfigTools.c

@@ -247,6 +247,7 @@ int main(void)
 		printf("\n  system: system configuration menu.");
 		printf("\n  ocpp: ocpp configuration menu.");
 		printf("\n  network: netwok configuration menu.");
+		printf("\n  test: charger start/stop test.");
 		printf("\n  upgrade: trigger firmware upgrade.");
 		printf("\n  save: Save config.");
 		printf("\n  exit: Exit config tools.");
@@ -261,6 +262,8 @@ int main(void)
 			printf("\n ***** system configuration menu ******************");
 			printf("\n  modelname: EVSE model name.");
 			printf("\n  serialnumber: EVSE serial number.");
+			printf("\n  authentication: Authentication function.");
+			printf("\n  rfidendian: RFID read endian.");
 			printf("\n *************************************************");
 			printf("\n  Please input operation item: ");
 			scanf("%s", &cmd[0]);
@@ -305,6 +308,34 @@ int main(void)
 					strcpy((char*)&ShmSysConfigAndInfo->SysConfig.SerialNumber[0], (char*)&cmd[0]);
 				}
 			}
+			else if(strcmp(cmd, "authentication") == 0)
+			{
+				memset(cmd, 0x00, ARRAY_SIZE(cmd));
+				printf("\n *************************************************");
+				printf("\n  0: Enable.");
+				printf("\n  1: Disable.");
+				printf("\n *************************************************");
+
+				printf("\n  Current mode: %d", ShmSysConfigAndInfo->SysConfig.AuthorisationMode);
+				printf("\n  Please input authentication mode: ");
+				scanf("%s", &cmd[0]);
+
+				ShmSysConfigAndInfo->SysConfig.AuthorisationMode = ((0<=atoi(cmd))&&(atoi(cmd)<=1)?atoi(cmd):0);
+			}
+			else if(strcmp(cmd, "rfidendian") == 0)
+			{
+				memset(cmd, 0x00, ARRAY_SIZE(cmd));
+				printf("\n *************************************************");
+				printf("\n  0: Little endian.");
+				printf("\n  1: Big endian.");
+				printf("\n *************************************************");
+
+				printf("\n  Current mode: %d", ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian);
+				printf("\n  Please input rfid endian mode: ");
+				scanf("%s", &cmd[0]);
+
+				ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian = ((0<=atoi(cmd))&&(atoi(cmd)<=1)?atoi(cmd):0);
+			}
 		}
 		else if(strcmp(cmd, "ocpp") == 0)
 		{
@@ -312,6 +343,9 @@ int main(void)
 			printf("\n *************************************************");
 			printf("\n  ocppurl: OCPP backend server url.");
 			printf("\n  cboxid: Charger box id.");
+			printf("\n  vender: Charger point vender.");
+			printf("\n  offlinepolicy: Charger off line policy.");
+			printf("\n  localloadbalance: Charger local load balance.");
 			printf("\n *************************************************");
 			printf("\n  Please input operation item: ");
 			scanf("%s", &cmd[0]);
@@ -356,6 +390,55 @@ int main(void)
 					strcpy((char*)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId[0], (char*)&cmd[0]);
 				}
 			}
+			else if(strcmp(cmd, "vender") == 0)
+			{
+				memset(cmd, 0x00, ARRAY_SIZE(cmd));
+				printf("\n *************************************************");
+				printf("\n  Current OCPP vender: %s", ShmSysConfigAndInfo->SysConfig.chargePointVendor);
+				printf("\n  0: Keep current config.");
+				printf("\n  1: Input new charger box id.");
+				printf("\n *************************************************");
+				printf("\n  Please input operation item: ");
+				scanf("%s", &cmd[0]);
+
+				if(atoi(cmd) == 1)
+				{
+					printf("\n  Please input OCPP vender: ");
+					scanf("%s", &cmd[0]);
+
+					memset(&ShmSysConfigAndInfo->SysConfig.chargePointVendor[0], 0x00, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.chargePointVendor));
+					strcpy((char*)&ShmSysConfigAndInfo->SysConfig.chargePointVendor[0], (char*)&cmd[0]);
+				}
+			}
+			else if(strcmp(cmd, "offlinepolicy") == 0)
+			{
+				memset(cmd, 0x00, ARRAY_SIZE(cmd));
+				printf("\n *************************************************");
+				printf("\n  0: Local list.");
+				printf("\n  2: Free charging.");
+				printf("\n  3: Deny charging.");
+				printf("\n *************************************************");
+
+				printf("\n  Current mode: %d", ShmSysConfigAndInfo->SysConfig.OfflinePolicy);
+				printf("\n  Please input off line policy mode: ");
+				scanf("%s", &cmd[0]);
+
+				ShmSysConfigAndInfo->SysConfig.OfflinePolicy = ((0<=atoi(cmd))&&(atoi(cmd)<=3)&&(atoi(cmd)!=1)?atoi(cmd):0);
+			}
+			else if(strcmp(cmd, "localloadbalance") == 0)
+			{
+				memset(cmd, 0x00, ARRAY_SIZE(cmd));
+				printf("\n *************************************************");
+				printf("\n  0: Disable.");
+				printf("\n  1: Enable.");
+				printf("\n *************************************************");
+
+				printf("\n  Current mode: %d", ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharging);
+				printf("\n  Please input local load balance mode: ");
+				scanf("%s", &cmd[0]);
+
+				ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharging = ((0<=atoi(cmd))&&(atoi(cmd)<=1)?atoi(cmd):0);
+			}
 		}
 		else if(strcmp(cmd, "network") == 0)
 		{
@@ -532,6 +615,50 @@ int main(void)
 				}
 			}
 		}
+		else if(strcmp(cmd, "test") == 0)
+		{
+			memset(cmd, 0x00, ARRAY_SIZE(cmd));
+			printf("\n ***** test menu ******************");
+			printf("\n  start: EVSE start charging request.");
+			printf("\n  stop: EVSE stop charging request.");
+			printf("\n  cancel: return to main menu.");
+			printf("\n *************************************************");
+			printf("\n  Please input operation item: ");
+			scanf("%s", &cmd[0]);
+
+			if(strcmp(cmd, "start") == 0)
+			{
+				memset(cmd, 0x00, ARRAY_SIZE(cmd));
+				printf("\n  Please input gun index(1~2): ");
+				scanf("%s", &cmd[0]);
+
+				if((0 < atoi(cmd)) && (atoi(cmd) < 3))
+				{
+					ShmSysConfigAndInfo->SysInfo.AcChargingData[atoi(cmd)-1].schedule.isTriggerStart = ON;
+				}
+				else
+				{
+					printf("\n  Invalid input gun_index.");
+				}
+			}
+			else if(strcmp(cmd, "stop") == 0)
+			{
+				memset(cmd, 0x00, ARRAY_SIZE(cmd));
+				printf("\n  Please input gun index(1~2): ");
+				scanf("%s", &cmd[0]);
+
+				if((0 < atoi(cmd)) && (atoi(cmd) < 3))
+				{
+					ShmSysConfigAndInfo->SysInfo.AcChargingData[atoi(cmd)-1].schedule.isTriggerStop = ON;
+				}
+				else
+				{
+					printf("\n  Invalid input gun_index.");
+				}
+			}
+			else if(strcmp(cmd, "cancel") == 0)
+			{}
+		}
 		else if(strcmp(cmd, "upgrade") == 0)
 		{
 			printf("\n  Firmware upgrade trigger.");

+ 47 - 1
EVSE/Projects/AW-Regular/Apps/main.c

@@ -34,6 +34,9 @@
 #define TIMEOUT_SPEC_PROFILE_PREPARE	5000
 #define TIMEOUT_SPEC_PWN_CHANGE			5000
 
+#define SPEC_TEMPERATURE_WARN			75
+#define SPEC_TEMPERATURE_RECOVER		65
+
 #define MtdBlockSize 					0x300000
 
 #define DB_FILE							"/Storage/ChargeLog/localCgargingRecord.db"
@@ -2146,7 +2149,7 @@ void get_firmware_version(unsigned char gun_index)
 	strcpy((char*)ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev, ShmCharger->gun_info[gun_index].ver.Version_FW);
 
 	// Get CSU root file system version
-	sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "V0.68.00.0000.00");
+	sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "V0.69.00.0000.00");
 
 	// Get AC connector type from model name
 	for(uint8_t idx=0;idx<3;idx++)
@@ -4218,6 +4221,17 @@ int main(void)
 						// Checking profile id > 0 and current time is between charging profile validFrom & validTo
 						checkChargingProfileLimit(gun_index);
 
+						// If temperature warning derating PWM duty 20%
+						if(ShmSysConfigAndInfo->SysInfo.SystemAmbientTemp >= SPEC_TEMPERATURE_WARN)
+						{
+							ShmCharger->gun_info[gun_index].tempCoefficient = 0.8;
+						}
+						else if(ShmSysConfigAndInfo->SysInfo.SystemAmbientTemp <= SPEC_TEMPERATURE_RECOVER)
+						{
+							ShmCharger->gun_info[gun_index].tempCoefficient = 1.0;
+						}
+						ShmCharger->gun_info[gun_index].targetCurrent = (ShmCharger->gun_info[gun_index].targetCurrent==0?ShmCharger->gun_info[gun_index].targetCurrent:(((ShmCharger->gun_info[gun_index].targetCurrent*ShmCharger->gun_info[gun_index].tempCoefficient)>=6) ?	(ShmCharger->gun_info[gun_index].targetCurrent*ShmCharger->gun_info[gun_index].tempCoefficient):6));
+
 						// Determine max charging current to MCU
 						if(ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent == 0)
 						{
@@ -4522,6 +4536,38 @@ int main(void)
 							}
 						}
 
+						// Charging profile preparation
+						if(DiffTimebWithNow(startTime[gun_index][TMR_IDX_PROFILE_PREPARE]) > TIMEOUT_SPEC_PROFILE_PREPARE)
+						{
+							if(!ocpp_get_profile_conf(gun_index))
+							{
+								ocpp_set_profile_req(gun_index, ON);
+								ftime(&startTime[gun_index][TMR_IDX_PROFILE_PREPARE]);
+							}
+							else
+							{
+								ocpp_set_profile_conf(gun_index, OFF);
+							}
+						}
+
+						// Check target current if charging profile limit > 0
+						checkChargingProfileLimit(gun_index);
+						if(ShmCharger->gun_info[gun_index].targetCurrent > 0)
+						{
+							setRelay(gun_index, ON);
+						}
+
+						// Debug information
+						if(DiffTimebWithNow(startTime[gun_index][TMR_IDX_LOGPPRINTOUT]) > TIMEOUT_SPEC_LOGPPRINTOUT)
+						{
+							DEBUG_INFO("=============================================================\n");
+							DEBUG_INFO("ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent: %d\n", ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent);
+							DEBUG_INFO("ShmCharger->gun_info[%d].primaryMcuCp_Pwn_Duty.max_current: %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current);
+							DEBUG_INFO("ShmCharger->gun_info[%d].targetCurrent: %d\n", gun_index, ShmCharger->gun_info[gun_index].targetCurrent);
+							DEBUG_INFO("=============================================================\n");
+							ftime(&startTime[gun_index][TMR_IDX_LOGPPRINTOUT]);
+						}
+
 						if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_C) &&
 						   (ShmCharger->gun_info[gun_index].rfidReq != ON) &&
 						   (ShmCharger->gun_info[gun_index].bleConfigData.isRequestStop != ON)  &&

+ 1 - 0
EVSE/Projects/AW-Regular/Apps/main.h

@@ -413,6 +413,7 @@ typedef struct GUN_INFO
 	Set_Led_Brightness								setLedBrightness;
 	uint8_t											chargingMode;
 	uint16_t										targetCurrent;
+	float											tempCoefficient;
 	uint16_t										isAuthPassEnd:1;
 	uint16_t										rfidReq:1;
 	uint16_t										isGunPlugged:1;

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 130 - 1201
EVSE/Projects/DD360/Apps/CSU/main.c


+ 1 - 1
EVSE/Projects/DD360/Apps/CSU/main.h

@@ -12,7 +12,7 @@
 #define MAX_BUF                                 (64)
 #define SYSFS_GPIO_DIR                          "/sys/class/gpio"
 #define UPGRADE_FAN                             (0x02)
-#if defined DD360 ||defined DD360Audi || defined DD360ComBox
+#if defined DD360 || defined DD360Audi || defined DD360ComBox
 #define UPGRADE_RB                              (0x09) //0x09 for DD360 dispenser
 #else
 #define UPGRADE_RB                              (0x03) //other module use

+ 18 - 4
EVSE/Projects/DD360/Apps/Config.h

@@ -256,6 +256,11 @@ enum RELAY_STATUS_ERROR_TYPE {
     RELAY_STATUS_ERROR_DRIVING = 11,
 };
 
+enum _CCS_TYPE {
+    _CCS_TYPE_CCS1 = 0,
+    _CCS_TYPE_CCS2 = 1,
+};
+
 //------------------------------------------------------------------------------
 //struct StructMeter {
 //    float curMeterValue;
@@ -330,20 +335,26 @@ typedef union {
 } PowerAlarmState;
 
 typedef union {
-    uint8_t ChillerState;
+    uint8_t TempErrMsg;
     struct {
         uint8_t ChillerOTP: 1;            //chiller Temperature OVP
         uint8_t ChillerTempSensorFail: 1; //Chiller temperature sensor failure
         uint8_t Reserved: 6;
     } StatusBit;
-} ChillerTempState;
+} ChillerTempErr;
 
 typedef struct StChillerValve {
     uint8_t MultiChillerGun; //0x80, 0: 沒有水冷槍, 1: 有水冷槍, 0x7F: 紀錄水冷槍數
     uint8_t LeftTemp;  //左槍最高溫度
     uint8_t RightTemp; //右槍最高溫度
+    uint8_t Reserved;
 } ChillerValve;
 
+typedef struct StPcPsuOutput { //from power cabinet PSU output
+    uint16_t Voltage;
+    uint16_t Current;
+} PcPsuOutput;
+
 typedef struct StDcCommonInfo {
     uint8_t RebootCount;
     uint8_t CcsVersion;
@@ -353,9 +364,12 @@ typedef struct StDcCommonInfo {
     uint8_t GunRelayDrivingOccur[2];
     uint8_t SystemModeChange;
     PowerAlarmState PowerAlarmState;
-    ChillerTempState ChillerTempState[2];
+    ChillerTempErr ChillerTempErr[2];
     ChillerValve ChillerValve;
-    uint8_t Reserved[3];
+    uint8_t TestTemperature; //ReadCmdline test, manual input value
+    uint8_t CcsTypeSaved[2];
+    PcPsuOutput PcPsuOutput[2];
+    uint8_t Reserved[4];
 } DcCommonInfo;
 
 #endif /* CONFIG_H_ */

+ 1 - 1
EVSE/Projects/DD360/Apps/FactoryConfig.c

@@ -180,7 +180,7 @@ int main(int argc, char *argv[])
     */
     //********** System **********// udhcpc -i eth1 -s ./dhcp_script/eth1.script
     //
-    strcpy((char *)SysConfig.ModelName, "DXYE18200EE1E4");
+    strcpy((char *)SysConfig.ModelName, "DDYC182V0UE2AD");
     strcpy((char *)SysConfig.SerialNumber, "SERIALFORRD");
 
     memset(SysConfig.SystemId, 0x00, sizeof(SysConfig.SystemId));

+ 9 - 2
EVSE/Projects/DD360/Apps/Makefile

@@ -114,6 +114,12 @@ PRIMARY_SRC_FILES = $(patsubst %.o, %.c, $(PRIMARY_OBJ_FILES))
 %.o: %.c
 	$(CC) $(CFLAGS) -c $<
 
+#ReadCmdLine
+READCMDLINE_OBJ_FILES = $(COMMON_OBJ_FILES) ReadCmdline.o
+READCMDLINE_SRC_FILES = $(patsubst %.o, %.c, $(READCMDLINE_OBJ_FILES))
+%.o: %.c
+	$(CC) $(CFLAGS) -c $<
+
 all: CopyFile apps
 
 apps: MainTask DoCommTask EvCommTask \
@@ -170,8 +176,9 @@ PsuCommTask:
 	$(CC) -o Module_PsuComm Module_PsuComm.o $(InfypwrPsuComm_A)
 
 ReadCmdlineTask:
-	$(CC) $(DEFINE) $(CFLAGS) -c -o ReadCmdline.o ReadCmdline.c
-	$(CC) -o ReadCmdline ReadCmdline.o
+	$(CC) $(DEFINE) $(READCMDLINE_SRC_FILES) $(CFLAGS) $(TFLAGS) $(INC_FLAGS) -o ReadCmdline
+	#$(CC) $(DEFINE) $(CFLAGS) -c -o ReadCmdline.o ReadCmdline.c
+	#$(CC) -o ReadCmdline ReadCmdline.o
 
 UnsafetyOutputTool:
 	$(CC) $(DEFINE) $(InfypwrPsuComm_H) $(CFLAGS) -c -o OutputTask.o OutputTask.c

+ 20 - 11
EVSE/Projects/DD360/Apps/ModuleDoComm/DoComm.c

@@ -35,12 +35,8 @@
 //#define log_error(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
 
 //------------------------------------------------------------------------------
-//static int TcpSock = 0;
-//static uint8_t PacketSe;
-static DoCommGblData gDoCommGblData = {0};
+static DoCommGblData gDoCommGblData             = {0};
 
-//static struct SysConfigAndInfo *ShmSysConfigAndInfo = NULL;
-//static struct StatusCodeData *ShmStatusCodeData     = NULL;
 static struct SysConfigData *pSysConfig         = NULL;
 static struct SysInfoData *pSysInfo             = NULL;
 static struct WARNING_CODE_INFO *pSysWarning    = NULL;
@@ -49,6 +45,7 @@ static struct PsuData *ShmPsuData               = NULL;
 static struct OCPP16Data *ShmOCPP16Data         = NULL;
 static struct PrimaryMcuData *ShmPrimaryMcuData = NULL;
 static SelectGunInfo *ShmSelectGunInfo          = NULL;
+static DcCommonInfo *ShmDcCommonData            = NULL;
 
 //static struct ChargingInfoData  *ChargingData[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY]
 static struct ChargingInfoData *pDcChargingInfo = NULL;
@@ -844,9 +841,9 @@ static int chargingcapabilityHandle(uint8_t *data, uint8_t plugNum)
     pAccountInfo = (AccountInfo *)&data[addr];
 
     pSysConfig->BillingData.Currency = pAccountInfo->Currency;
-    ShmSelectGunInfo->PricesInfo[plugNum].UserPrices    = transPricesUnit(ntohl(pAccountInfo->UserPrices));
-    pDcChargingInfo->ChargingFee                  = transPricesUnit(ntohl(pAccountInfo->TotalCost));
-    ShmSelectGunInfo->PricesInfo[plugNum].Balance       = transPricesUnit(ntohl(pAccountInfo->Balance));
+    ShmSelectGunInfo->PricesInfo[plugNum].UserPrices = transPricesUnit(ntohl(pAccountInfo->UserPrices));
+    pDcChargingInfo->ChargingFee                     = transPricesUnit(ntohl(pAccountInfo->TotalCost));
+    ShmSelectGunInfo->PricesInfo[plugNum].Balance    = transPricesUnit(ntohl(pAccountInfo->Balance));
 
     if ((pricesInfo[plugNum].UserPrices != ShmSelectGunInfo->PricesInfo[plugNum].UserPrices) ||
             (pricesInfo[plugNum].Balance != ShmSelectGunInfo->PricesInfo[plugNum].Balance)) {
@@ -1054,6 +1051,7 @@ static int responsePackeHandle(int fd, uint8_t *pResult, uint8_t plugNum, uint8_
     uint8_t rawDataLen = 0;
     CsuResultPkt *pCsuResult = (CsuResultPkt *)pResult;
     SoftwareUpdInfo *pSoftwareUpd = NULL;
+    PcPsuOutput *pPcPsuOutput = NULL;
 
     //Hexdump((uint8_t *)pCsuResult, sizeof(CmdHead) + pCsuResult->Head.DataLen);
     if (compareOpcode(pCsuResult->Head.OP) == FAIL ||
@@ -1152,6 +1150,14 @@ static int responsePackeHandle(int fd, uint8_t *pResult, uint8_t plugNum, uint8_
         break;
 
     case REG_PRESENT_CHARGING_INFO:
+        pPcPsuOutput = (PcPsuOutput *)&pCsuResult->Data.Data[0];
+
+        ShmDcCommonData->PcPsuOutput[plugNum].Voltage = ntohs((uint16_t)pPcPsuOutput->Voltage);
+        ShmDcCommonData->PcPsuOutput[plugNum].Current = ntohs((uint16_t)pPcPsuOutput->Current);
+        log_info("%d ower cabinet PSU output vol = %d, cur = %d\r\n",
+                 plugNum,
+                 ShmDcCommonData->PcPsuOutput[plugNum].Voltage,
+                 ShmDcCommonData->PcPsuOutput[plugNum].Current);
         break;
 
     case REG_QRCODE_URL_INFO:
@@ -1227,6 +1233,8 @@ static int composeSocketData(int fd,
 
     ret = responsePackeHandle(fd, (uint8_t *)&csuResult, plugNum, csuCmdPkt.Data.Register);
 
+    gDoCommGblData.DisConnCount = 0; //送收資料沒有問題, 清除中斷網路計數
+
     return ret;
 }
 
@@ -1269,8 +1277,8 @@ static int writePresentChargingInfo(int fd, uint8_t plugNum, uint8_t id)
     PreChargingInfo *pPreChargingInfo = (PreChargingInfo *)dataBuf;
     pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(plugNum);
 
-    pPreChargingInfo->PresentChargingVoltage = htons((uint16_t)pDcChargingInfo->PresentChargingVoltage * 10);
-    pPreChargingInfo->PresentChargingCurrent = htons((uint16_t)pDcChargingInfo->PresentChargingCurrent * 10);
+    pPreChargingInfo->PresentChargingVoltage = htons((uint16_t)(pDcChargingInfo->PresentChargingVoltage * 10));
+    pPreChargingInfo->PresentChargingCurrent = htons((uint16_t)(pDcChargingInfo->PresentChargingCurrent * 10));
     pPreChargingInfo->RemainChargingDuration = htonl(pDcChargingInfo->RemainChargingDuration);
     pPreChargingInfo->EvBatterySoc = pDcChargingInfo->EvBatterySoc;
 
@@ -2241,6 +2249,7 @@ int main(int argc, char *argv[])
     ShmPrimaryMcuData = (struct PrimaryMcuData *)GetShmPrimaryMcuData();
     ShmOCPP16Data = (struct OCPP16Data *)GetShmOCPP16Data();
     ShmSelectGunInfo = (SelectGunInfo *)GetShmSelectGunInfo();
+    ShmDcCommonData = (DcCommonInfo *)GetShmDcCommonData();
 
     totalConnCount = pSysConfig->TotalConnectorCount;
 
@@ -2314,6 +2323,6 @@ int main(int argc, char *argv[])
             updateFirmwareProcess(fd, gDoCommGblData.ConnectorID[0], totalConnCount);
         }
 
-        usleep(10000);
+        usleep(100000);
     }
 }

+ 1 - 1
EVSE/Projects/DD360/Apps/ModuleDoComm/DoComm.h

@@ -18,7 +18,7 @@
 
 #define MAX_REGISTER_NUM                        30
 
-#define CHECK_NETWORK_FAIL_COUNT                3//10
+#define CHECK_NETWORK_FAIL_COUNT                10//10
 #define CONNECT_SERVER_FAIL_COUNT               3//5
 #define WARNING_CODE_SIZE                       6
 

+ 0 - 1
EVSE/Projects/DD360/Apps/ModuleEvComm/Module_EvCommOrg.c

@@ -3207,7 +3207,6 @@ int main(int argc, char *argv[])
                     _chargingData[_index]->ChargingProfileCurrent = -1; //DS60-120 add
 
                     if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_MAX) { //DS60-120 add
-
                         _chargingData[_index]->PresentChargingVoltage = 0;
                         _chargingData[_index]->PresentChargingCurrent = 0;
                         _chargingData[_index]->EvBatteryMaxVoltage = 0;

+ 21 - 2
EVSE/Projects/DD360/Apps/ModuleEvComm/Module_EvRxComm.c

@@ -205,6 +205,8 @@ void CANReceiver(int fd)
         uint8_t targetGun = 0x00;
         uint8_t gunTypeIndex = 0;
         uint8_t ver[16] = {0};
+        uint8_t sameChillerTemp = NO;
+        uint8_t sameConnTemp = NO;
         struct can_frame frame;
         ChillerTemp chiilerTemp = {0};
         struct ChargingInfoData *pDcChargingInfo = NULL;
@@ -224,7 +226,10 @@ void CANReceiver(int fd)
         log_info("Module_EvRXComm Child's PID is %d\r\n", getpid());
 
         while (isContinue) {
+            sameChillerTemp = NO;
+            sameConnTemp = NO;
             memset(&frame, 0, sizeof(struct can_frame));
+
             nbytes = read(fd, &frame, sizeof(struct can_frame));
             if (nbytes <= 0) {
                 usleep(10000);
@@ -463,15 +468,29 @@ void CANReceiver(int fd)
                 }
                 }*/
 
-                if ((ShmDcCommonData->ChillerValve.MultiChillerGun & 0x80) == YES) {
+                if (ShmDcCommonData->TestTemperature == YES) { //ReadCmdline test
+                    break;
+                }
+
+                if (((ShmDcCommonData->ChillerValve.MultiChillerGun & 0x80) >> 7) == YES) {
                     getChillerTemperature(&chiilerTemp);
+                    if (getMaxConnectTemp(chiilerTemp.Temp[0], chiilerTemp.Temp[1]) == (pDcChargingInfo->ChillerTemp + 3)) {
+                        sameChillerTemp = YES;
+                    }
+
                     pDcChargingInfo->ChillerTemp = getMaxConnectTemp(chiilerTemp.Temp[0], chiilerTemp.Temp[1]);
                 }
 
+                if (getMaxConnectTemp(frame.data[1], frame.data[2]) == (pDcChargingInfo->ConnectorTemp + 3)) {
+                    sameConnTemp = YES;
+                }
+
                 pDcChargingInfo->ConnectorTemp = getMaxConnectTemp(frame.data[1], frame.data[2]);
 
                 //紀錄槍頭和水冷機溫度, 在系統狀態變化或溫度大於150
-                if ((ShmDcCommonData->SystemModeChange == YES) ||
+                if (((sameConnTemp == YES) ||
+                        (sameChillerTemp == YES)) &&
+                        (ShmDcCommonData->SystemModeChange == YES) ||
                         (((pDcChargingInfo->ConnectorTemp >= GUN_OTP_VALUE) &&
                           (pDcChargingInfo->ConnectorTemp != UNDEFINED_TEMP)) ||
                          ((pDcChargingInfo->ChillerTemp >= GUN_OTP_VALUE) &&

+ 57 - 2
EVSE/Projects/DD360/Apps/ModuleEvComm/Module_EvTxComm.c

@@ -421,6 +421,60 @@ static void GetMaxVolAndCurMethod(uint8_t index, float *vol, float *cur)
     }
 }
 
+/**
+ * [SetPresentChargingOutputFromPcPsu 充電狀態讀取電源櫃PSU輸出電壓電流,縮小誤差值]
+ * @Author   Jerry
+ * @DateTime 2021-07-05
+ */
+static void SetPresentChargingOutputFromPcPsu(uint8_t gunCount)
+{
+    float vol1 = 0, cur1 = 0;
+    float vol2 = 0, cur2 = 0;
+    PcPsuOutput *pPcPsuOutput0 = NULL;
+    PcPsuOutput *pPcPsuOutput1 = NULL;
+
+    switch (gunCount) {
+    case 1:
+        pPcPsuOutput0 = (PcPsuOutput *)&ShmDcCommonData->PcPsuOutput[0];
+        pPcPsuOutput1 = (PcPsuOutput *)&ShmDcCommonData->PcPsuOutput[0];
+        break;
+
+    case 2:
+        pPcPsuOutput0 = (PcPsuOutput *)&ShmDcCommonData->PcPsuOutput[0];
+        pPcPsuOutput1 = (PcPsuOutput *)&ShmDcCommonData->PcPsuOutput[1];
+        break;
+    }
+
+    vol1 = (((float)pPcPsuOutput0->Voltage) * 0.1);
+    cur1 = (((float)pPcPsuOutput0->Current) * 0.1);
+    vol2 = (((float)pPcPsuOutput1->Voltage) * 0.1);
+    cur2 = (((float)pPcPsuOutput1->Current) * 0.1);
+
+    if (
+        (LogInfo[0][EV_LOG_NOW_OUTPUT_VOL] >= vol1 + CHK_VOL_RANGE) ||
+        (LogInfo[0][EV_LOG_NOW_OUTPUT_VOL] <= vol1 - CHK_VOL_RANGE) ||
+        (LogInfo[0][EV_LOG_NOW_OUTPUT_CUR] >= cur1 + CHK_CUR_RANGE) ||
+        (LogInfo[0][EV_LOG_NOW_OUTPUT_CUR] <= cur1 - CHK_CUR_RANGE) ||
+        (LogInfo[1][EV_LOG_NOW_OUTPUT_VOL] >= vol2 + CHK_VOL_RANGE) ||
+        (LogInfo[1][EV_LOG_NOW_OUTPUT_VOL] <= vol2 - CHK_VOL_RANGE) ||
+        (LogInfo[1][EV_LOG_NOW_OUTPUT_CUR] >= cur2 + CHK_CUR_RANGE) ||
+        (LogInfo[1][EV_LOG_NOW_OUTPUT_CUR] <= cur2 - CHK_CUR_RANGE)
+    ) {
+        log_info("G1 -> Output Vol = %.1f, Output Cur = %.1f -- G2 -> Output Vol = %.1f, Output Cur = %.1f\r\n",
+                 vol1 / 10,
+                 cur1 / 10,
+                 vol2 / 10,
+                 cur2 / 10);
+
+        LogInfo[0][EV_LOG_NOW_OUTPUT_VOL] = vol1;
+        LogInfo[0][EV_LOG_NOW_OUTPUT_CUR] = cur1;
+        LogInfo[1][EV_LOG_NOW_OUTPUT_VOL] = vol2;
+        LogInfo[1][EV_LOG_NOW_OUTPUT_CUR] = cur2;
+    }
+
+    SetPresentOutputPower(vol1, cur1, vol2, cur2);
+}
+
 static void SetPresentChargingOutputPower(void)
 {
     float vol1 = 0, cur1 = 0;
@@ -503,7 +557,7 @@ static void checkConnectorOVPState(uint8_t gunIndex)
         break;
     }
 
-    if (ShmDcCommonData->ChillerTempState[gunIndex].StatusBit.ChillerOTP == YES) {
+    if (ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerOTP == YES) {
         isOTP = true;
     }
 
@@ -905,7 +959,8 @@ int main(int argc, char *argv[])
                 GetOutputReq(gunIndex, pDcChargingInfo->Evboard_id);
 
                 // 設定當前輸出
-                SetPresentChargingOutputPower();
+                //SetPresentChargingOutputPower();
+                SetPresentChargingOutputFromPcPsu(pSysConfig->TotalConnectorCount);
 
                 // for test end
                 if (priorityLow % 5 == 0) {

+ 1 - 0
EVSE/Projects/DD360/Apps/ModuleEventLog/Module_EventLogging.c

@@ -29,6 +29,7 @@
 
 #include "../Log/log.h"
 #include "../ShareMemory/shmMem.h"
+#include "../DataBase/DataBase.h"
 #include "../Define/define.h"
 #include "../Config.h"
 

+ 9 - 4
EVSE/Projects/DD360/Apps/ModuleInternalComm/RelayBoard.c

@@ -1011,8 +1011,8 @@ void GetPersentOutputVol(void)
         case 0x01:
 #if defined DD360 || defined DD360Audi || defined DD360ComBox
             pDcChargingInfo->FireChargingVoltage = ShmRelayModuleData->Gun1RelayOutputVolt;
-            pDcChargingInfo->PresentChargingCurrent = ShmRelayModuleData->Gun1FuseOutputVolt / 10;
-            pDcChargingInfo->PresentChargingVoltage = pDcChargingInfo->FireChargingVoltage / 10;
+            pDcChargingInfo->PresentChargingCurrent = ((float)ShmRelayModuleData->Gun1FuseOutputVolt) / 10;
+            pDcChargingInfo->PresentChargingVoltage = ((float)pDcChargingInfo->FireChargingVoltage) / 10;
             pDcChargingInfo->FuseChargingVoltage = pDcChargingInfo->FireChargingVoltage;
             break;
 #endif //defined DD360 || defined DD360Audi || defined DD360ComBox
@@ -1024,8 +1024,8 @@ void GetPersentOutputVol(void)
         case 0x02:
 #if defined DD360 || defined DD360Audi || defined DD360ComBox
             pDcChargingInfo->FireChargingVoltage = ShmRelayModuleData->Gun2RelayOutputVolt;
-            pDcChargingInfo->PresentChargingCurrent = ShmRelayModuleData->Gun2FuseOutputVolt / 10;
-            pDcChargingInfo->PresentChargingVoltage = pDcChargingInfo->FireChargingVoltage / 10;
+            pDcChargingInfo->PresentChargingCurrent = ((float)ShmRelayModuleData->Gun2FuseOutputVolt) / 10;
+            pDcChargingInfo->PresentChargingVoltage = ((float)pDcChargingInfo->FireChargingVoltage) / 10;
             pDcChargingInfo->FuseChargingVoltage = pDcChargingInfo->FireChargingVoltage;
             break;
 #endif //defined DD360 || defined DD360Audi || defined DD360ComBox
@@ -1035,6 +1035,11 @@ void GetPersentOutputVol(void)
             break;
         }
 
+        //log_info("%d persent vol = %f, cur = %f\r\n",
+        //         index,
+        //         pDcChargingInfo->PresentChargingVoltage,
+        //         pDcChargingInfo->PresentChargingCurrent);
+
         //unsigned short Ovp = 0;
         //unsigned short Ocp = 0;
         //Ovp = MIN [VOUT_MAX_VOLTAGE, EV_BATTERY_VOLTAGE]  // 最大輸出電壓與電池電壓最大值

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 352 - 359
EVSE/Projects/DD360/Apps/ReadCmdline.c


+ 5 - 0
EVSE/Projects/DD360/Apps/ShareMemory/shmMem.c

@@ -542,6 +542,7 @@ void InitialShareMemoryInfo(void)
     //ShmDcCommonData->acContactSwitch = NO;
     ShmDcCommonData->ConnectErrList[0].GunErrMessage = 0;
     ShmDcCommonData->ConnectErrList[1].GunErrMessage = 0;
+    ShmDcCommonData->TestTemperature = NO;
     //ShmDcCommonData->LcmFwVersion = 0;
 }
 
@@ -968,6 +969,7 @@ bool MappingGunChargingInfo(char *whichTask)
     struct ChargingInfoData *pAcChargingInfo = NULL;
 
     if (ShmSysConfigAndInfo == NULL) {
+        log_error("ShmSysConfigAndInfo failed\r\n");
         return false;
     }
 
@@ -1029,6 +1031,9 @@ bool MappingGunChargingInfo(char *whichTask)
 
     //log_info("Type 0~3 = CHAdeMO, CCS, GB, AC");
     if (pSysConfig->TotalConnectorCount == 0 && pSysConfig->AcConnectorCount == 0) {
+        log_error("DC %d or AC %d connector failed\r\n",
+                  pSysConfig->TotalConnectorCount,
+                  pSysConfig->AcConnectorCount);
         result = false;
     }
 

+ 1 - 0
EVSE/Projects/DD360/Apps/ShareMemory/shmMem.h

@@ -67,4 +67,5 @@ void MappingChargingInfoData(void);
 void *GetShmSelectGunInfo(void);
 
 int InitSelectGunShmMem(void);
+
 #endif /* _CSU_SHARE_MEMORY_H_ */

BIN
EVSE/Projects/DD360/Images/FactoryDefaultConfig.bin


BIN
EVSE/Projects/DD360/Images/ramdisk.gz


BIN
EVSE/Projects/DD360/output/FactoryConfig


BIN
EVSE/Projects/DD360/output/Module_DoComm


BIN
EVSE/Projects/DD360/output/Module_EvComm


BIN
EVSE/Projects/DD360/output/Module_EventLogging


BIN
EVSE/Projects/DD360/output/Module_InternalComm


BIN
EVSE/Projects/DD360/output/Module_LcmControl


BIN
EVSE/Projects/DD360/output/Module_PrimaryComm


BIN
EVSE/Projects/DD360/output/ReadCmdline


BIN
EVSE/Projects/DD360/output/main


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 130 - 1201
EVSE/Projects/DD360Audi/Apps/CSU/main.c


+ 1 - 1
EVSE/Projects/DD360Audi/Apps/CSU/main.h

@@ -12,7 +12,7 @@
 #define MAX_BUF                                 (64)
 #define SYSFS_GPIO_DIR                          "/sys/class/gpio"
 #define UPGRADE_FAN                             (0x02)
-#if defined DD360 ||defined DD360Audi || defined DD360ComBox
+#if defined DD360 || defined DD360Audi || defined DD360ComBox
 #define UPGRADE_RB                              (0x09) //0x09 for DD360 dispenser
 #else
 #define UPGRADE_RB                              (0x03) //other module use

+ 18 - 4
EVSE/Projects/DD360Audi/Apps/Config.h

@@ -256,6 +256,11 @@ enum RELAY_STATUS_ERROR_TYPE {
     RELAY_STATUS_ERROR_DRIVING = 11,
 };
 
+enum _CCS_TYPE {
+    _CCS_TYPE_CCS1 = 0,
+    _CCS_TYPE_CCS2 = 1,
+};
+
 //------------------------------------------------------------------------------
 //struct StructMeter {
 //    float curMeterValue;
@@ -330,20 +335,26 @@ typedef union {
 } PowerAlarmState;
 
 typedef union {
-    uint8_t ChillerState;
+    uint8_t TempErrMsg;
     struct {
         uint8_t ChillerOTP: 1;            //chiller Temperature OVP
         uint8_t ChillerTempSensorFail: 1; //Chiller temperature sensor failure
         uint8_t Reserved: 6;
     } StatusBit;
-} ChillerTempState;
+} ChillerTempErr;
 
 typedef struct StChillerValve {
     uint8_t MultiChillerGun; //0x80, 0: 沒有水冷槍, 1: 有水冷槍, 0x7F: 紀錄水冷槍數
     uint8_t LeftTemp;  //左槍最高溫度
     uint8_t RightTemp; //右槍最高溫度
+    uint8_t Reserved;
 } ChillerValve;
 
+typedef struct StPcPsuOutput { //from power cabinet PSU output
+    uint16_t Voltage;
+    uint16_t Current;
+} PcPsuOutput;
+
 typedef struct StDcCommonInfo {
     uint8_t RebootCount;
     uint8_t CcsVersion;
@@ -353,9 +364,12 @@ typedef struct StDcCommonInfo {
     uint8_t GunRelayDrivingOccur[2];
     uint8_t SystemModeChange;
     PowerAlarmState PowerAlarmState;
-    ChillerTempState ChillerTempState[2];
+    ChillerTempErr ChillerTempErr[2];
     ChillerValve ChillerValve;
-    uint8_t Reserved[3];
+    uint8_t TestTemperature; //ReadCmdline test, manual input value
+    uint8_t CcsTypeSaved[2];
+    PcPsuOutput PcPsuOutput[2];
+    uint8_t Reserved[4];
 } DcCommonInfo;
 
 #endif /* CONFIG_H_ */

+ 1 - 1
EVSE/Projects/DD360Audi/Apps/FactoryConfig.c

@@ -180,7 +180,7 @@ int main(int argc, char *argv[])
     */
     //********** System **********// udhcpc -i eth1 -s ./dhcp_script/eth1.script
     //
-    strcpy((char *)SysConfig.ModelName, "DXYE18200EE1E4");
+    strcpy((char *)SysConfig.ModelName, "DDYC182V0UE2AD");
     strcpy((char *)SysConfig.SerialNumber, "SERIALFORRD");
 
     memset(SysConfig.SystemId, 0x00, sizeof(SysConfig.SystemId));

+ 9 - 2
EVSE/Projects/DD360Audi/Apps/Makefile

@@ -114,6 +114,12 @@ PRIMARY_SRC_FILES = $(patsubst %.o, %.c, $(PRIMARY_OBJ_FILES))
 %.o: %.c
 	$(CC) $(CFLAGS) -c $<
 
+#ReadCmdLine
+READCMDLINE_OBJ_FILES = $(COMMON_OBJ_FILES) ReadCmdline.o
+READCMDLINE_SRC_FILES = $(patsubst %.o, %.c, $(READCMDLINE_OBJ_FILES))
+%.o: %.c
+	$(CC) $(CFLAGS) -c $<
+
 all: CopyFile apps
 
 apps: MainTask DoCommTask EvCommTask \
@@ -170,8 +176,9 @@ PsuCommTask:
 	$(CC) -o Module_PsuComm Module_PsuComm.o $(InfypwrPsuComm_A)
 
 ReadCmdlineTask:
-	$(CC) $(DEFINE) $(CFLAGS) -c -o ReadCmdline.o ReadCmdline.c
-	$(CC) -o ReadCmdline ReadCmdline.o
+	$(CC) $(DEFINE) $(READCMDLINE_SRC_FILES) $(CFLAGS) $(TFLAGS) $(INC_FLAGS) -o ReadCmdline
+	#$(CC) $(DEFINE) $(CFLAGS) -c -o ReadCmdline.o ReadCmdline.c
+	#$(CC) -o ReadCmdline ReadCmdline.o
 
 UnsafetyOutputTool:
 	$(CC) $(DEFINE) $(InfypwrPsuComm_H) $(CFLAGS) -c -o OutputTask.o OutputTask.c

+ 20 - 11
EVSE/Projects/DD360Audi/Apps/ModuleDoComm/DoComm.c

@@ -35,12 +35,8 @@
 //#define log_error(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
 
 //------------------------------------------------------------------------------
-//static int TcpSock = 0;
-//static uint8_t PacketSe;
-static DoCommGblData gDoCommGblData = {0};
+static DoCommGblData gDoCommGblData             = {0};
 
-//static struct SysConfigAndInfo *ShmSysConfigAndInfo = NULL;
-//static struct StatusCodeData *ShmStatusCodeData     = NULL;
 static struct SysConfigData *pSysConfig         = NULL;
 static struct SysInfoData *pSysInfo             = NULL;
 static struct WARNING_CODE_INFO *pSysWarning    = NULL;
@@ -49,6 +45,7 @@ static struct PsuData *ShmPsuData               = NULL;
 static struct OCPP16Data *ShmOCPP16Data         = NULL;
 static struct PrimaryMcuData *ShmPrimaryMcuData = NULL;
 static SelectGunInfo *ShmSelectGunInfo          = NULL;
+static DcCommonInfo *ShmDcCommonData            = NULL;
 
 //static struct ChargingInfoData  *ChargingData[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY]
 static struct ChargingInfoData *pDcChargingInfo = NULL;
@@ -844,9 +841,9 @@ static int chargingcapabilityHandle(uint8_t *data, uint8_t plugNum)
     pAccountInfo = (AccountInfo *)&data[addr];
 
     pSysConfig->BillingData.Currency = pAccountInfo->Currency;
-    ShmSelectGunInfo->PricesInfo[plugNum].UserPrices    = transPricesUnit(ntohl(pAccountInfo->UserPrices));
-    pDcChargingInfo->ChargingFee                  = transPricesUnit(ntohl(pAccountInfo->TotalCost));
-    ShmSelectGunInfo->PricesInfo[plugNum].Balance       = transPricesUnit(ntohl(pAccountInfo->Balance));
+    ShmSelectGunInfo->PricesInfo[plugNum].UserPrices = transPricesUnit(ntohl(pAccountInfo->UserPrices));
+    pDcChargingInfo->ChargingFee                     = transPricesUnit(ntohl(pAccountInfo->TotalCost));
+    ShmSelectGunInfo->PricesInfo[plugNum].Balance    = transPricesUnit(ntohl(pAccountInfo->Balance));
 
     if ((pricesInfo[plugNum].UserPrices != ShmSelectGunInfo->PricesInfo[plugNum].UserPrices) ||
             (pricesInfo[plugNum].Balance != ShmSelectGunInfo->PricesInfo[plugNum].Balance)) {
@@ -1054,6 +1051,7 @@ static int responsePackeHandle(int fd, uint8_t *pResult, uint8_t plugNum, uint8_
     uint8_t rawDataLen = 0;
     CsuResultPkt *pCsuResult = (CsuResultPkt *)pResult;
     SoftwareUpdInfo *pSoftwareUpd = NULL;
+    PcPsuOutput *pPcPsuOutput = NULL;
 
     //Hexdump((uint8_t *)pCsuResult, sizeof(CmdHead) + pCsuResult->Head.DataLen);
     if (compareOpcode(pCsuResult->Head.OP) == FAIL ||
@@ -1152,6 +1150,14 @@ static int responsePackeHandle(int fd, uint8_t *pResult, uint8_t plugNum, uint8_
         break;
 
     case REG_PRESENT_CHARGING_INFO:
+        pPcPsuOutput = (PcPsuOutput *)&pCsuResult->Data.Data[0];
+
+        ShmDcCommonData->PcPsuOutput[plugNum].Voltage = ntohs((uint16_t)pPcPsuOutput->Voltage);
+        ShmDcCommonData->PcPsuOutput[plugNum].Current = ntohs((uint16_t)pPcPsuOutput->Current);
+        log_info("%d ower cabinet PSU output vol = %d, cur = %d\r\n",
+                 plugNum,
+                 ShmDcCommonData->PcPsuOutput[plugNum].Voltage,
+                 ShmDcCommonData->PcPsuOutput[plugNum].Current);
         break;
 
     case REG_QRCODE_URL_INFO:
@@ -1227,6 +1233,8 @@ static int composeSocketData(int fd,
 
     ret = responsePackeHandle(fd, (uint8_t *)&csuResult, plugNum, csuCmdPkt.Data.Register);
 
+    gDoCommGblData.DisConnCount = 0; //送收資料沒有問題, 清除中斷網路計數
+
     return ret;
 }
 
@@ -1269,8 +1277,8 @@ static int writePresentChargingInfo(int fd, uint8_t plugNum, uint8_t id)
     PreChargingInfo *pPreChargingInfo = (PreChargingInfo *)dataBuf;
     pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(plugNum);
 
-    pPreChargingInfo->PresentChargingVoltage = htons((uint16_t)pDcChargingInfo->PresentChargingVoltage * 10);
-    pPreChargingInfo->PresentChargingCurrent = htons((uint16_t)pDcChargingInfo->PresentChargingCurrent * 10);
+    pPreChargingInfo->PresentChargingVoltage = htons((uint16_t)(pDcChargingInfo->PresentChargingVoltage * 10));
+    pPreChargingInfo->PresentChargingCurrent = htons((uint16_t)(pDcChargingInfo->PresentChargingCurrent * 10));
     pPreChargingInfo->RemainChargingDuration = htonl(pDcChargingInfo->RemainChargingDuration);
     pPreChargingInfo->EvBatterySoc = pDcChargingInfo->EvBatterySoc;
 
@@ -2241,6 +2249,7 @@ int main(int argc, char *argv[])
     ShmPrimaryMcuData = (struct PrimaryMcuData *)GetShmPrimaryMcuData();
     ShmOCPP16Data = (struct OCPP16Data *)GetShmOCPP16Data();
     ShmSelectGunInfo = (SelectGunInfo *)GetShmSelectGunInfo();
+    ShmDcCommonData = (DcCommonInfo *)GetShmDcCommonData();
 
     totalConnCount = pSysConfig->TotalConnectorCount;
 
@@ -2314,6 +2323,6 @@ int main(int argc, char *argv[])
             updateFirmwareProcess(fd, gDoCommGblData.ConnectorID[0], totalConnCount);
         }
 
-        usleep(10000);
+        usleep(100000);
     }
 }

+ 1 - 1
EVSE/Projects/DD360Audi/Apps/ModuleDoComm/DoComm.h

@@ -18,7 +18,7 @@
 
 #define MAX_REGISTER_NUM                        30
 
-#define CHECK_NETWORK_FAIL_COUNT                3//10
+#define CHECK_NETWORK_FAIL_COUNT                10//10
 #define CONNECT_SERVER_FAIL_COUNT               3//5
 #define WARNING_CODE_SIZE                       6
 

+ 0 - 1
EVSE/Projects/DD360Audi/Apps/ModuleEvComm/Module_EvCommOrg.c

@@ -3207,7 +3207,6 @@ int main(int argc, char *argv[])
                     _chargingData[_index]->ChargingProfileCurrent = -1; //DS60-120 add
 
                     if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_MAX) { //DS60-120 add
-
                         _chargingData[_index]->PresentChargingVoltage = 0;
                         _chargingData[_index]->PresentChargingCurrent = 0;
                         _chargingData[_index]->EvBatteryMaxVoltage = 0;

+ 21 - 2
EVSE/Projects/DD360Audi/Apps/ModuleEvComm/Module_EvRxComm.c

@@ -205,6 +205,8 @@ void CANReceiver(int fd)
         uint8_t targetGun = 0x00;
         uint8_t gunTypeIndex = 0;
         uint8_t ver[16] = {0};
+        uint8_t sameChillerTemp = NO;
+        uint8_t sameConnTemp = NO;
         struct can_frame frame;
         ChillerTemp chiilerTemp = {0};
         struct ChargingInfoData *pDcChargingInfo = NULL;
@@ -224,7 +226,10 @@ void CANReceiver(int fd)
         log_info("Module_EvRXComm Child's PID is %d\r\n", getpid());
 
         while (isContinue) {
+            sameChillerTemp = NO;
+            sameConnTemp = NO;
             memset(&frame, 0, sizeof(struct can_frame));
+
             nbytes = read(fd, &frame, sizeof(struct can_frame));
             if (nbytes <= 0) {
                 usleep(10000);
@@ -463,15 +468,29 @@ void CANReceiver(int fd)
                 }
                 }*/
 
-                if ((ShmDcCommonData->ChillerValve.MultiChillerGun & 0x80) == YES) {
+                if (ShmDcCommonData->TestTemperature == YES) { //ReadCmdline test
+                    break;
+                }
+
+                if (((ShmDcCommonData->ChillerValve.MultiChillerGun & 0x80) >> 7) == YES) {
                     getChillerTemperature(&chiilerTemp);
+                    if (getMaxConnectTemp(chiilerTemp.Temp[0], chiilerTemp.Temp[1]) == (pDcChargingInfo->ChillerTemp + 3)) {
+                        sameChillerTemp = YES;
+                    }
+
                     pDcChargingInfo->ChillerTemp = getMaxConnectTemp(chiilerTemp.Temp[0], chiilerTemp.Temp[1]);
                 }
 
+                if (getMaxConnectTemp(frame.data[1], frame.data[2]) == (pDcChargingInfo->ConnectorTemp + 3)) {
+                    sameConnTemp = YES;
+                }
+
                 pDcChargingInfo->ConnectorTemp = getMaxConnectTemp(frame.data[1], frame.data[2]);
 
                 //紀錄槍頭和水冷機溫度, 在系統狀態變化或溫度大於150
-                if ((ShmDcCommonData->SystemModeChange == YES) ||
+                if (((sameConnTemp == YES) ||
+                        (sameChillerTemp == YES)) &&
+                        (ShmDcCommonData->SystemModeChange == YES) ||
                         (((pDcChargingInfo->ConnectorTemp >= GUN_OTP_VALUE) &&
                           (pDcChargingInfo->ConnectorTemp != UNDEFINED_TEMP)) ||
                          ((pDcChargingInfo->ChillerTemp >= GUN_OTP_VALUE) &&

+ 57 - 2
EVSE/Projects/DD360Audi/Apps/ModuleEvComm/Module_EvTxComm.c

@@ -421,6 +421,60 @@ static void GetMaxVolAndCurMethod(uint8_t index, float *vol, float *cur)
     }
 }
 
+/**
+ * [SetPresentChargingOutputFromPcPsu 充電狀態讀取電源櫃PSU輸出電壓電流,縮小誤差值]
+ * @Author   Jerry
+ * @DateTime 2021-07-05
+ */
+static void SetPresentChargingOutputFromPcPsu(uint8_t gunCount)
+{
+    float vol1 = 0, cur1 = 0;
+    float vol2 = 0, cur2 = 0;
+    PcPsuOutput *pPcPsuOutput0 = NULL;
+    PcPsuOutput *pPcPsuOutput1 = NULL;
+
+    switch (gunCount) {
+    case 1:
+        pPcPsuOutput0 = (PcPsuOutput *)&ShmDcCommonData->PcPsuOutput[0];
+        pPcPsuOutput1 = (PcPsuOutput *)&ShmDcCommonData->PcPsuOutput[0];
+        break;
+
+    case 2:
+        pPcPsuOutput0 = (PcPsuOutput *)&ShmDcCommonData->PcPsuOutput[0];
+        pPcPsuOutput1 = (PcPsuOutput *)&ShmDcCommonData->PcPsuOutput[1];
+        break;
+    }
+
+    vol1 = (((float)pPcPsuOutput0->Voltage) * 0.1);
+    cur1 = (((float)pPcPsuOutput0->Current) * 0.1);
+    vol2 = (((float)pPcPsuOutput1->Voltage) * 0.1);
+    cur2 = (((float)pPcPsuOutput1->Current) * 0.1);
+
+    if (
+        (LogInfo[0][EV_LOG_NOW_OUTPUT_VOL] >= vol1 + CHK_VOL_RANGE) ||
+        (LogInfo[0][EV_LOG_NOW_OUTPUT_VOL] <= vol1 - CHK_VOL_RANGE) ||
+        (LogInfo[0][EV_LOG_NOW_OUTPUT_CUR] >= cur1 + CHK_CUR_RANGE) ||
+        (LogInfo[0][EV_LOG_NOW_OUTPUT_CUR] <= cur1 - CHK_CUR_RANGE) ||
+        (LogInfo[1][EV_LOG_NOW_OUTPUT_VOL] >= vol2 + CHK_VOL_RANGE) ||
+        (LogInfo[1][EV_LOG_NOW_OUTPUT_VOL] <= vol2 - CHK_VOL_RANGE) ||
+        (LogInfo[1][EV_LOG_NOW_OUTPUT_CUR] >= cur2 + CHK_CUR_RANGE) ||
+        (LogInfo[1][EV_LOG_NOW_OUTPUT_CUR] <= cur2 - CHK_CUR_RANGE)
+    ) {
+        log_info("G1 -> Output Vol = %.1f, Output Cur = %.1f -- G2 -> Output Vol = %.1f, Output Cur = %.1f\r\n",
+                 vol1 / 10,
+                 cur1 / 10,
+                 vol2 / 10,
+                 cur2 / 10);
+
+        LogInfo[0][EV_LOG_NOW_OUTPUT_VOL] = vol1;
+        LogInfo[0][EV_LOG_NOW_OUTPUT_CUR] = cur1;
+        LogInfo[1][EV_LOG_NOW_OUTPUT_VOL] = vol2;
+        LogInfo[1][EV_LOG_NOW_OUTPUT_CUR] = cur2;
+    }
+
+    SetPresentOutputPower(vol1, cur1, vol2, cur2);
+}
+
 static void SetPresentChargingOutputPower(void)
 {
     float vol1 = 0, cur1 = 0;
@@ -503,7 +557,7 @@ static void checkConnectorOVPState(uint8_t gunIndex)
         break;
     }
 
-    if (ShmDcCommonData->ChillerTempState[gunIndex].StatusBit.ChillerOTP == YES) {
+    if (ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerOTP == YES) {
         isOTP = true;
     }
 
@@ -905,7 +959,8 @@ int main(int argc, char *argv[])
                 GetOutputReq(gunIndex, pDcChargingInfo->Evboard_id);
 
                 // 設定當前輸出
-                SetPresentChargingOutputPower();
+                //SetPresentChargingOutputPower();
+                SetPresentChargingOutputFromPcPsu(pSysConfig->TotalConnectorCount);
 
                 // for test end
                 if (priorityLow % 5 == 0) {

+ 1 - 0
EVSE/Projects/DD360Audi/Apps/ModuleEventLog/Module_EventLogging.c

@@ -29,6 +29,7 @@
 
 #include "../Log/log.h"
 #include "../ShareMemory/shmMem.h"
+#include "../DataBase/DataBase.h"
 #include "../Define/define.h"
 #include "../Config.h"
 

+ 9 - 4
EVSE/Projects/DD360Audi/Apps/ModuleInternalComm/RelayBoard.c

@@ -1011,8 +1011,8 @@ void GetPersentOutputVol(void)
         case 0x01:
 #if defined DD360 || defined DD360Audi || defined DD360ComBox
             pDcChargingInfo->FireChargingVoltage = ShmRelayModuleData->Gun1RelayOutputVolt;
-            pDcChargingInfo->PresentChargingCurrent = ShmRelayModuleData->Gun1FuseOutputVolt / 10;
-            pDcChargingInfo->PresentChargingVoltage = pDcChargingInfo->FireChargingVoltage / 10;
+            pDcChargingInfo->PresentChargingCurrent = ((float)ShmRelayModuleData->Gun1FuseOutputVolt) / 10;
+            pDcChargingInfo->PresentChargingVoltage = ((float)pDcChargingInfo->FireChargingVoltage) / 10;
             pDcChargingInfo->FuseChargingVoltage = pDcChargingInfo->FireChargingVoltage;
             break;
 #endif //defined DD360 || defined DD360Audi || defined DD360ComBox
@@ -1024,8 +1024,8 @@ void GetPersentOutputVol(void)
         case 0x02:
 #if defined DD360 || defined DD360Audi || defined DD360ComBox
             pDcChargingInfo->FireChargingVoltage = ShmRelayModuleData->Gun2RelayOutputVolt;
-            pDcChargingInfo->PresentChargingCurrent = ShmRelayModuleData->Gun2FuseOutputVolt / 10;
-            pDcChargingInfo->PresentChargingVoltage = pDcChargingInfo->FireChargingVoltage / 10;
+            pDcChargingInfo->PresentChargingCurrent = ((float)ShmRelayModuleData->Gun2FuseOutputVolt) / 10;
+            pDcChargingInfo->PresentChargingVoltage = ((float)pDcChargingInfo->FireChargingVoltage) / 10;
             pDcChargingInfo->FuseChargingVoltage = pDcChargingInfo->FireChargingVoltage;
             break;
 #endif //defined DD360 || defined DD360Audi || defined DD360ComBox
@@ -1035,6 +1035,11 @@ void GetPersentOutputVol(void)
             break;
         }
 
+        //log_info("%d persent vol = %f, cur = %f\r\n",
+        //         index,
+        //         pDcChargingInfo->PresentChargingVoltage,
+        //         pDcChargingInfo->PresentChargingCurrent);
+
         //unsigned short Ovp = 0;
         //unsigned short Ocp = 0;
         //Ovp = MIN [VOUT_MAX_VOLTAGE, EV_BATTERY_VOLTAGE]  // 最大輸出電壓與電池電壓最大值

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 352 - 359
EVSE/Projects/DD360Audi/Apps/ReadCmdline.c


+ 5 - 0
EVSE/Projects/DD360Audi/Apps/ShareMemory/shmMem.c

@@ -542,6 +542,7 @@ void InitialShareMemoryInfo(void)
     //ShmDcCommonData->acContactSwitch = NO;
     ShmDcCommonData->ConnectErrList[0].GunErrMessage = 0;
     ShmDcCommonData->ConnectErrList[1].GunErrMessage = 0;
+    ShmDcCommonData->TestTemperature = NO;
     //ShmDcCommonData->LcmFwVersion = 0;
 }
 
@@ -968,6 +969,7 @@ bool MappingGunChargingInfo(char *whichTask)
     struct ChargingInfoData *pAcChargingInfo = NULL;
 
     if (ShmSysConfigAndInfo == NULL) {
+        log_error("ShmSysConfigAndInfo failed\r\n");
         return false;
     }
 
@@ -1029,6 +1031,9 @@ bool MappingGunChargingInfo(char *whichTask)
 
     //log_info("Type 0~3 = CHAdeMO, CCS, GB, AC");
     if (pSysConfig->TotalConnectorCount == 0 && pSysConfig->AcConnectorCount == 0) {
+        log_error("DC %d or AC %d connector failed\r\n",
+                  pSysConfig->TotalConnectorCount,
+                  pSysConfig->AcConnectorCount);
         result = false;
     }
 

+ 1 - 0
EVSE/Projects/DD360Audi/Apps/ShareMemory/shmMem.h

@@ -67,4 +67,5 @@ void MappingChargingInfoData(void);
 void *GetShmSelectGunInfo(void);
 
 int InitSelectGunShmMem(void);
+
 #endif /* _CSU_SHARE_MEMORY_H_ */

BIN
EVSE/Projects/DD360Audi/Images/FactoryDefaultConfig.bin


BIN
EVSE/Projects/DD360Audi/Images/MLO


BIN
EVSE/Projects/DD360Audi/Images/ramdisk.gz


BIN
EVSE/Projects/DD360Audi/Images/u-boot-spl.bin


BIN
EVSE/Projects/DD360Audi/Images/u-boot.img


BIN
EVSE/Projects/DD360Audi/Images/zImage


BIN
EVSE/Projects/DD360Audi/output/FactoryConfig


BIN
EVSE/Projects/DD360Audi/output/Module_DoComm


BIN
EVSE/Projects/DD360Audi/output/Module_EvComm


BIN
EVSE/Projects/DD360Audi/output/Module_EventLogging


BIN
EVSE/Projects/DD360Audi/output/Module_FactoryConfig


BIN
EVSE/Projects/DD360Audi/output/Module_InternalComm


BIN
EVSE/Projects/DD360Audi/output/Module_LcmControl


BIN
EVSE/Projects/DD360Audi/output/Module_PrimaryComm


BIN
EVSE/Projects/DD360Audi/output/ReadCmdline


BIN
EVSE/Projects/DD360Audi/output/main


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 130 - 1201
EVSE/Projects/DD360ComBox/Apps/CSU/main.c


+ 1 - 1
EVSE/Projects/DD360ComBox/Apps/CSU/main.h

@@ -12,7 +12,7 @@
 #define MAX_BUF                                 (64)
 #define SYSFS_GPIO_DIR                          "/sys/class/gpio"
 #define UPGRADE_FAN                             (0x02)
-#if defined DD360 ||defined DD360Audi || defined DD360ComBox
+#if defined DD360 || defined DD360Audi || defined DD360ComBox
 #define UPGRADE_RB                              (0x09) //0x09 for DD360 dispenser
 #else
 #define UPGRADE_RB                              (0x03) //other module use

+ 18 - 4
EVSE/Projects/DD360ComBox/Apps/Config.h

@@ -256,6 +256,11 @@ enum RELAY_STATUS_ERROR_TYPE {
     RELAY_STATUS_ERROR_DRIVING = 11,
 };
 
+enum _CCS_TYPE {
+    _CCS_TYPE_CCS1 = 0,
+    _CCS_TYPE_CCS2 = 1,
+};
+
 //------------------------------------------------------------------------------
 //struct StructMeter {
 //    float curMeterValue;
@@ -330,20 +335,26 @@ typedef union {
 } PowerAlarmState;
 
 typedef union {
-    uint8_t ChillerState;
+    uint8_t TempErrMsg;
     struct {
         uint8_t ChillerOTP: 1;            //chiller Temperature OVP
         uint8_t ChillerTempSensorFail: 1; //Chiller temperature sensor failure
         uint8_t Reserved: 6;
     } StatusBit;
-} ChillerTempState;
+} ChillerTempErr;
 
 typedef struct StChillerValve {
     uint8_t MultiChillerGun; //0x80, 0: 沒有水冷槍, 1: 有水冷槍, 0x7F: 紀錄水冷槍數
     uint8_t LeftTemp;  //左槍最高溫度
     uint8_t RightTemp; //右槍最高溫度
+    uint8_t Reserved;
 } ChillerValve;
 
+typedef struct StPcPsuOutput { //from power cabinet PSU output
+    uint16_t Voltage;
+    uint16_t Current;
+} PcPsuOutput;
+
 typedef struct StDcCommonInfo {
     uint8_t RebootCount;
     uint8_t CcsVersion;
@@ -353,9 +364,12 @@ typedef struct StDcCommonInfo {
     uint8_t GunRelayDrivingOccur[2];
     uint8_t SystemModeChange;
     PowerAlarmState PowerAlarmState;
-    ChillerTempState ChillerTempState[2];
+    ChillerTempErr ChillerTempErr[2];
     ChillerValve ChillerValve;
-    uint8_t Reserved[3];
+    uint8_t TestTemperature; //ReadCmdline test, manual input value
+    uint8_t CcsTypeSaved[2];
+    PcPsuOutput PcPsuOutput[2];
+    uint8_t Reserved[4];
 } DcCommonInfo;
 
 #endif /* CONFIG_H_ */

+ 1 - 1
EVSE/Projects/DD360ComBox/Apps/FactoryConfig.c

@@ -180,7 +180,7 @@ int main(int argc, char *argv[])
     */
     //********** System **********// udhcpc -i eth1 -s ./dhcp_script/eth1.script
     //
-    strcpy((char *)SysConfig.ModelName, "DXYE18200EE1E4");
+    strcpy((char *)SysConfig.ModelName, "DDYC182V0UE2AD");
     strcpy((char *)SysConfig.SerialNumber, "SERIALFORRD");
 
     memset(SysConfig.SystemId, 0x00, sizeof(SysConfig.SystemId));

+ 9 - 2
EVSE/Projects/DD360ComBox/Apps/Makefile

@@ -114,6 +114,12 @@ PRIMARY_SRC_FILES = $(patsubst %.o, %.c, $(PRIMARY_OBJ_FILES))
 %.o: %.c
 	$(CC) $(CFLAGS) -c $<
 
+#ReadCmdLine
+READCMDLINE_OBJ_FILES = $(COMMON_OBJ_FILES) ReadCmdline.o
+READCMDLINE_SRC_FILES = $(patsubst %.o, %.c, $(READCMDLINE_OBJ_FILES))
+%.o: %.c
+	$(CC) $(CFLAGS) -c $<
+
 all: CopyFile apps
 
 apps: MainTask DoCommTask EvCommTask \
@@ -170,8 +176,9 @@ PsuCommTask:
 	$(CC) -o Module_PsuComm Module_PsuComm.o $(InfypwrPsuComm_A)
 
 ReadCmdlineTask:
-	$(CC) $(DEFINE) $(CFLAGS) -c -o ReadCmdline.o ReadCmdline.c
-	$(CC) -o ReadCmdline ReadCmdline.o
+	$(CC) $(DEFINE) $(READCMDLINE_SRC_FILES) $(CFLAGS) $(TFLAGS) $(INC_FLAGS) -o ReadCmdline
+	#$(CC) $(DEFINE) $(CFLAGS) -c -o ReadCmdline.o ReadCmdline.c
+	#$(CC) -o ReadCmdline ReadCmdline.o
 
 UnsafetyOutputTool:
 	$(CC) $(DEFINE) $(InfypwrPsuComm_H) $(CFLAGS) -c -o OutputTask.o OutputTask.c

+ 20 - 11
EVSE/Projects/DD360ComBox/Apps/ModuleDoComm/DoComm.c

@@ -35,12 +35,8 @@
 //#define log_error(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
 
 //------------------------------------------------------------------------------
-//static int TcpSock = 0;
-//static uint8_t PacketSe;
-static DoCommGblData gDoCommGblData = {0};
+static DoCommGblData gDoCommGblData             = {0};
 
-//static struct SysConfigAndInfo *ShmSysConfigAndInfo = NULL;
-//static struct StatusCodeData *ShmStatusCodeData     = NULL;
 static struct SysConfigData *pSysConfig         = NULL;
 static struct SysInfoData *pSysInfo             = NULL;
 static struct WARNING_CODE_INFO *pSysWarning    = NULL;
@@ -49,6 +45,7 @@ static struct PsuData *ShmPsuData               = NULL;
 static struct OCPP16Data *ShmOCPP16Data         = NULL;
 static struct PrimaryMcuData *ShmPrimaryMcuData = NULL;
 static SelectGunInfo *ShmSelectGunInfo          = NULL;
+static DcCommonInfo *ShmDcCommonData            = NULL;
 
 //static struct ChargingInfoData  *ChargingData[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY]
 static struct ChargingInfoData *pDcChargingInfo = NULL;
@@ -844,9 +841,9 @@ static int chargingcapabilityHandle(uint8_t *data, uint8_t plugNum)
     pAccountInfo = (AccountInfo *)&data[addr];
 
     pSysConfig->BillingData.Currency = pAccountInfo->Currency;
-    ShmSelectGunInfo->PricesInfo[plugNum].UserPrices    = transPricesUnit(ntohl(pAccountInfo->UserPrices));
-    pDcChargingInfo->ChargingFee                  = transPricesUnit(ntohl(pAccountInfo->TotalCost));
-    ShmSelectGunInfo->PricesInfo[plugNum].Balance       = transPricesUnit(ntohl(pAccountInfo->Balance));
+    ShmSelectGunInfo->PricesInfo[plugNum].UserPrices = transPricesUnit(ntohl(pAccountInfo->UserPrices));
+    pDcChargingInfo->ChargingFee                     = transPricesUnit(ntohl(pAccountInfo->TotalCost));
+    ShmSelectGunInfo->PricesInfo[plugNum].Balance    = transPricesUnit(ntohl(pAccountInfo->Balance));
 
     if ((pricesInfo[plugNum].UserPrices != ShmSelectGunInfo->PricesInfo[plugNum].UserPrices) ||
             (pricesInfo[plugNum].Balance != ShmSelectGunInfo->PricesInfo[plugNum].Balance)) {
@@ -1054,6 +1051,7 @@ static int responsePackeHandle(int fd, uint8_t *pResult, uint8_t plugNum, uint8_
     uint8_t rawDataLen = 0;
     CsuResultPkt *pCsuResult = (CsuResultPkt *)pResult;
     SoftwareUpdInfo *pSoftwareUpd = NULL;
+    PcPsuOutput *pPcPsuOutput = NULL;
 
     //Hexdump((uint8_t *)pCsuResult, sizeof(CmdHead) + pCsuResult->Head.DataLen);
     if (compareOpcode(pCsuResult->Head.OP) == FAIL ||
@@ -1152,6 +1150,14 @@ static int responsePackeHandle(int fd, uint8_t *pResult, uint8_t plugNum, uint8_
         break;
 
     case REG_PRESENT_CHARGING_INFO:
+        pPcPsuOutput = (PcPsuOutput *)&pCsuResult->Data.Data[0];
+
+        ShmDcCommonData->PcPsuOutput[plugNum].Voltage = ntohs((uint16_t)pPcPsuOutput->Voltage);
+        ShmDcCommonData->PcPsuOutput[plugNum].Current = ntohs((uint16_t)pPcPsuOutput->Current);
+        log_info("%d ower cabinet PSU output vol = %d, cur = %d\r\n",
+                 plugNum,
+                 ShmDcCommonData->PcPsuOutput[plugNum].Voltage,
+                 ShmDcCommonData->PcPsuOutput[plugNum].Current);
         break;
 
     case REG_QRCODE_URL_INFO:
@@ -1227,6 +1233,8 @@ static int composeSocketData(int fd,
 
     ret = responsePackeHandle(fd, (uint8_t *)&csuResult, plugNum, csuCmdPkt.Data.Register);
 
+    gDoCommGblData.DisConnCount = 0; //送收資料沒有問題, 清除中斷網路計數
+
     return ret;
 }
 
@@ -1269,8 +1277,8 @@ static int writePresentChargingInfo(int fd, uint8_t plugNum, uint8_t id)
     PreChargingInfo *pPreChargingInfo = (PreChargingInfo *)dataBuf;
     pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(plugNum);
 
-    pPreChargingInfo->PresentChargingVoltage = htons((uint16_t)pDcChargingInfo->PresentChargingVoltage * 10);
-    pPreChargingInfo->PresentChargingCurrent = htons((uint16_t)pDcChargingInfo->PresentChargingCurrent * 10);
+    pPreChargingInfo->PresentChargingVoltage = htons((uint16_t)(pDcChargingInfo->PresentChargingVoltage * 10));
+    pPreChargingInfo->PresentChargingCurrent = htons((uint16_t)(pDcChargingInfo->PresentChargingCurrent * 10));
     pPreChargingInfo->RemainChargingDuration = htonl(pDcChargingInfo->RemainChargingDuration);
     pPreChargingInfo->EvBatterySoc = pDcChargingInfo->EvBatterySoc;
 
@@ -2241,6 +2249,7 @@ int main(int argc, char *argv[])
     ShmPrimaryMcuData = (struct PrimaryMcuData *)GetShmPrimaryMcuData();
     ShmOCPP16Data = (struct OCPP16Data *)GetShmOCPP16Data();
     ShmSelectGunInfo = (SelectGunInfo *)GetShmSelectGunInfo();
+    ShmDcCommonData = (DcCommonInfo *)GetShmDcCommonData();
 
     totalConnCount = pSysConfig->TotalConnectorCount;
 
@@ -2314,6 +2323,6 @@ int main(int argc, char *argv[])
             updateFirmwareProcess(fd, gDoCommGblData.ConnectorID[0], totalConnCount);
         }
 
-        usleep(10000);
+        usleep(100000);
     }
 }

+ 1 - 1
EVSE/Projects/DD360ComBox/Apps/ModuleDoComm/DoComm.h

@@ -18,7 +18,7 @@
 
 #define MAX_REGISTER_NUM                        30
 
-#define CHECK_NETWORK_FAIL_COUNT                3//10
+#define CHECK_NETWORK_FAIL_COUNT                10//10
 #define CONNECT_SERVER_FAIL_COUNT               3//5
 #define WARNING_CODE_SIZE                       6
 

+ 0 - 1
EVSE/Projects/DD360ComBox/Apps/ModuleEvComm/Module_EvCommOrg.c

@@ -3207,7 +3207,6 @@ int main(int argc, char *argv[])
                     _chargingData[_index]->ChargingProfileCurrent = -1; //DS60-120 add
 
                     if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_MAX) { //DS60-120 add
-
                         _chargingData[_index]->PresentChargingVoltage = 0;
                         _chargingData[_index]->PresentChargingCurrent = 0;
                         _chargingData[_index]->EvBatteryMaxVoltage = 0;

+ 21 - 2
EVSE/Projects/DD360ComBox/Apps/ModuleEvComm/Module_EvRxComm.c

@@ -205,6 +205,8 @@ void CANReceiver(int fd)
         uint8_t targetGun = 0x00;
         uint8_t gunTypeIndex = 0;
         uint8_t ver[16] = {0};
+        uint8_t sameChillerTemp = NO;
+        uint8_t sameConnTemp = NO;
         struct can_frame frame;
         ChillerTemp chiilerTemp = {0};
         struct ChargingInfoData *pDcChargingInfo = NULL;
@@ -224,7 +226,10 @@ void CANReceiver(int fd)
         log_info("Module_EvRXComm Child's PID is %d\r\n", getpid());
 
         while (isContinue) {
+            sameChillerTemp = NO;
+            sameConnTemp = NO;
             memset(&frame, 0, sizeof(struct can_frame));
+
             nbytes = read(fd, &frame, sizeof(struct can_frame));
             if (nbytes <= 0) {
                 usleep(10000);
@@ -463,15 +468,29 @@ void CANReceiver(int fd)
                 }
                 }*/
 
-                if ((ShmDcCommonData->ChillerValve.MultiChillerGun & 0x80) == YES) {
+                if (ShmDcCommonData->TestTemperature == YES) { //ReadCmdline test
+                    break;
+                }
+
+                if (((ShmDcCommonData->ChillerValve.MultiChillerGun & 0x80) >> 7) == YES) {
                     getChillerTemperature(&chiilerTemp);
+                    if (getMaxConnectTemp(chiilerTemp.Temp[0], chiilerTemp.Temp[1]) == (pDcChargingInfo->ChillerTemp + 3)) {
+                        sameChillerTemp = YES;
+                    }
+
                     pDcChargingInfo->ChillerTemp = getMaxConnectTemp(chiilerTemp.Temp[0], chiilerTemp.Temp[1]);
                 }
 
+                if (getMaxConnectTemp(frame.data[1], frame.data[2]) == (pDcChargingInfo->ConnectorTemp + 3)) {
+                    sameConnTemp = YES;
+                }
+
                 pDcChargingInfo->ConnectorTemp = getMaxConnectTemp(frame.data[1], frame.data[2]);
 
                 //紀錄槍頭和水冷機溫度, 在系統狀態變化或溫度大於150
-                if ((ShmDcCommonData->SystemModeChange == YES) ||
+                if (((sameConnTemp == YES) ||
+                        (sameChillerTemp == YES)) &&
+                        (ShmDcCommonData->SystemModeChange == YES) ||
                         (((pDcChargingInfo->ConnectorTemp >= GUN_OTP_VALUE) &&
                           (pDcChargingInfo->ConnectorTemp != UNDEFINED_TEMP)) ||
                          ((pDcChargingInfo->ChillerTemp >= GUN_OTP_VALUE) &&

+ 57 - 2
EVSE/Projects/DD360ComBox/Apps/ModuleEvComm/Module_EvTxComm.c

@@ -421,6 +421,60 @@ static void GetMaxVolAndCurMethod(uint8_t index, float *vol, float *cur)
     }
 }
 
+/**
+ * [SetPresentChargingOutputFromPcPsu 充電狀態讀取電源櫃PSU輸出電壓電流,縮小誤差值]
+ * @Author   Jerry
+ * @DateTime 2021-07-05
+ */
+static void SetPresentChargingOutputFromPcPsu(uint8_t gunCount)
+{
+    float vol1 = 0, cur1 = 0;
+    float vol2 = 0, cur2 = 0;
+    PcPsuOutput *pPcPsuOutput0 = NULL;
+    PcPsuOutput *pPcPsuOutput1 = NULL;
+
+    switch (gunCount) {
+    case 1:
+        pPcPsuOutput0 = (PcPsuOutput *)&ShmDcCommonData->PcPsuOutput[0];
+        pPcPsuOutput1 = (PcPsuOutput *)&ShmDcCommonData->PcPsuOutput[0];
+        break;
+
+    case 2:
+        pPcPsuOutput0 = (PcPsuOutput *)&ShmDcCommonData->PcPsuOutput[0];
+        pPcPsuOutput1 = (PcPsuOutput *)&ShmDcCommonData->PcPsuOutput[1];
+        break;
+    }
+
+    vol1 = (((float)pPcPsuOutput0->Voltage) * 0.1);
+    cur1 = (((float)pPcPsuOutput0->Current) * 0.1);
+    vol2 = (((float)pPcPsuOutput1->Voltage) * 0.1);
+    cur2 = (((float)pPcPsuOutput1->Current) * 0.1);
+
+    if (
+        (LogInfo[0][EV_LOG_NOW_OUTPUT_VOL] >= vol1 + CHK_VOL_RANGE) ||
+        (LogInfo[0][EV_LOG_NOW_OUTPUT_VOL] <= vol1 - CHK_VOL_RANGE) ||
+        (LogInfo[0][EV_LOG_NOW_OUTPUT_CUR] >= cur1 + CHK_CUR_RANGE) ||
+        (LogInfo[0][EV_LOG_NOW_OUTPUT_CUR] <= cur1 - CHK_CUR_RANGE) ||
+        (LogInfo[1][EV_LOG_NOW_OUTPUT_VOL] >= vol2 + CHK_VOL_RANGE) ||
+        (LogInfo[1][EV_LOG_NOW_OUTPUT_VOL] <= vol2 - CHK_VOL_RANGE) ||
+        (LogInfo[1][EV_LOG_NOW_OUTPUT_CUR] >= cur2 + CHK_CUR_RANGE) ||
+        (LogInfo[1][EV_LOG_NOW_OUTPUT_CUR] <= cur2 - CHK_CUR_RANGE)
+    ) {
+        log_info("G1 -> Output Vol = %.1f, Output Cur = %.1f -- G2 -> Output Vol = %.1f, Output Cur = %.1f\r\n",
+                 vol1 / 10,
+                 cur1 / 10,
+                 vol2 / 10,
+                 cur2 / 10);
+
+        LogInfo[0][EV_LOG_NOW_OUTPUT_VOL] = vol1;
+        LogInfo[0][EV_LOG_NOW_OUTPUT_CUR] = cur1;
+        LogInfo[1][EV_LOG_NOW_OUTPUT_VOL] = vol2;
+        LogInfo[1][EV_LOG_NOW_OUTPUT_CUR] = cur2;
+    }
+
+    SetPresentOutputPower(vol1, cur1, vol2, cur2);
+}
+
 static void SetPresentChargingOutputPower(void)
 {
     float vol1 = 0, cur1 = 0;
@@ -503,7 +557,7 @@ static void checkConnectorOVPState(uint8_t gunIndex)
         break;
     }
 
-    if (ShmDcCommonData->ChillerTempState[gunIndex].StatusBit.ChillerOTP == YES) {
+    if (ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerOTP == YES) {
         isOTP = true;
     }
 
@@ -905,7 +959,8 @@ int main(int argc, char *argv[])
                 GetOutputReq(gunIndex, pDcChargingInfo->Evboard_id);
 
                 // 設定當前輸出
-                SetPresentChargingOutputPower();
+                //SetPresentChargingOutputPower();
+                SetPresentChargingOutputFromPcPsu(pSysConfig->TotalConnectorCount);
 
                 // for test end
                 if (priorityLow % 5 == 0) {

+ 1 - 0
EVSE/Projects/DD360ComBox/Apps/ModuleEventLog/Module_EventLogging.c

@@ -29,6 +29,7 @@
 
 #include "../Log/log.h"
 #include "../ShareMemory/shmMem.h"
+#include "../DataBase/DataBase.h"
 #include "../Define/define.h"
 #include "../Config.h"
 

+ 9 - 4
EVSE/Projects/DD360ComBox/Apps/ModuleInternalComm/RelayBoard.c

@@ -1011,8 +1011,8 @@ void GetPersentOutputVol(void)
         case 0x01:
 #if defined DD360 || defined DD360Audi || defined DD360ComBox
             pDcChargingInfo->FireChargingVoltage = ShmRelayModuleData->Gun1RelayOutputVolt;
-            pDcChargingInfo->PresentChargingCurrent = ShmRelayModuleData->Gun1FuseOutputVolt / 10;
-            pDcChargingInfo->PresentChargingVoltage = pDcChargingInfo->FireChargingVoltage / 10;
+            pDcChargingInfo->PresentChargingCurrent = ((float)ShmRelayModuleData->Gun1FuseOutputVolt) / 10;
+            pDcChargingInfo->PresentChargingVoltage = ((float)pDcChargingInfo->FireChargingVoltage) / 10;
             pDcChargingInfo->FuseChargingVoltage = pDcChargingInfo->FireChargingVoltage;
             break;
 #endif //defined DD360 || defined DD360Audi || defined DD360ComBox
@@ -1024,8 +1024,8 @@ void GetPersentOutputVol(void)
         case 0x02:
 #if defined DD360 || defined DD360Audi || defined DD360ComBox
             pDcChargingInfo->FireChargingVoltage = ShmRelayModuleData->Gun2RelayOutputVolt;
-            pDcChargingInfo->PresentChargingCurrent = ShmRelayModuleData->Gun2FuseOutputVolt / 10;
-            pDcChargingInfo->PresentChargingVoltage = pDcChargingInfo->FireChargingVoltage / 10;
+            pDcChargingInfo->PresentChargingCurrent = ((float)ShmRelayModuleData->Gun2FuseOutputVolt) / 10;
+            pDcChargingInfo->PresentChargingVoltage = ((float)pDcChargingInfo->FireChargingVoltage) / 10;
             pDcChargingInfo->FuseChargingVoltage = pDcChargingInfo->FireChargingVoltage;
             break;
 #endif //defined DD360 || defined DD360Audi || defined DD360ComBox
@@ -1035,6 +1035,11 @@ void GetPersentOutputVol(void)
             break;
         }
 
+        //log_info("%d persent vol = %f, cur = %f\r\n",
+        //         index,
+        //         pDcChargingInfo->PresentChargingVoltage,
+        //         pDcChargingInfo->PresentChargingCurrent);
+
         //unsigned short Ovp = 0;
         //unsigned short Ocp = 0;
         //Ovp = MIN [VOUT_MAX_VOLTAGE, EV_BATTERY_VOLTAGE]  // 最大輸出電壓與電池電壓最大值

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 352 - 359
EVSE/Projects/DD360ComBox/Apps/ReadCmdline.c


+ 5 - 0
EVSE/Projects/DD360ComBox/Apps/ShareMemory/shmMem.c

@@ -542,6 +542,7 @@ void InitialShareMemoryInfo(void)
     //ShmDcCommonData->acContactSwitch = NO;
     ShmDcCommonData->ConnectErrList[0].GunErrMessage = 0;
     ShmDcCommonData->ConnectErrList[1].GunErrMessage = 0;
+    ShmDcCommonData->TestTemperature = NO;
     //ShmDcCommonData->LcmFwVersion = 0;
 }
 
@@ -968,6 +969,7 @@ bool MappingGunChargingInfo(char *whichTask)
     struct ChargingInfoData *pAcChargingInfo = NULL;
 
     if (ShmSysConfigAndInfo == NULL) {
+        log_error("ShmSysConfigAndInfo failed\r\n");
         return false;
     }
 
@@ -1029,6 +1031,9 @@ bool MappingGunChargingInfo(char *whichTask)
 
     //log_info("Type 0~3 = CHAdeMO, CCS, GB, AC");
     if (pSysConfig->TotalConnectorCount == 0 && pSysConfig->AcConnectorCount == 0) {
+        log_error("DC %d or AC %d connector failed\r\n",
+                  pSysConfig->TotalConnectorCount,
+                  pSysConfig->AcConnectorCount);
         result = false;
     }
 

+ 1 - 0
EVSE/Projects/DD360ComBox/Apps/ShareMemory/shmMem.h

@@ -67,4 +67,5 @@ void MappingChargingInfoData(void);
 void *GetShmSelectGunInfo(void);
 
 int InitSelectGunShmMem(void);
+
 #endif /* _CSU_SHARE_MEMORY_H_ */

BIN
EVSE/Projects/DD360ComBox/Images/FactoryDefaultConfig.bin


BIN
EVSE/Projects/DD360ComBox/Images/ramdisk.gz


BIN
EVSE/Projects/DD360ComBox/output/FactoryConfig


BIN
EVSE/Projects/DD360ComBox/output/Module_DoComm


BIN
EVSE/Projects/DD360ComBox/output/Module_EvComm


BIN
EVSE/Projects/DD360ComBox/output/Module_EventLogging


BIN
EVSE/Projects/DD360ComBox/output/Module_InternalComm


BIN
EVSE/Projects/DD360ComBox/output/Module_LcmControl


BIN
EVSE/Projects/DD360ComBox/output/Module_PrimaryComm


BIN
EVSE/Projects/DD360ComBox/output/ReadCmdline


BIN
EVSE/Projects/DD360ComBox/output/main


+ 63 - 7
EVSE/rootfs/var/www/set_charging.php

@@ -834,7 +834,11 @@ img {
 										</div>
 										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>Connector Temperature</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo1']['ConnectorTemp']!=255?$obj['DDChargingInfo1']['ConnectorTemp']:"not supported";?> ℃">
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo1']['ConnectorTemp']!=255?$obj['DDChargingInfo1']['ConnectorTemp']." ℃":"not supported";?>">
+										</div>
+										<div class="form-group ChillerTemp">
+											<label>Chiller Temperature</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo1']['ChillerrTemp']!=255?$obj['DDChargingInfo1']['ChillerTemp']." ℃":"not supported";?>">
 										</div>
 										<div class="form-group" style="display:<?php echo $am001;?>">
 											<label>Present Charging Voltage</label>
@@ -906,7 +910,11 @@ img {
 										</div>
 										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>Connector Temperature</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo2']['ConnectorTemp']!=255?$obj['DDChargingInfo2']['ConnectorTemp']:"not supported";?> ℃">
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo2']['ConnectorTemp']!=255?$obj['DDChargingInfo2']['ConnectorTemp']." ℃":"not supported";?>">
+										</div>
+										<div class="form-group ChillerTemp">
+											<label>Chiller Temperature</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo2']['ChillerTemp']!=255?$obj['DDChargingInfo2']['ChillerTemp']." ℃":"not supported";?>">
 										</div>
 										<div class="form-group" style="display:<?php echo $am001;?>">
 											<label>Present Charging Voltage</label>
@@ -978,7 +986,11 @@ img {
 										</div>
 										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>Connector Temperature</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo3']['ConnectorTemp']!=255?$obj['DDChargingInfo3']['ConnectorTemp']:"not supported";?> ℃">
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo3']['ConnectorTemp']!=255?$obj['DDChargingInfo3']['ConnectorTemp']." ℃":"not supported";?>">
+										</div>
+										<div class="form-group ChillerTemp">
+											<label>Chiller Temperature</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo3']['ChillerTemp']!=255?$obj['DDChargingInfo3']['ChillerTemp']." ℃":"not supported";?>">
 										</div>
 										<div class="form-group" style="display:<?php echo $am001;?>">
 											<label>Present Charging Voltage</label>
@@ -1050,7 +1062,11 @@ img {
 										</div>
 										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>Connector Temperature</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo4']['ConnectorTemp']!=255?$obj['DDChargingInfo4']['ConnectorTemp']:"not supported";?> ℃">
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo4']['ConnectorTemp']!=255?$obj['DDChargingInfo4']['ConnectorTemp']." ℃":"not supported";?>">
+										</div>
+										<div class="form-group ChillerTemp">
+											<label>Chiller Temperature</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo4']['ChilleTemp']!=255?$obj['DDChargingInfo4']['ChillerTemp']." ℃":"not supported";?>">
 										</div>
 										<div class="form-group" style="display:<?php echo $am001;?>">
 											<label>Present Charging Voltage</label>
@@ -1128,9 +1144,14 @@ img {
 										</div>
 										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>Connector Temperature</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['ConnectorTemp']!=255?$obj['ChargingInfo1']['ConnectorTemp']:"not supported";?>">
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['ConnectorTemp']!=255?$obj['ChargingInfo1']['ConnectorTemp']." ℃":"not supported";?>">
 											<input type="hidden" name="ConnectorTemp1" id="ConnectorTemp1" value="<?php echo $obj['ChargingInfo1']['ConnectorTemp'];?>">
 										</div>
+										<div class="form-group ChillerTemp1">
+											<label>Chiller Temperature</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['ChillerTemp']!=255?$obj['ChargingInfo1']['ChillerTemp']." ℃":"not supported";?>">
+											<input type="hidden" name="ChillerTemp" id="ChillerTemp" value="<?php echo $obj['ChargingInfo1']['ChillerTemp'];?>">
+										</div>
 										<div class="form-group" style="display:<?php echo $am001;?>">
 											<label>Present Charging Voltage</label>
 											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo1']['PresentChargingVoltage'],2);?> volt">
@@ -1215,9 +1236,14 @@ img {
 										</div>
 										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>Connector Temperature</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['ConnectorTemp']!=255?$obj['ChargingInfo2']['ConnectorTemp']:"not supported";?>">
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['ConnectorTemp']!=255?$obj['ChargingInfo2']['ConnectorTemp']." ℃":"not supported";?>">
 											<input type="hidden" name="ConnectorTemp2" id="ConnectorTemp2" value="<?php echo $obj['ChargingInfo2']['ConnectorTemp'];?>">
 										</div>
+										<div class="form-group ChillerTemp2">
+											<label>Chiller Temperature</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['ChillerTemp']!=255?$obj['ChargingInfo2']['ChillerTemp']." ℃":"not supported";?>">
+											<input type="hidden" name="ChillerTemp2" id="ChillerTemp2" value="<?php echo $obj['ChargingInfo2']['ChillerTemp'];?>">
+										</div>
 										<div class="form-group" style="display:<?php echo $am001;?>">
 											<label>Present Charging Voltage</label>
 											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo2']['PresentChargingVoltage'],2);?> volt">
@@ -1302,9 +1328,14 @@ img {
 										</div>
 										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>Connector Temperature</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['ConnectorTemp']!=255?$obj['ChargingInfo3']['ConnectorTemp']:"not supported";?>">
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['ConnectorTemp']!=255?$obj['ChargingInfo3']['ConnectorTemp']." ℃":"not supported";?>">
 											<input type="hidden" name="ConnectorTemp3" id="ConnectorTemp3" value="<?php echo $obj['ChargingInfo3']['ConnectorTemp'];?>">
 										</div>
+										<div class="form-group ChillerTemp3">
+											<label>Chiller Temperature</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['ChillerTemp']!=255?$obj['ChargingInfo3']['ChillerTemp']." ℃":"not supported";?>">
+											<input type="hidden" name="ChillerTemp3" id="ChillerTemp3" value="<?php echo $obj['ChargingInfo3']['ChillerTemp'];?>">
+										</div>
 										<div class="form-group" style="display:<?php echo $am001;?>">
 											<label>Present Charging Voltage</label>
 											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo3']['PresentChargingVoltage'],2);?> volt">
@@ -1441,6 +1472,31 @@ img {
 				document.getElementById(this.id+"Text").style.display="none";
 			}
 		});
+		if(document.getElementById("ModelName").value.substr(0,2) == "DO" || document.getElementById("ModelName").value.substr(0,2) == "DK"){
+			document.getElementsByClassName("ChillerTemp").style.display="block";
+		}
+		else{
+			document.getElementsByClassName("ChillerTemp").style.display="none";
+		}
+		if(document.getElementById("ModelName").value.substr(7,1) == "V" || document.getElementById("ModelName").value.substr(7,1) == "F" || document.getElementById("ModelName").value.substr(7,1) == "P" || document.getElementById("ModelName").value.substr(7,1) == "R"){
+			document.getElementsByClassName("ChillerTemp1").style.display="block";
+		}
+		else{
+			document.getElementsByClassName("ChillerTemp1").style.display="none";
+		}
+		if(document.getElementById("ModelName").value.substr(9,1) == "V" || document.getElementById("ModelName").value.substr(9,1) == "F" || document.getElementById("ModelName").value.substr(9,1) == "P" || document.getElementById("ModelName").value.substr(9,1) == "R"){
+			document.getElementsByClassName("ChillerTemp2").style.display="block";
+		}
+		else{
+			document.getElementsByClassName("ChillerTemp2").style.display="none";
+		}
+		if(document.getElementById("ModelName").value.substr(8,1) == "V" || document.getElementById("ModelName").value.substr(8,1) == "F" || document.getElementById("ModelName").value.substr(8,1) == "P" || document.getElementById("ModelName").value.substr(8,1) == "R"){
+			document.getElementsByClassName("ChillerTemp3").style.display="block";
+		}
+		else{
+			document.getElementsByClassName("ChillerTemp3").style.display="none";
+		}
+
 	});
 
 	document.getElementById("save").onclick = function() {

+ 2 - 150
EVSE/rootfs/var/www/set_system.php

@@ -130,12 +130,7 @@ img {
 											<label>
 											<input type="checkbox" id="FactoryConfiguration" name="FactoryConfiguration" <?php echo $obj->{'FactoryConfiguration'}==1?"checked":"";?>>
 											Factory Default Configuration</label>
-<?php /*											<select class="form-control" id="FactoryConfiguration" name="FactoryConfiguration">
-												<option value="0" <?php echo $obj->{'FactoryConfiguration'}=="0"?"selected":""?>>Normal</option>
-												<option value="1" <?php echo $obj->{'FactoryConfiguration'}=="1"?"selected":""?>>Trigger</option>
-											</select>*/?>
 										</div>
-<?php //if(substr($ModelName,0,2)!="DO"){?>
 										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>Authentication</label>
 											<select class="form-control" id="AuthorisationMode" name="AuthorisationMode" onchange="AuthorisationMode_changed()">
@@ -143,7 +138,6 @@ img {
 												<option value="1" <?php echo $obj->{'AuthorisationMode'}=="1"?"selected":""?>>disable</option>
 											</select>
 										</div>
-<?php //} ?>
 										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>Input Voltage R</label>
 											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj->{'InputVoltageR'},2);?> volt">
@@ -164,7 +158,6 @@ img {
 											<input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'SystemFanRotaSpeed'};?> RPM">
 											<input type="hidden" name="SystemFanRotaSpeed" id="SystemFanRotaSpeed" value="<?php echo $obj->{'SystemFanRotaSpeed'};?>">
 										</div>
-<?php //if(substr($ModelName,0,2)!="DO"){?>
 										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>Rfid Card Num Endian</label>
 											<select class="form-control" id="RfidCardNumEndian" name="RfidCardNumEndian">
@@ -221,7 +214,6 @@ img {
 												<option value="2" <?php echo $obj->{'Intensity'}=="2"?"selected":""?>>Brightest</option>
 											</select>
 										</div>
-<?php //} ?>
 <?php if(substr($ModelName,0,2)=="DO" || substr($ModelName,0,2)=="DK"){?>
 										<div class="form-group">
 											<label>Dispenser Quantity</label>
@@ -328,55 +320,6 @@ img {
 											<label>System ID</label>
 											<input type="text" name="DDSystemId<?php echo $idx2; ?>" id="DDSystemId<?php echo $idx2; ?>" class="form-control" value="<?php echo $obj->{'DDSystemId'}[$idx];?>">
 										</div>
-										<div class="form-group">
-											<label>
-											<input type="checkbox" id="DDFactoryConfiguration<?php echo $idx2; ?>" name="DDFactoryConfiguration<?php echo $idx2; ?>" <?php echo $obj->{'DDFactoryConfiguration'}[$idx]==1?"checked":"";?>>
-											Factory Default Configuration</label>
-										</div>
-										<div class="form-group">
-											<label>Authentication</label>
-											<select class="form-control" id="DDAuthorisationMode<?php echo $idx2; ?>" name="DDAuthorisationMode<?php echo $idx2; ?>" onchange="DDAuthorisationMode_changed(<?php echo $idx2; ?>)">
-												<option value="0" <?php echo $obj->{'DDAuthorisationMode'}[$idx]=="0"?"selected":""?>>enable</option>
-												<option value="1" <?php echo $obj->{'DDAuthorisationMode'}[$idx]=="1"?"selected":""?>>disable</option>
-											</select>
-										</div>
-										<div class="form-group">
-											<label>Rfid Card Num Endian</label>
-											<select class="form-control" id="DDRfidCardNumEndian<?php echo $idx2; ?>" name="DDRfidCardNumEndian<?php echo $idx2; ?>">
-												<option value="0" <?php echo $obj->{'DDRfidCardNumEndian'}[$idx]=="0"?"selected":""?>>little endian</option>
-												<option value="1" <?php echo $obj->{'DDRfidCardNumEndian'}[$idx]=="1"?"selected":""?>>big endian</option>
-											</select>
-										</div>
-										<div class="form-group" id="DDstartMode<?php echo $idx2; ?>">
-											<label id="DDisAPPLabel">
-											<input type="checkbox" id="DDisAPP<?php echo $idx2; ?>" name="DDisAPP<?php echo $idx2; ?>" <?php echo $obj->{'DDisAPP'}[$idx]==1?"checked":"";?> onclick="DDisAPP_clicked(<?php echo $idx2; ?>)">
-											APP</label>
-											<label id="DDisQRCodeLabel">
-											<input type="checkbox" id="DDisQRCode<?php echo $idx2; ?>" name="DDisQRCode<?php echo $idx2; ?>" <?php echo $obj->{'DDisQRCode'}[$idx]==1?"checked":"";?> onclick="DDisQRCode_clicked(<?php echo $idx2; ?>)">
-											QR Code</label>
-											<label id="DDisRFIDLabel">
-											<input type="checkbox" id="DDisRFID<?php echo $idx2; ?>" name="DDisRFID<?php echo $idx2; ?>" <?php echo $obj->{'DDisRFID'}[$idx]==1?"checked":"";?> onclick="DDisRFID_clicked(<?php echo $idx2; ?>)">
-											RFID</label>
-										</div>
-										<div class="form-group" id="DDQRCodeMadeModeDiv<?php echo $idx2; ?>">
-											<label>QR Code Made Mode</label>
-											<select class="form-control" id="DDQRCodeMadeMode<?php echo $idx2; ?>" name="DDQRCodeMadeMode<?php echo $idx2; ?>" onchange="DDQRCodeMadeMode_changed(<?php echo $idx2; ?>)">
-												<option value="0" <?php echo $obj->{'DDQRCodeMadeMode'}[$idx]=="0"?"selected":""?>>default</option>
-												<option value="1" <?php echo $obj->{'DDQRCodeMadeMode'}[$idx]=="1"?"selected":""?>>customized</option>
-											</select>
-										</div>
-										<div class="form-group" id="DDQRCodeContentDiv<?php echo $idx2; ?>">
-											<label>QR Code Content</label>
-											<input type="text" name="DDQRCodeContent<?php echo $idx2; ?>" id="DDQRCodeContent<?php echo $idx2; ?>" class="form-control" placeholder="<?php echo $obj->{'DDQRCodeContent'}[$idx];?>" value="<?php echo $obj->{'DDQRCodeContent'}[$idx];?>">
-										</div>
-										<div class="form-group">
-											<label>LED Intensity</label>
-											<select class="form-control" id="DDIntensity<?php echo $idx2; ?>" name="DDIntensity<?php echo $idx2; ?>">
-												<option value="0" <?php echo $obj->{'DDIntensity'}[$idx]=="0"?"selected":""?>>Darkest</option>
-												<option value="1" <?php echo $obj->{'DDIntensity'}[$idx]=="1"?"selected":""?>>Medium</option>
-												<option value="2" <?php echo $obj->{'DDIntensity'}[$idx]=="2"?"selected":""?>>Brightest</option>
-											</select>
-										</div>
 									</section>
 								</article>
 								<article class="envor-sorting-item css">
@@ -464,22 +407,9 @@ img {
 		else{
 			document.getElementById("AcModelNameDiv").style.display="none";
 		}
-<?php if(substr($ModelName,0,2)=="DO" || substr($ModelName,0,2)=="DK"){?>
-<?php for($idx=0;$idx<$obj->{'DispenserQuantity'};$idx++){ $idx2=$idx+1;?>
-		DDisQRCode_clicked(<?php echo $idx2; ?>);
-		DDAuthorisationMode_changed(<?php echo $idx2; ?>);
-		DDQRCodeMadeMode_changed(<?php echo $idx2; ?>);
-<?php }} else { ?>
-		if(document.getElementById("ModelName").value.substr(8,1) != "0"){
-//			document.getElementById("AcRatingCurrentDiv").style.display="block";
-		}
-		else{
-//			document.getElementById("AcRatingCurrentDiv").style.display="none";
-		}
 		isQRCode_clicked();
 		AuthorisationMode_changed();
 		QRCodeMadeMode_changed();
-<?php } ?>
 	});
 
 	document.getElementById("save").onclick = function() {
@@ -495,7 +425,6 @@ img {
 			var data =  "SystemId=" + document.getElementById("SystemId").value+
 						"&SystemDateTime=" + document.getElementById("SystemDateTime").value+
 						"&FactoryConfiguration=" + (document.getElementById("FactoryConfiguration").checked?1:0);
-<?php //if(substr($ModelName,0,2)!="DO"){?>
 				data +=  "&PhaseLossPolicy=" + document.getElementById("PhaseLossPolicy").value+
 						"&AuthorisationMode=" + document.getElementById("AuthorisationMode").value+
 						"&isAPP=" + (document.getElementById("isAPP").checked?1:0)+
@@ -506,20 +435,10 @@ img {
 						"&Intensity=" + document.getElementById("Intensity").value+
 						"&RfidCardNumEndian=" + document.getElementById("RfidCardNumEndian").value+
 						"&PsuAcInputType=" + document.getElementById("PsuAcInputType").value;
-<?php //} ?>
+
 <?php if(substr($ModelName,0,2)=="DO" || substr($ModelName,0,2)=="DK"){?>
 <?php for($idx=0;$idx<$obj->{'DispenserQuantity'};$idx++){ $idx2=$idx+1;?>
-				data +=  "&DDSystemId<?php echo $idx2; ?>=" + document.getElementById("DDSystemId<?php echo $idx2; ?>").value+
-						"&DDFactoryConfiguration<?php echo $idx2; ?>=" + (document.getElementById("DDFactoryConfiguration<?php echo $idx2; ?>").checked?1:0)+
-						"&DDAuthorisationMode<?php echo $idx2; ?>=" + document.getElementById("DDAuthorisationMode<?php echo $idx2; ?>").value+
-						"&DDisAPP<?php echo $idx2; ?>=" + (document.getElementById("DDisAPP<?php echo $idx2; ?>").checked?1:0)+
-						"&DDisQRCode<?php echo $idx2; ?>=" + (document.getElementById("DDisQRCode<?php echo $idx2; ?>").checked?1:0)+
-						"&DDisRFID<?php echo $idx2; ?>=" + (document.getElementById("DDisRFID<?php echo $idx2; ?>").checked?1:0)+
-						"&DDQRCodeMadeMode<?php echo $idx2; ?>=" + document.getElementById("DDQRCodeMadeMode<?php echo $idx2; ?>").value+
-						"&DDQRCodeContent<?php echo $idx2; ?>=" + document.getElementById("DDQRCodeContent<?php echo $idx2; ?>").value+
-						"&DDIntensity<?php echo $idx2; ?>=" + document.getElementById("DDIntensity<?php echo $idx2; ?>").value+
-						"&DDRfidCardNumEndian<?php echo $idx2; ?>=" + document.getElementById("DDRfidCardNumEndian<?php echo $idx2; ?>").value;
-
+				data +=  "&DDSystemId<?php echo $idx2; ?>=" + document.getElementById("DDSystemId<?php echo $idx2; ?>").value;
 <?php }} ?>
 			// POST 請求必須設置表頭在 open() 下面,send() 上面
 			request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
@@ -548,15 +467,6 @@ img {
 		var SystemDateTime = document.getElementById("SystemDateTime").value;
 		var result=true;
 
-/*
-		if(SystemId.length < 1)
-		{
-			alert("SystemId format is not correct, ID is required .");
-			document.getElementById("SystemId").focus();
-			result = false;
-		}
-
-*/
 		return result;
 	}
 
@@ -579,25 +489,6 @@ img {
 		}
 	}
 
-	function DDAuthorisationMode_changed(i){
-		if(document.getElementById("DDAuthorisationMode"+i).value == "0"){
-//			if(document.getElementById("DDModelName"+i).value.substr(0,1) == "D"){
-				document.getElementById("DDstartMode"+i).style.display="block";
-				DDisQRCode_clicked(i);
-//			}
-			if(!document.getElementById("DDisAPP"+i).checked && !document.getElementById("DDisRFID"+i).checked && !document.getElementById("DDisQRCode"+i).checked){
-				alert("Please choose one of 'APP、QR code、RFID'");
-				document.getElementById("DDisAPP"+i).checked=true;
-				document.getElementById("DDisQRCode"+i).checked=true;
-				document.getElementById("DDisRFID"+i).checked=true;
-			}
-		}
-		else{
-			document.getElementById("DDstartMode"+i).style.display="none";
-			document.getElementById("DDQRCodeMadeModeDiv"+i).style.display="none";
-		}
-	}
-
 	function isQRCode_clicked(){
 		if(document.getElementById("isQRCode").checked){
 			document.getElementById("QRCodeMadeModeDiv").style.display="block";
@@ -613,21 +504,6 @@ img {
 		}
 	}
 
-	function DDisQRCode_clicked(i){
-		if(document.getElementById("DDisQRCode"+i).checked){
-			document.getElementById("DDQRCodeMadeModeDiv"+i).style.display="block";
-			DDQRCodeMadeMode_changed(i);
-		}
-		else{
-			document.getElementById("DDQRCodeMadeModeDiv"+i).style.display="none";
-			document.getElementById("DDQRCodeContentDiv"+i).style.display="none";
-			if(document.getElementById("DDAuthorisationMode"+i).value == "0" && !document.getElementById("DDisAPP"+i).checked && !document.getElementById("DDisRFID"+i).checked){
-				alert("Please choose one of 'APP、QR code、RFID'");
-				document.getElementById("DDisQRCode"+i).checked=true;
-			}
-		}
-	}
-
 	function isAPP_clicked(){
 		if((document.getElementById("ModelName").value.substr(0,1) == "D" || document.getElementById("ModelName").value.substr(0,2) == "AX") && document.getElementById("AuthorisationMode").value == "0" && !document.getElementById("isQRCode").checked && !document.getElementById("isAPP").checked && !document.getElementById("isRFID").checked){
 			alert("Please choose one of 'APP、QR code、RFID'");
@@ -635,13 +511,6 @@ img {
 		}
 	}
 
-	function DDisAPP_clicked(i){
-		if(document.getElementById("DDAuthorisationMode"+i).value == "0" && !document.getElementById("DDisQRCode"+i).checked && !document.getElementById("DDisAPP"+i).checked && !document.getElementById("DDisRFID"+i).checked){
-			alert("Please choose one of 'APP、QR code、RFID'");
-			document.getElementById("DDisAPP"+i).checked=true;
-		}
-	}
-
 	function isRFID_clicked(){
 		if((document.getElementById("ModelName").value.substr(0,1) == "D" || document.getElementById("ModelName").value.substr(0,2) == "AX") && document.getElementById("AuthorisationMode").value == "0" && !document.getElementById("isQRCode").checked && !document.getElementById("isAPP").checked && !document.getElementById("isRFID").checked){
 			alert("Please choose one of 'APP、QR code、RFID'");
@@ -649,13 +518,6 @@ img {
 		}
 	}
 
-	function DDisRFID_clicked(i){
-		if(document.getElementById("DDAuthorisationMode"+i).value == "0" && !document.getElementById("DDisQRCode"+i).checked && !document.getElementById("DDisAPP"+i).checked && !document.getElementById("DDisRFID"+i).checked){
-			alert("Please choose one of 'APP、QR code、RFID'");
-			document.getElementById("DDisRFID"+i).checked=true;
-		}
-	}
-
 	function QRCodeMadeMode_changed(){
 		if(document.getElementById("QRCodeMadeMode").value == "1"){
 			document.getElementById("QRCodeContentDiv").style.display="block";
@@ -665,15 +527,6 @@ img {
 		}
 	}
 
-	function DDQRCodeMadeMode_changed(i){
-		if(document.getElementById("DDQRCodeMadeMode"+i).value == "1"){
-			document.getElementById("DDQRCodeContentDiv"+i).style.display="block";
-		}
-		else{
-			document.getElementById("DDQRCodeContentDiv"+i).style.display="none";
-		}
-	}
-
 	Date.prototype.Format = function (fmt) { //author: meizz
 		var o = {
 			"M+": this.getMonth() + 1, //月份
@@ -701,4 +554,3 @@ img {
 	}
 
 </script>
-

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio