feature: date and time in exilog

This commit is contained in:
uhi22 2022-12-20 08:35:58 +01:00
parent 1788038e5c
commit 257e5afcb6
3 changed files with 21 additions and 10 deletions

View file

@ -5,7 +5,7 @@
- [ ] Encoder: PreChargeReq: is it possible to enable the units for EVTargetVoltage and EVTargetCurrent? - [ ] Encoder: PreChargeReq: is it possible to enable the units for EVTargetVoltage and EVTargetCurrent?
- [ ] Find out, why Alpi reports CableCheckRes = Finished FAILED in v0.4 - [ ] Find out, why Alpi reports CableCheckRes = Finished FAILED in v0.4
- [ ] Find out, why Compleo ignores the PowerDeliveryReq START in v0.4 - [ ] Find out, why Compleo ignores the PowerDeliveryReq START in v0.4
- [ ] Add date/time into ExiLog - [x] Add date/time into ExiLog
- [ ] PevMode: Add state transition in case of failed CableCheck - [ ] PevMode: Add state transition in case of failed CableCheck
- [x] PevMode: PreChargeReq: Fill EVRESSSOC, EVTargetVoltage, EVTargetCurrent - [x] PevMode: PreChargeReq: Fill EVRESSSOC, EVTargetVoltage, EVTargetCurrent
- [x] PevMode: PowerDeliveryReq: Fill EVRESSSOC, Stop/Start - [x] PevMode: PowerDeliveryReq: Fill EVRESSSOC, Stop/Start
@ -14,9 +14,9 @@
- [ ] EvseMode: Fill V2G messages as far as needed, to convince the car to accept it. - [ ] EvseMode: Fill V2G messages as far as needed, to convince the car to accept it.
- [x] PevMode: Fill V2G messages as far as needed, to convince the charger to accept it. - [x] PevMode: Fill V2G messages as far as needed, to convince the charger to accept it.
- [x] PevMode: Find out the SLAC issue on Supercharger and Compleo. - [x] PevMode: Find out the SLAC issue on Supercharger and Compleo.
- [ ] PevMode: Connect the inlet voltage measurement - [x] PevMode: Connect the inlet voltage measurement
- [x] PevMode: Connect the control of CP - [x] PevMode: Connect the control of CP
- [ ] PevMode: Connect the control of Relay - [x] PevMode: Connect the control of Relay
- [ ] docu: add link to evse which provides the 5% PWM) - [ ] docu: add link to evse which provides the 5% PWM)
- [ ] docu: add hardwareInterface into software architecture puml - [ ] docu: add hardwareInterface into software architecture puml
- [ ] docu: create hardware architecture picture - [ ] docu: create hardware architecture picture

View file

@ -243,14 +243,22 @@ def testReadExiFromSnifferFile():
testDecoder(s, "DD", "") testDecoder(s, "DD", "")
def testReadExiFromExiLogFile(): def testReadExiFromExiLogFile():
file1 = open('PevExiLog_2022-12-13_westparkAlpi_twice.txt', 'r') file1 = open('PevExiLog.txt', 'r')
fileOut = open('PevExiLog_2022-12-13_westparkAlpi_twice.txt.decoded.txt', 'w') fileOut = open('PevExiLog.decoded.txt', 'w')
# example: "ED 809a02004080c1014181c210b8" # example: "ED 809a02004080c1014181c210b8"
# example with timestamp: "2022-12-20T08:17:15.055755=ED 809a02004080c1014181c21198"
Lines = file1.readlines() Lines = file1.readlines()
for myLine in Lines: for myLine in Lines:
if (myLine[1:3]=="D "): # it is DIN posOfEqual=myLine.find("=")
if (posOfEqual>0):
# we have an equal-sign. Take the string behind it.
strToDecode=myLine[posOfEqual+1:]
else:
# no equal-sign. Take the complete line.
strToDecode=myLine
if (strToDecode[1:3]=="D "): # it is DIN
posOfSpace=2 posOfSpace=2
s = myLine[posOfSpace+1:] # The part after the " " contains the EXI hex data. s = strToDecode[posOfSpace+1:] # The part after the " " contains the EXI hex data.
s = s.replace(" ", "") # Remove blanks s = s.replace(" ", "") # Remove blanks
s = s.replace("\n", "") # Remove line feeds s = s.replace("\n", "") # Remove line feeds
#print(s) #print(s)

View file

@ -6,6 +6,7 @@
import pyPlcTcpSocket import pyPlcTcpSocket
import time # for time.sleep() import time # for time.sleep()
from datetime import datetime
from helpers import prettyHexMessage, compactHexMessage from helpers import prettyHexMessage, compactHexMessage
from exiConnector import * # for EXI data handling/converting from exiConnector import * # for EXI data handling/converting
import json import json
@ -43,14 +44,16 @@ class fsmPev():
def exiDecode(self, exidata, schema): def exiDecode(self, exidata, schema):
s = compactHexMessage(exidata) s = compactHexMessage(exidata)
self.exiLogFile.write(schema + " " + s +"\n") # write the EXI data to the exiLogFile strDateTime=datetime.today().strftime('%Y-%m-%dT%H:%M:%S.%f')
self.exiLogFile.write(strDateTime + "=" + schema + " " + s +"\n") # write the EXI data to the exiLogFile
return exiDecode(exidata, schema) # call the decoder return exiDecode(exidata, schema) # call the decoder
def exiEncode(self, input): def exiEncode(self, input):
schema = input[0:2] schema = input[0:2]
exidata = exiEncode(input) # call the encoder exidata = exiEncode(input) # call the encoder
s = exidata # it is already a hex string s = exidata # it is already a hex string
self.exiLogFile.write(schema + " " + s +"\n") # write the EXI data to the exiLogFile strDateTime=datetime.today().strftime('%Y-%m-%dT%H:%M:%S.%f')
self.exiLogFile.write(strDateTime + "=" + schema + " " + s +"\n") # write the EXI data to the exiLogFile
return exidata return exidata
def sendChargeParameterDiscoveryReq(self): def sendChargeParameterDiscoveryReq(self):