mirror of
https://github.com/uhi22/pyPLC.git
synced 2024-11-10 01:05:42 +00:00
Fix: Repeat chargeparameterdiscovery until EVSE_Ready
This commit is contained in:
parent
e4d8a0c921
commit
729c3791eb
1 changed files with 13 additions and 5 deletions
18
fsmPev.py
18
fsmPev.py
|
@ -413,19 +413,27 @@ class fsmPev():
|
||||||
self.addToTrace(strConverterResult)
|
self.addToTrace(strConverterResult)
|
||||||
if (strConverterResult.find("ChargeParameterDiscoveryRes")>0):
|
if (strConverterResult.find("ChargeParameterDiscoveryRes")>0):
|
||||||
strResponseCode = "na"
|
strResponseCode = "na"
|
||||||
|
strEVSEProcessing = "na"
|
||||||
|
strEVSEStatusCode_text = "na"
|
||||||
try:
|
try:
|
||||||
jsondict = json.loads(strConverterResult)
|
jsondict = json.loads(strConverterResult)
|
||||||
strResponseCode = jsondict["ResponseCode"]
|
strResponseCode = jsondict["ResponseCode"]
|
||||||
|
strEVSEProcessing = jsondict["EVSEProcessing"]
|
||||||
|
strEVSEStatusCode_text = jsondict["EVSEStatusCode_text"]
|
||||||
except:
|
except:
|
||||||
self.addToTrace("ERROR: Could not decode the ChargeParameterDiscoveryResponse")
|
self.addToTrace("ERROR: Could not decode the ChargeParameterDiscoveryResponse")
|
||||||
if (strResponseCode!="OK"):
|
if (strResponseCode!="OK"):
|
||||||
self.addToTrace("Wrong response code. Aborting.")
|
self.addToTrace("Wrong response code. Aborting.")
|
||||||
self.enterState(stateUnrecoverableError)
|
self.enterState(stateUnrecoverableError)
|
||||||
return
|
return
|
||||||
# We can have two cases here:
|
# We can have three cases here:
|
||||||
# (A) The charger needs more time to show the charge parameters.
|
# (A) The charger needs more time to show the charge parameters. It does not say "EVSEProcessing": "Finished".
|
||||||
# (B) The charger finished to tell the charge parameters.
|
# (B) The charger finished to tell the charge parameters, but still needs more time for internal purposes.
|
||||||
if (strConverterResult.find('"EVSEProcessing": "Finished"')>0):
|
# It says "EVSEProcessing": "Finished", but also "EVSEStatusCode_text": "EVSE_NotReady". Observed and discussed
|
||||||
|
# here: https://openinverter.org/forum/viewtopic.php?p=58239#p58239
|
||||||
|
# (C) The charger is really finished and able to continue with the next step (cable check).
|
||||||
|
if ((strEVSEProcessing == "Finished") and (strEVSEStatusCode_text == "EVSE_Ready")) :
|
||||||
|
# Case C
|
||||||
self.publishStatus("ChargeParams discovered")
|
self.publishStatus("ChargeParams discovered")
|
||||||
self.addToTrace("Checkpoint550: ChargeParams are discovered. Will change to state C.")
|
self.addToTrace("Checkpoint550: ChargeParams are discovered. Will change to state C.")
|
||||||
#Report charger paramters
|
#Report charger paramters
|
||||||
|
@ -438,7 +446,7 @@ class fsmPev():
|
||||||
self.hardwareInterface.triggerConnectorLocking()
|
self.hardwareInterface.triggerConnectorLocking()
|
||||||
self.enterState(stateWaitForConnectorLock)
|
self.enterState(stateWaitForConnectorLock)
|
||||||
else:
|
else:
|
||||||
# Not (yet) finished.
|
# Not (yet) finished. Cases A and B.
|
||||||
if (self.numberOfChargeParameterDiscoveryReq>=60): # approx 60 seconds, should be sufficient for the charger to find its parameters... The ISO allows up to 55s reaction time and 60s timeout for "ongoing".
|
if (self.numberOfChargeParameterDiscoveryReq>=60): # approx 60 seconds, should be sufficient for the charger to find its parameters... The ISO allows up to 55s reaction time and 60s timeout for "ongoing".
|
||||||
self.addToTrace("ChargeParameterDiscovery lasted too long. " + str(self.numberOfChargeParameterDiscoveryReq) + " Giving up.")
|
self.addToTrace("ChargeParameterDiscovery lasted too long. " + str(self.numberOfChargeParameterDiscoveryReq) + " Giving up.")
|
||||||
self.enterState(stateSequenceTimeout)
|
self.enterState(stateSequenceTimeout)
|
||||||
|
|
Loading…
Reference in a new issue