Comments (7)
At the moment, the EXI encoder does only support one type of ContractAuthenticationResponse: it says "authentication done". To support the RFID or similar check, we need two different cases, the "done" and the "ongoing" case.
This needs:
- In the exi encoder (OpenV2Gx), between init_dinContractAuthenticationResType() and prepareGlobalStream(), set the field EVSEProcessing to dinEVSEProcessingType_Finished or dinEVSEProcessingType_Ongoing, depending on the first command line parameter. We get the first parameter by calling getIntParam(0).
- In pyPLC, add a parameter to the exiEncode("EDl"), something like exiEncode("EDl_"+strAuthFinished), where strAuthFinished is a string with eigther "0" or "1" depending on the result of the RFID check.
from pyplc.
myprogs code update
void encodeContractAuthenticationResponse(void) {
init_dinMessageHeaderWithSessionID();
init_dinBodyType(&dinDoc.V2G_Message.Body);
dinDoc.V2G_Message.Body.ContractAuthenticationRes_isUsed = 1u;
init_dinContractAuthenticationResType(&dinDoc.V2G_Message.Body.ContractAuthenticationRes);
prepareGlobalStream();
int authStatus =getIntParam(0);
if(authStatus==1){
EVSEProcessing=dinEVSEProcessingType_Finished;
}
else{
EVSEProcessing=dinEVSEProcessingType_Ongoing;
}
g_errn = encode_dinExiDocument(&global_stream1, &dinDoc);
printGlobalStream();
sprintf(gInfoString, "encodeContractAuthenticationResponse finished");
}
fsmevse code uptade
if (strConverterResult.find("ContractAuthenticationReq")>0):
if self.rfid_check_successful:
self.strAuthFinished="1"
else:
self.strAuthFinished="0"
# todo: check the request content, and fill response parameters
msg = addV2GTPHeader(exiEncode("EDl"+self.strAuthFinished))
@uhi22 Are there any missteps?
from pyplc.
Looks good, only the underline is missing after the EDI, to separate the parameter.
from pyplc.
@uhi22 I am experiencing this issue every time I run the software. When I unplug and replug the Ethernet cable, the software continues to work. I have also changed my IP address within the software, but this issue persists.
starting in EvseMode, simulated environment
initializing pyPlcWorker
[addressManager] we have local MAC D8:3A:DD:7C:4B:59.
[addressManager] Found 0 link-local IPv6 addresses.
[addressManager] Error: No local Ipv6 address was found.
Exiting, because it does not make sense to continue without IPv6 address
from pyplc.
What is your plan? If you want to run pyPLC against an other machine, the precondition is that an active ethernet connection to the modem is present and the operating system cared for assigning an IP address. Loss of IP adress should be checked in the OS (ipconfig or ifconfig or such things).
If you want to run two instances of pyPLC at the same machine, without ethernet connected, you could try to comment-out the check in addressmanager, I'm not sure whether this solves the issue. Did not use this mode since a long time.
from pyplc.
@uhi22 ****FSMEVSE
if (strConverterResult.find("ContractAuthenticationReq")>0):
# todo: check the request content, and fill response parameters
self.value1, self.value2 = self.hardwareInterface.read_registers()
#print(self.value1)
if(self.value1==4):
self.strAuthFinished="1"
#print("1")
else:
self.strAuthFinished="0"
# print("0")
msg = addV2GTPHeader(exiEncode("EDl_"+self.strAuthFinished)) # EDl for Encode, Din, ContractAuthenticationResponse
if (testsuite_faultinjection_is_triggered(TC_EVSE_ResponseCode_SequenceError_for_ContractAuthenticationRes)):
# send a ContractAuthenticationResponse with Responsecode SequenceError
msg = addV2GTPHeader("809a021a3b7c417774813310c0A200")
self.addToTrace("responding " + prettyHexMessage(msg))
self.showDecodedTransmitMessage(msg)
self.publishStatus("ContractAuthentication")
self.Tcp.transmit(msg)
self.enterState(stateWaitForFlexibleRequest) # todo: not clear, what is specified in DIN
*****OpenV2Gx
int authStatus =getIntParam(0);
if(authStatus==1){
dinDoc.V2G_Message.Body.ContractAuthenticationRes.EVSEProcessing=dinEVSEProcessingType_Finished;
}
else{
dinDoc.V2G_Message.Body.ContractAuthenticationRes.EVSEProcessing=dinEVSEProcessingType_Ongoing;
}
I communicated with the fsmevse software with a different processor from the outside with uart. If the incoming value is 4, "EVSEProcessing": "Finished". If the incoming value is not 4, "EVSEProcessing": "Ongoing",. You can make changes to the software according to your need. It was tested with simulation software. The logs are in the file below. This control software only works with din iso15118 how do we integrate?
from pyplc.
Great, thanks. I now added the authentication feature for both, DIN and ISO1, with these commits:
1171d34
uhi22/OpenV2Gx@0ee2d2a
For demonstration I just used a counter to give the response "ongoing" on the first try, and "finished" at the second try. For real-life usage, the function isUserAuthenticated() needs to be extended with the real RFID check (or whatever).
I tested only the DIN so far, so ISO1 is untested at the moment.
from pyplc.
Related Issues (20)
- TCP connection lost after ContractAuthenticationResponse HOT 1
- [EVSE] Weird behaviour during communication when car is 100% charged HOT 2
- Question for very start HOT 2
- Close connection due to broken connection HOT 48
- pyPlc raspberry pi HOT 29
- pyPLC on Raspberry4 with OS lite HOT 2
- PEV mode connection break after change the deltaSoc HOT 6
- EVSE MODE CANBUS ERROR HOT 2
- DC Electric Vehicle Charging HOT 2
- Raspberry Pi OSError Activateing packet capture failed ERROR HOT 4
- EVSE MODE TCP NOT CONNECTION HOT 1
- PLC MODULE HARDWARE PROBLEM HOT 7
- triggerConnectorLocking & triggerConnectorUnlocking HOT 7
- ISO15118 support? HOT 23
- Detail information for constructing circuit HOT 3
- Viewing Sent and Received Messages Together in Evse Mode HOT 4
- Plc Stamp Mini 2 HOT 2
- Hello programmer
- Encountering issues with V2G communication with Tesla HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyplc.