Giter Club home page Giter Club logo

pyplc's Introduction

CCS hacking: Electric car charging experiments with Python and PLC network adaptors

Goal

This project tries to use cheap powerline network adaptors for communication with electric cars charging system.

There are three different use cases, where this project can be helpful:

  1. Sniffing the traffic between an CCS charger and a car. For instance to measure which side is the limiting element for reduced charging power. In this project, we call this mode ListenMode.
  2. Building a charger for CCS or for AC with digital communication. We call this EvseMode. EvseMode manual
  3. Building a charging unit for a car which does not support powerline communication. Let's call it PevMode.

News / Change History / Functional Status

2023-06-29 v0.9 Released

Highlights:

Main improvements between v0.8 and v0.9:

  • Improved configuration file incl documentation
  • EvseMode: Fix for using the correct SchemaID and checking for DIN protocol in the ProtocolHandshake
  • PevMode: CHAdeMO integrated
  • EvseMode: Sending SOC etc to the SmartEVSE via http
  • Slac: Fix of the RunID

2023-05-22 v0.8 Released

Main improvements between v0.7 and v0.8:

  • PevMode: waiting for contactors closing
  • PevMode: fixes for various timeout times
  • PevMode: locking and unlocking of the connector
  • PevMode: introduction of SafeShutdownSequence in case of errors. This makes sure, that the contactors are opened only if no current flows, and that the connector is unlocked only if the contactors are opened.
  • PevMode: reaction on various error codes and status codes which are reported by the EVSE
  • Testsuite: Automatic run of 16 fault-injection-tests and creation of a test report
  • PevMode: Integration of celeron55's hardware interface
  • PevMode: Startup scripts from celeron55 which create log file and pcap file per session (linux only)
  • Helper: Take a pcap and show voltage, current and SOC in an oscillograph-like diagram (pcapConverter.py, scope.py) https://openinverter.org/forum/viewtopic.php?p=56459#p56459
  • Helper: pcapConverter measures the times for CableCheck and PreCharge
  • Docu: Test results from real-world-chargers (thanks to celeron55 for the many many testing sessions)

2023-05-03 First real charging session

Celeron55 is the winner. He managed to combine all the prerequisits, to have the world wide first pyPlc charging session. Congratulations and thanks for the great contribution. https://openinverter.org/forum/viewtopic.php?p=56188&sid=9579fd29268d0e332c81ed528f59f09b#p56188

2023-04-19 v0.7 Released

Main improvements between v0.6 and v0.7:

  • configuration file
  • redesign of the state machines incl introduction of connection manager. This leads to more clear and consistent state transitions.
  • simulation mode only controlled by command line parameter instead of instable auto-detection
  • more and more consistent data shown in the GUI in both, PevMode and EvseMode
  • PevMode: use EVSEPresentVoltage as criteria for end-of-precharge
  • EvseMode: Simulated PreCharge, using the target value demanded by car.
  • Helper: pcapConverter for converting of pcap files into readable text with the decoded EXI messages
  • PevMode: longer timeout for PowerDeliveryResponse
  • PevMode: preparation to support BeagleBone GPIO
  • PevMode: Logging state names instead of only state numbers
  • Timestamp is logged
  • EvseMode: use random NMK and set it in the modem
  • Improved address resolution (MAC and IP)
  • Added numbered checkpoints in docu and log

2023-04-16 EvseMode brings the Ioniq to close the contactors

With simulated rising EVSEPresentVoltage in the PreChargeResponse, the Ioniq indeed closes the contactors, without the need to feed physical voltage to the CCS DC inlet pins. This is surprising, because - at least for ISO - the specification says that a physical measurement shall be done. The Ioniq does not, it just relys on the reported voltage on the charger. After closing the contacts, there is the accu voltage on the CCS. Not yet tested, whether it is possible to draw some current out of the vehicle. Log here: results/2023-04-16_at_home_Ioniq_in_currentDemandLoop.pcapng Docu here: EvseMode manual

2023-03-03 v0.6 Tea-Time on Alpitronics charger

Made a tea, using the RaspberryPi3 and tpLink modem on Alpitronics hypercharger. Pictures here: https://openinverter.org/forum/viewtopic.php?p=53848#p53848

2023-02-27 PEV mode with OLED-display works on headless Raspberry

  • Charging status is shown on OLED display. Details in hardware.md
  • RaspberryPi 3 configured to auto-start the PEV software as service. Startup time around 21 seconds from power-up until the SLAC starts. Details in installation_on_raspberry.md

2022-12-21 v0.5 Light-bulb-demo-charging works on multiple chargers

2022-12-20 Measurement of inlet voltage works

  • Tests ran on Alpitronics HPC.
  • Measuring the inlet voltage with Arduino "Dieter" works. During CableCheck and PreCharge, the inlet voltage is shown in the GUI.
  • The Alpi confirms the PowerDelivery (start), but rejects the CurrentDemandRequest with FAILED_SequenceError and EVSE_Shutdown.
  • Results (log file and pcap) are stored in https://github.com/uhi22/pyPLC/tree/master/results.

2022-12-13 v0.4 On Compleo, Light Bulb survives 400V cable check and PreCharge

  • SLAC issue is fixed on Compleo. Authorization works. Hardware interface "Dieter" controls the CP into state C.
  • The charger delivers power in the cable check, and a connected 230V bulb makes bright light and survives the 400V.
  • PreCharge starts, but terminates before full voltage is reached. Switching the load with power-relay is not yet implemented from hardware side. Without the load, we see the intended 230V precharge voltage, and run into timeout (to be investigated).

2022-12-02 v0.3 On Alpitonics until ChargeParameterDiscovery

  • TCP connection works now on Alpitronics charger
  • ContractAuthentication loop works

2022-11-25 v0.2 On ABB charger until ChargeParamDiscoveryRequest

  • With Win10 notebook in PevMode, tested on Alpitronics HPC and ABB Triple charger. On the Alpi, the SLAC and SDP works. The TCP connection fails. On ABB, the SLAC, SDP and TCP works. Also the protocol negotiation works. We come until ChargeParamDiscoveryReqest.
  • Log messages are sent via UDP port 514 as broadcast, like Syslog messages. The Wireshark shows them as readable text, so we have the actual communication between car and charger in the trace and also the debug log.
  • Example pcap in results/2022-11-25_v0.2_ABB_until_ChargeParamDiscovery.pcapng
  • With Win10 notebook in EvseMode, tested on the Ioniq car. It comes until the CurrentDemandRequest.
  • For using Raspberry in PevMode without display, there is now the pevNoGui.py, which can be auto-started by configuring a service which calls starter.sh, and this calls starter.py (this is still expermental).
  • The old Raspberry model B needs 90s from power-on until it sends the first log messages. Means, the boot is quite slow.
  • Raspberry in PevMode and Win10 notebook in EvseMode work well together until the PreCharge.
  • Known issues:
    • The TCP port, which is announced in the SDP response, is ignored. This can be the root cause of failing TCP connection on Alpitronics.
    • The SLAC timing includes too long wait times. This may be the root cause for failing SLAC on Supercharger and Compleo.

2022-11-15 [PevMode] Draft of SLAC sequencer

In PevMode, the software runs through the SLAC sequence with a simulated Evse. After SLAC is finished, we send a software version request broadcast message, to find out, whether we have at least two homeplug modems in the network (one for the car and one for the charger). If this is fulfilled, we should use the SDP to discover the chargers IPv6 address. But this is not yet implemented.

2022-11-11 [EvseMode] Ioniq in the PreCharge loop

The EVSE state machine, together with the EXI decoder/encoder, is able to talk to the Ioniq car until the PreCharge loop. The car terminates the loop after some seconds, because the intended voltage is not reached (no physical electricity connected to the charge port). Maybe it is possible to convince the car to close the relay, just by pretending "voltage is reached" in the PreCharge response. But maybe the car makes a plausibilization with the physical voltage, then further development would require a physical power supply.

2022-11-09 [EvseMode][PevMode] Exi decoder first steps working

Using EXI decoder/encoder from basis https://github.com/Martin-P/OpenV2G and created fork https://github.com/uhi22/OpenV2Gx to provide a command-line interface, which can be used by the python script. The OpenV2G includes generated source code for four xml schemas (Handshake, DIN, ISO1, ISO2), provided by Siemens. Seems to be good maintained and is very efficient, because the decoder/encoder are directly available as C code, dedicated for each schema. This skips the slow process of reading the schema, parsing it, creating the grammer information. On Windows10 notebook, measured 15ms for decoder run from python via command line. The OpenV2G was compiled on Windows10 using the included makefile, using the mingw32-make all. The OpenV2G decoder/encoder code reveals some differences between the different schemas (DIN versus ISO). As starting point, only the DIN schema is considered in the command line interface and python part.

The python part now contains the charging state machines for car and charger, as draft.

Using the TPlink and Win10 laptop as evse, connected to Ioniq car, the python script successfully succeeds to SLAC, TCP connection, schema handshake, SessionSetup, ServiceDiscovery, ServicePaymentSelection. It stops on ChargeParameterDiscovery, most likely to missing or wrong implementation. Results (log file and pcap) are stored in https://github.com/uhi22/pyPLC/tree/master/results.

As summary, the concept with the python script together with the compiled EXI decoder works. Further efforts can be spent on completing the missing details of the V2G messages.

2022-10-26 [ListenMode] Network/AVLN is established

Using the TPlink in EVSE mode and Win10 laptop, listening to a communication setup between real car and real alpitronics charger, the python script successfully extracts the NID and NMK from the SLAC_MATCH response, sets this information into the TPlink, and the TPlink turns three LEDs on. Means: Network established. When we send a broadcast software version request, we get three responses: One from the TPlink, one from the PLC modem of the car, and one from the PLC modem of the charger. This confirms, that the network is established. But: From the higher level communication (IPv6, UDP, TCP) we see only the broadcast neighbor solicitation at the beginning. The remaining traffic is hidden, most likely because the TPlink "too intelligent", it knows who has which MAC address and hides traffic which is not intended for the third participant in the network. Trace in results/2022-10-26_WP4_networkEstablishedButHiddenCommunication.pcapng

2022-10-21 [EvseMode] SLAC, SDP and ICMP are working

Using the TPlink and Win10 laptop as evse, the python script runs successfully the SLAC and SDP (SECC discovery protocol). Afterwards, the car uses neighbor solicitation (ICMP) to confirm the IPv6 address, and the Win10 responds to it. The car tries to open the TCP on port 15118, this is failing because of missing implementation of the listener on PC side.

2022-10-19 [ListenMode] Sniffing mode not yet working with the TPlink adaptors

  • with a Devolo dLAN 200 AVplus, software INT6000-MAC-4-4-4405-00-4497-20101201-FINAL-B in original parametrization, it is possible to see the complete SLAC traffic (both directions) which sniffing the communication between a real charger and a real car. This does NOT work with the TPlink adaptors. They route only "their own" direction of the traffic to the ethernet. Means: The pev-configured device does not see the real car, and the evse-configured device does not see the real charger. This is bad for sniffing.

2022-10-19 [EvseMode] Communication/AVLN with Ioniq car established

  • Using a TPlink TL-PA4010P with firmware MAC-QCA7420-1.4.0.20-00-20171027-CS and the PIB configuration file patched for evse according to the open-plc-utils docu.
  • Python software running on Win10, Python 3.10.8
  • On control pilot, sending 5% PWM to initiate digital communication with the car
  • Since the TPlink is configured as coordinator, it sends "alive" messages, and the IONIQ starts sending the SLAC_PARAM.REQ.
  • Per keystroke, we trigger a SET_KEY before the car is connected. The TPlink responds with "rejected", but this is normal, the LEDs are turning off and on, key is accepted.
  • Python script interprets the relevant incoming messages (SLAC_PARAM.REQ, MNBC_SOUND.IND, SLAC_MATCH.REQ) and reacts accordingly.
  • After successfull SLAC sequence, all three LEDs on the TPlink are ON, means: Network (AVLN) is established.
  • In wireshark, we see that the car is sending UDP multicast messages to destination port 15118. This looks like a good sign, that it wants a ISO15118 compatible communication. image

Discussion and Wiki

See openinverter forum https://openinverter.org/forum/viewtopic.php?p=37085#p37085 and the openinverter wiki: https://openinverter.org/wiki/CCS_EVCC_using_AR7420

Quick start / overview

  • Modify a PLC adaptor hardware, that it runs on battery
  • Modify the configuration of the PLC adaptor, that it supports HomePlug Green Phy including the SLAC.
  • Install wireshark to view the network traffic
  • Optional: Install the Plugin for Wireshark from https://github.com/geynis/v2g-ws-dissectors, to decode the V2GTP. This does NOT decode the EXI itself.
  • Install Pcap-ct python library
  • Get and compile the exi decoder/encoder from http://github.com/uhi22/OpenV2Gx
  • Run python pyPlc.py and use keyboard to trigger actions, or
  • Run python pyPlc.py E for EVSE (charger) mode, or
  • Run python pyPlc.py P for PEV mode, or
  • Run python pyPlc.py L for Listen mode

Architecture

architectural overview

Hardware preparation

See Hardware manual

Configuration of the PLC adaptor

The factory settings of the Homeplug PLC adaptor do not in all cases support the requirements of the communication with the car, e.g. the SLAC messages. In detail, the adaptors are supporting HomePlugAV, but we need HomePlugGP (Green Phy). This is similar, but not the same. Fortunately, the supplier of the chipset is aware of this topic, and provides some smart helper tools. http://github.com/qca/open-plc-utils It is worth to read its documentation, starting in docbook/index.html, this contains all what we need for the next steps. A more detailled description and discussion is available in https://openinverter.org/forum/viewtopic.php?p=55120#p55120.

Step-by-Step

(Tested on Linux/Raspbian on a raspberryPi 3)

Clone the http://github.com/qca/open-plc-utils to your raspberry (or other linux computer).

Connect the homeplug modem using an ethernet cable to your raspberry.

Open a command shell on the raspberry.

The description below assumes that the homeplug modem is connected to the ethernet interface eth0. If on your setup you are using an different interface, replace the "eth0" in the commands by the appropriate interface name.

Find the PLC adaptor

	pi@RPi3D:~ $ int6klist -ieth0 -v

This shows the software version and the mac address.

Read the configuration from the PLC adaptor and write it to a file. Use the MAC address which was found out above.

	pi@RPi3D:~ $ plctool -ieth0 -p original.pib  98:48:27:5A:3C:E6
	eth0 98:48:27:5A:3C:E6 Read Module from Memory

Patch the configuration file (see https://github.com/qca/open-plc-utils/blob/master/docbook/ch05s15.html). For each side (pev (vehicle) and evse (charger)) there is a special configuration.

For the pev side:

	pi@RPi3D:~ $ cp original.pib pev.pib
	pi@RPi3D:~ $ setpib pev.pib 74 hfid "PEV"
	pi@RPi3D:~ $ setpib pev.pib F4 byte 1
	pi@RPi3D:~ $ setpib pev.pib 1653 byte 1
	pi@RPi3D:~ $ setpib pev.pib 1C98 long 10240 long 102400

For the evse side:

	pi@RPi3D:~ $ cp original.pib evse.pib
	pi@RPi3D:~ $ setpib evse.pib 74 hfid "EVSE"
	pi@RPi3D:~ $ setpib evse.pib F4 byte 2
	pi@RPi3D:~ $ setpib evse.pib 1653 byte 2
	pi@RPi3D:~ $ setpib evse.pib 1C98 long 10240 long 102400

Write the configuration file to the PLC adaptor. Use the pev.pib or evse.pib depending on your goal. Use the MAC address which you found out above.

	pi@RPi3D:~ $ plctool -ieth0 -P pev.pib  98:48:27:5A:3C:E6
	eth0 98:48:27:5A:3C:E6 Start Module Write Session
	eth0 98:48:27:5A:3C:E6 Flash pev.pib
	...
	eth0 98:48:27:5A:3C:E6 Close Session
	eth0 98:48:27:5A:3C:E6 Reset Device
	eth0 98:48:27:5A:3C:E6 Resetting ...

The open-plc-utils contain the programs evse and pev, which can be used for try-out of the functionality, using two PLC adaptors.

Installation / Preconditions on PC side

Usage on Windows10

See Windows installation manual

Usage on Raspberry

See Raspberry installation manual

Usage on Microcontrollers

This python project is NOT intended for use on microcontrollers like ESP32 or STM32. But there are variants ported to C:

Example flow

This chapter describes the start of a charging session, considering all layers. The checkpoint numbers can be used as reference in code and in the log files. (Todo: Only a few checkpoint numbers are referenced in the code. Adding more is work-in-progress.)

Precondition: On charger side, there is a homeplugGP-capable device present, which is configured as CentralCoordinator.

  • Checkpoint1: The charger (Supply entity communication controller, SECC) creates a "random" value for NID (network ID) and NMK (network membership key), and configures its homeplug modem with these values.
  • Checkpoint2: The charger provides 12V on the control pilot (CP) line (State A).
  • Checkpoint3: The user connects the plug into the car.
  • Checkpoint4: The car pulls the 12V at CP line to 9V (State B).
  • Checkpoint5: The charger sees the level change on CP and applies 5% PWM on CP.
  • Checkpoint6: The car sees the 5%, and interprets it as request for digital communication. It wakes up its communication controller (electric vehicle communication controller, EVCC) and homeplug modem.
  • Checkpoint7: The modem of the car sees homeplug coordinator packets on the CP. This is the precondition that it sends anything on HomePlug.
  • Checkpoint100: The car starts the SLAC sequence by sending SLAC_PARAM.REQ. Can be also two times.
  • Checkpoint101: The charger receives the SLAC_PARAM.REQ and confirms it with SLAC_PARAM.CNF.
  • Checkpoint102: The car receives the SLAC_PARAM.CNF.
  • Checkpoint103: The car sends START_ATTEN_CHAR.IND, to start the attenuation measurement. In total 3 times.
  • Checkpoint104: The car sends MNBC_SOUND.IND, to provide different sounds (signals different frequency ranges). In total 10 times.
  • Checkpoint110: The homeplug modem in the charger should measure the signal strength, and report the values to the SECC in an ethernet frame ATTEN_PROFILE.IND. However, the used homeplug adaptor with AR7420 seems not to support this feature. That's why we need to "guess" some attenuation values for the next step.
  • Checkpoint120: The charger sends ATTEN_CHAR.IND, which contains the number of sounds and for each group the attenuation in dB. Pitfall: The car may ignore implausible values (e.g. all zero dB), and the process may be stuck.
  • Checkpoint130: The car receives the ATTEN_CHAR.IND. If it would receive multiple of them from different chargers (due to cross-coupling), the car decides based on the attenuation levels, which of the charges is the nearest.
  • Checkpoint140: The car sends ATTEN_CHAR.RSP to the charger which reported the loudest signals.
  • Checkpoint150: The car sends SLAC_MATCH.REQ to the charger. This means, it wants to pair with it.
  • Checkpoint155: The charger responds with SLAC_MATCH.CNF. This contains the self-decided NID (network ID) and NMK (network membership key).
  • Checkpoint160: The car receives the SLAC_MATCH.CNF, takes the NID and NMK from this message.
  • Checkpoint170: The car configures its homeplug modem with the received NID and NMK.
  • Checkpoint180: The homeplug modem of the car makes a restart to apply the new settings. This takes approx five seconds. The LEDs of the modem are going off and on again during this restart.
  • Checkpoint190: Now, the homeplug modems of the car and of the charger have formed a "private" Homeplug network (AV logical network, AVLN). The RF traffic can only be decoded by participants who are using the same NID and NMK.
  • Checkpoint200: The car wants to know the chargers IP address. In computer networks, a DHCP would be a usual way to do this. In the CCS world, a different approach is used: SDP, which is the SECC discovery protocol. The DHCP may be also supported as fallback. The car sends a broadcast message "Is here a charger in this network?". Technically, it is an IPv6.UDP.V2GTP.SDP message with 2 bytes payload, which defines the security level expected by the car. In usual case, the car says "I want unprotected TCP.".
  • Checkpoint201: The charger receives the SDP request.
  • Checkpoint202: The charger sends a SDP response "My IP address is xy, I will listen on port abc, and I support unprotected TCP."
  • Checkpoint203: The car receives the SDP response, and takes the IPv6 address and the port from it, to be used later for the TCP connection.
  • Checkpoint204: The car wants to make sure, that the IP addresses are unique and the relation between IP address and MAC address is clear. For this, it sends a "Neighbour solicitation". (This looks a little bit oversized, because only two participants are in the local network, and their addresses have already been exchanged in the above steps. But ICMP is standard technology.)
  • Checkpoint205: The charger responds to the neighbor solicitation request with a neighbor advertisement. This contains the MAC address of the charger. In the case, we use this pyPLC project as charger (EvseMode), we rely on the operating system that it covers the ICMP. On Win10, this works perfectly, the only thing we must make sure, that the MAC and IPv6 of the ethernet port are correctly configured in the python script. Use ipconfig -all on Windows, to find out the addresses. Note: Each of the two participants (car and charger) may initiate the NeighborSolicitation, and the other side needs to respond with a NeighborAdvertisement.
  • Note: It depends on the implementation of the charger and car, at which states the NeighborDiscovery is done. It may be in the middle of the SDP, may be when starting the TCP, and may be never.
  • Checkpoint210: Now, the car and the charger have a clear view about addressing (MAC adresses, IPv6 addresses).
  • Checkpoint300: The charger starts listening on the TCP port which it announced in the SDP response.
  • Checkpoint301: The car requests to open a TCP connection to charger at the port which was announced on the SDP response. This may be 15118 or may be a different port, depending on the chargers implementation. Technically, this is a TCP message with SYN.
  • Checkpoint302: The charger, which was listening on that port, confirms the TCP channel, by sending ACK+SYN.
  • Checkpoint303: The car finishes the TCP connection setup by sending ACK. This is the end of the "three-way-handshake". TCP state machines on both sides are in state "ESTABLISHED". The car and the charger have a reliable, bidirectional TCP channel.
  • Explanation: From now on, the car and the charger use the TCP channel, to exchange V2GTP messages, with EXI content. The charger is the "server" for the EXI, it is just waiting for requests from the car. The car is the "client", it actively initiates the EXI data exchange. The car walks through different states to negotiate, start and supervise the charging process. From communication point of view, the complete process uses XML data, which is packed in EXI frames, which in turn are transported in the TCP channel mentioned above. The overview over the various steps is visible in a sequence chart in [viii].
  • Checkpoint400: The first request-response-pair decides about which XML schema is used for the later communication. This first communication uses a special XML schema, the "application handshake" schema. Afterwards, one of the following three schemas will be used: DIN, ISO1, ISO2. These are different flavours of the DIN/ISO15118 specification, which have small but significant differences. This means, the negotiation of the exact schema is essential for the next step. The car announces the supported application protocols, e.g. DIN or ISO, using the SupportedApplicationProtocolRequest.
  • Checkpoint401: The charger receives SupportedApplicationProtocolRequest and chooses the best application protocol from the list.
  • Checkpoint402: The charger announces the decision with SupportedApplicationProtocolResponse.
  • Checkpoint403: The car receives SupportedApplicationProtocolResponse and knows now, whether the charger supports a compatible XML schema.
  • Checkpoint500: The car initiates the charging session with SessionSetupRequest. The SessionID in this first message is zero, which is the reserved number meaning "new session".
  • Checkpoint505: The charger confirms the session with SessionSetupResponse. In this message, the charger sends for the first time a new, non-zero SessionID. This SessionID is used in all the upcoming messages from both sides.
  • Checkpoint506: The car receives the SessionSetupResponse.
  • Checkpoint510: The car sends ServiceDiscoveryRequest. Usually, this means it says "I want to charge" by setting serviceCathegory=EVCharging.
  • Checkpoint515: The charger confirms with ServiceDiscoveryResponse. This contains the offered services and payment options. Usually it says which type of charging the charger supports (e.g. AC 1phase, AC 3phase, or DC according CCS https://en.wikipedia.org/wiki/IEC_62196#FF), and that the payment should be handled externally by the user, or by the car.
  • Checkpoint520: The car sends ServicePaymentSelectionRequest. Usually (in non-plug-and-charge case), the car says "I cannot pay, something else should handle the payment", by setting paymentOption=ExternalPayment. Optionally it could announce other services than charging, e.g. internet access.
  • Checkpoint525: The charger confirms with ServicePaymentSelectionResponse.
  • Checkpoint530: The car sends ContractAuthenticationRequest. In non-plug-and-charge case this is most likely not containing relevant data.
  • Checkpoint535: The charger confirms with ContractAuthenticationResponse. In case, the user needs to authenticate before charging, this response does NOT yet say EVSEProcessing=Finished. The car repeats the request.
  • Checkpoint536: The user authorizes, e.g. with RFID card or app or however.
  • Checkpoint538: The charger sends ContractAuthenticationResponse with EVSEProcessing=Finished.
  • Checkpoint540: The car sends ChargeParameterRequest. This contains the wanted RequestedEnergyTransferMode, e.g. to select DC or AC and which power pins are used. The car announces the maximum current limit and the maximum voltage limit.
  • Checkpoint545: The charger confirms with ChargeParameterResponse. The contains the limits from charger side, e.g. min and max voltage, min and max current. Now, the initialization phase of the charging session is finished.
  • Checkpoint550: The car changes to CP State to C or D, by applying an additional resistor between CP and ground.
  • Checkpoint555: The car controls the connector lock motor into direction 'lock'.
  • Checkpoint556: The car checks whether the connector lock is confirmed.
  • Checkpoint560: The car sends CableCheckRequest. This contains the information, whether the connector is locked.
  • Checkpoint561: The charger applies voltage to the cable and measures the isolation resistance.
  • Checkpoint565: The charger confirms with CableCheckResponse.
  • Checkpoint566: The CableCheckRequest/CableCheckResponse are repeated until the charger says "Finished".
  • Checkpoint570: The car sends PreChargeRequest. With this, the car announces the target voltage of the charger before closing the circut. The goal is, to adjust the chargers output voltage to match the cars battery voltage. Also a current limit (max 2A) is sent.
  • Checkpoint575: The charger confirms with PreChargeResponse. This response contains the actual voltage on the charger.
  • Checkpoint580: The charger adjusts its output voltage according to the requested voltage.
  • Checkpoint581: The car measures the voltage on the inlet and on the battery. Alternatively, the car does not measure the inlet voltage, and instead listens to the EVSEPresentVoltage which is reported by the charger.
  • Checkpoint582: The above steps (PreChargeRequest, PreChargeResponse, measuring voltage) are repeating, while the present voltage did not yet reach the target voltage.
  • Checkpoint590: If the difference is small enough (less than 20V according to [ref x] chapter 4.4.1.10), the car closes the power relay.
  • Checkpoint600: The car sends PowerDelivery(Start)Request.
  • Checkpoint605: The charger confirms with PowerDeliveryResponse.
  • Checkpoint700: The car sends CurrentDemandRequest (repeated while the charging is ongoing). In this message, the car tells the charger the target voltage and target current.
  • Checkpoint705: The charger confirms with CurrentDemandResponse. This contains the measured voltage, measured current, and flags which show which limitation is active (current limitation, voltage limitation, power limitation).
  • Checkpoint710: The CurrentDemandRequest/CurrentDemandResponse are repeated during the charging.
  • Checkpoint790: When the user stops the charging session on the charger, the charger sends DC_EVSEStatus.EVSEStatusCode = 2 "EVSE_Shutdown" in the CurrentDemandResponse. (Observed on Compleo, see https://github.com/uhi22/Ioniq28Investigations/blob/main/CCM_ChargeControlModule_PLC_CCS/ccm_spi_ioniq_compleo_full_charge_sequence_ended_on_charger.txt.pcap.decoded.txt)
  • Checkpoint800: When the end of charging is decided (battery full or user wish), the car sends PowerDelivery(Stop)Request.
  • Checkpoint805: The charger confirms with PowerDeliveryResponse.
  • Checkpoint806: The car receives the PowerDeliveryResponse.
  • Checkpoint810: The car changes the CP line from StateC to StateB. (according to Figure 107)
  • Checkpoint850: The car sends WeldingDetectionRequest.
  • Checkpoint855: The charger confirms with WeldingDetectionResponse.
  • Checkpoint900: The car sends SessionStopRequest.
  • Checkpoint905: The charger confirms with SessionStopResponse.

Detailled investigation about the normal end of the charging session

  • User presses "Stop" at the charger
  • [10.778] CurrentDemandRes.EVSEStatusCode = 2 EVSE_Shutdown. In the same message, the EVSEPresentCurrent is still 125A.
  • [11.028] PowerDeliveryReq.ReadyToChargeState = 0
  • [12.528] PowerDeliveryRes "OK, DC_EVSEStatus.EVSEStatusCode = 2 EVSE_Shutdown. This does not contain voltage or current.
  • [12.828] WeldingDetectionReq
  • [13.838] WeldingDetectionRes.EVSEPresentVoltage = 109V
  • [13.918] Again WeldingDetectionReq
  • [14.928] WeldingDetectionRes.EVSEPresentVoltage = 65V
  • [15.178] SessionStopReq
  • [15.688] SessionStopRes

ISO

  • After PowerDeliveryRes(Stop), the PEV shall send WeldingDetectionReq within V2G_EVCC_Sequence_Performance_Time (40s) (really: fourty seconds, Table 109).
  • Figure 107: The PEV shall set stateB after receiving PowerDeliveryRes and before WeldingDetectionReq.
  • The time from WeldingDetectionReq until WeldingDetectionResponse shall be below 1.5s, the timeout on PEV side 2s.
  • If the EVSE receives WeldingDetectionReq or SessionStopReq, it shall check for StateB within 1.5s and shall respond "OK" within 1.5s if the StateB was seen, or "FAILED" if the stateB was not seen.

Combined together

  • User presses "Stop" at the charger
  • [10.778] CurrentDemandRes.EVSEStatusCode = 2 EVSE_Shutdown. In the same message, the EVSEPresentCurrent is still 125A.
  • [11.028] PowerDeliveryReq.ReadyToChargeState = 0
  • [12.528] PowerDeliveryRes "OK, DC_EVSEStatus.EVSEStatusCode = 2 EVSE_Shutdown. This does not contain voltage or current.
  • [12.528] StateB
  • [12.600] charger removed the current
  • [12.800] Open contactors
  • [12.828] WeldingDetectionReq
  • [13.838] WeldingDetectionRes.EVSEPresentVoltage = 109V
  • [13.918] Again WeldingDetectionReq
  • [14.928] WeldingDetectionRes.EVSEPresentVoltage = 65V
  • [15.000] The car sees that the voltage is below dangerous level and unlocks the connector. (Better here than after SessionStopReq, because if the charger crashes and does not send a SessionStop, we should not been locked forever.)
  • [15.178] SessionStopReq
  • [15.688] SessionStopRes

Test results on real-world chargers

See charger_test_results.md

Testing And Simulation On Desk

See testing_and_simulation.md

Biggest Challenges

  • [ListenMode] Find a way to enable the sniffer mode or monitor mode in the AR7420. Seems to be not included in the public qca/open-plc-utils. Without this mode, we see only the broadcast messages, not the TCP / UDP traffic between the EVSE and the PEV. The \open-plc-utils\pib\piboffset.xml mentions a setting "SnifferEnable" at 0102 and "SnifferReturnMACAddress" starting at 0103. But setting the enable to 1 and adding a senseful MAC address does not lead to a difference. The docu of qca/open-plc-utils mentions ampsnif and plcsnif, but these are not included. An old release (https://github.com/qca/open-plc-utils/archive/refs/tags/OSR-6010.zip) is mentioning VS_SNIFFER message, ampsnif, plcsnif and even functions Monitor() and Sniffer(), but these are included from a path ../nda/ which is not part of the public repository.

Any idea how to enable full-transparency of the AR7420?

Other open topics

See todo.md and bug_analysis.md

FAQ

Q1: What is the minimal setup, to catch the MAC addresses in the communication between a real charger and a real car?

  • Hardware: A TPlink TL-PA4010P homeplug adaptor, with the configuration for PEV. Modified according to the hardware manual https://github.com/uhi22/pyPLC/blob/master/doc/hardware.md
  • Software: Wireshark. Only wireshark. (The pyPlc project and the exi decoder is NOT necessary to sniff the MAC addresses.)

Q2: Is it possible to use this software, to make the car closing the relay, so that I'm able to draw energy out of the car?

Good question. This depends on how strict the car is. This first hurdle is to convince the car, to close the relay. This is done after a successful PreCharge phase. And it depends on the implementation of the car, whether it needs physically correct voltage on the inlet before closing the relay, or whether it relies on the pretended voltage in the PreChargeResponse message. With setup from EvseMode manual, the Hyundai Ioniq 2016 closes the contactors by just a simulated charging session. Discussion in https://openinverter.org/forum/viewtopic.php?t=3551, pictures here: https://openinverter.org/forum/viewtopic.php?p=55656#p55656 The second hurdle is, that the car may make a plausibilization between the expected current flow (charging) and the actually measured current flow (discharging). The car may stop the complete process, if the deviation is too high or/and too long.

However, the software will help to explore and understand the behavior of the car.

Q3: Is it possible to use this software in a car without CCS, to make it ready for CCS charging?

That's is definitely a goal, and it was reached in the meanwhile. Of course, two aspects need to be considered:

  • This project is not a final product. Further development will be necessary to ensure compatibility with chargers, and make it flexible for practical use.
  • Some parts are not covered by this project at all, e.g. communication with the BMS, connector lock, safety considerations.

Q4: Do I need to go to a public charger to test my Pev integration?

For testing the communication at home, the pyPlc supports both sides of the CCS, the car and the charger. Have a look to testing_and_simulation.md

Q5: What can be the reason, that the charger reports a failed cable check?

In the cable check phase, the charger checks the following things:

  1. CP/PE lines. The charger expects "State C", this means, the car must connect a diode and two resistors between the CP and the PE. This shall result in PWM levels of -12V and +6V. The charger measures these level, and will complain with CableCheck=Failed if it detects a mismatch. Some potential root causes for failed checks are:
  • CP is not connected at all.
  • Diode is missing or has wrong polarity.
  • Diode is too slow to handle the 1kHz/5%PWM.
  • Wrong resistor values chosen or too high tolerance of the resistors
  • Connection between circuit ground and PE missing
  • too high saturation voltage of the switch transistor
  • wrong coupling network between the CP/PE and the PLC modem transformator. This may disturb the PWM levels, due to low-pass-filtering or it may inject too much power from the PLC modem.
  • Software not configured to use the correct output path for the StateC switching
  1. Isolation of the DC path. It is recommended to use two contactors, one for each DC lines, to avoid asymmetrical results in the isolation measurements.
  2. PP line: Some chargers (e.g. some of the Tesla Superchargers) are checking the voltage between the PP line and PE. The "official" recommendation seems to be to use on car side a pull-up of 330 ohm to 5V, and perhaps 3k pulldown to ground. Discussed here: https://openinverter.org/forum/viewtopic.php?p=67464#p67464 However, many chargers (e.g. alpitronics) seem not to care for the PP at all.

Q6: How to connect the PLC modem to the CP and PE?

This is explained in the EvseMode manual. The coupling is the same in EvseMode and PevMode. EvseMode.md FAQ Question 8

Q7: The pyPLC seems to create json data by processing the hexadecimal data of receive data array, how does it do this?

The byte stream which is transferred via the homeplug physical layer runs to the following layers:

  • Ethernet: contains the MAC addresses of the transmitter and receiver
  • IPv6: contains the IP addresses and checksum
  • TCP: assures reliable communication by checking the sequence counters and making retry in case of packet loss
  • V2GTP: is just an additional protocol header to announce which data is transferrred
  • EXI: converts between a byte stream and a structured message

The json data, which is mentioned in the question, is the output of the EXI decoder. The pyPLC uses the following approach for the exi decoder:

  • The exi decoder was developed by Siemens and published here: http://openv2g.sourceforge.net/ This is pure C code, which is very fast, but also needs a lot of RAM and ROM space. It also has the drawback, that it will be not available for the latest updates of the ISO15118 (discussed here: https://openinverter.org/forum/viewtopic.php?p=54026#p54026). There are other exi solutions available, with are worst in terms of speed or availability (used in ref [v] and [vi]).
  • The original Siemens code is mirrored into https://github.com/Martin-P/OpenV2G
  • Since pyPLC is in python and cannot directly use the C code from Siemens, I added a command line interface to it. So python calls the compiled executable exi decoder, gives the input as command line parameter, and gets back the decoded message as standard output of the executable. This standard output is json-like. The extended OpenV2G has the name OpenV2Gx, and is available here: https://github.com/uhi22/OpenV2Gx. The readme contains examples how this can be used stand-alone for decoding and encoding exi message on command line.

Credits

Thanks to catphish to start the investigations regarding the homeplug modems and publishing them on OpenInverter forum. Thanks to johu for the OpenInverter forum, and for the first video of the early experiments, the beaglebone integration and CHAdeMO integration. Thanks to CCSknowitall for clarifying tricky details. Thanks to celeron55 for the large number of test drives to various public chargers, and for improving the software. Thanks for helpful discussions to Pete9008, peternooy, tom91, asavage and all which I forgot to mention. Thanks to arpiecodes, ArendJanKramer, fluppie and co from the SmartEvse project for the contributions. Thanks to all patreons.

Alternatives / Other projects

There are other projects around CCS charging. It's worth a look to the state and progress there.

SwitchEV

EVEREST

SmartEVSE

References

pyplc's People

Contributors

arendjankramer avatar arpiecodes avatar jsphuebner avatar uhi22 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyplc's Issues

Encountering issues with V2G communication with Tesla

We are currently working on a charging station project, and the test subject is a Tesla Model Y from the United States.
The V2G communication data is as follows.
Based on the data, this car supports both the 'urn:din:70121:2012:MsgDef' and 'urn:tesla:din:2018:MsgDef' protocols.We have tested both protocols.

  1. When the 'urn:tesla:din:2018:MsgDef' protocol is selected, after we send the supportedAppProtocolRes, the car also sends an ACK indicating that the data has been successfully received. However, there are no subsequent V2G requests."

  2. When the 'urn:din:70121:2012:MsgDef' protocol is selected, the V2G communication progresses to 'ServiceDiscoveryRes'. After we send the ServiceDiscoveryRes, there are no subsequent V2G requests."

We have been stalled at this point for a long time and hope to get some help,Thank you very much!
logs.zip

Often running into test case 1 TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT

What could be the cause of frequently hitting test case 1 (TC_EVSE_ResponseCode_SequenceError_for_SessionSetup)?
Can you explain what goes wrong?

afbeelding

[64ms] pyPlcTcpSocket listening on port 15118
[64ms] evsepi
[70ms] The socket is linked the following IP addresses:
[70ms] ::1
[70ms] ::1
[70ms] ::1
[100ms] [CONNMGR] ConnectionLevel changed from 0 to 5
[101ms] transmitting SET_KEY.REQ, to configure the EVSE modem with random NMK
[132ms] received SET_KEY.CNF
[132ms] SetKeyCnf says 1, this is formally 'rejected', but indeed ok.
[162ms] [CONNMGR] ConnectionLevel changed from 5 to 15
[26829ms] [CONNMGR] ConnectionLevel changed from 15 to 5
[38204ms] received SLAC_PARAM.REQ
[addressManager] pev has MAC 04:65:65:00:8F:4B
[38205ms] [EVSE] transmitting CM_SLAC_PARAM.CNF
[38449ms] received MNBC_SOUND.IND
[38450ms] received MNBC_SOUND.IND
[38531ms] received MNBC_SOUND.IND
[38532ms] received MNBC_SOUND.IND
[38533ms] received MNBC_SOUND.IND
[38533ms] received MNBC_SOUND.IND
[38615ms] received MNBC_SOUND.IND
[38615ms] received MNBC_SOUND.IND
[38616ms] received MNBC_SOUND.IND
[38616ms] received MNBC_SOUND.IND
[38617ms] [EVSE] transmitting ATTEN_CHAR.IND
[39587ms] received SLAC_MATCH.REQ
[39587ms] [EVSE] transmitting SLAC_MATCH.CNF
[addressManager] pev has IP fe80:0000:0000:0000:0665:65ff:fe00:8f4b
V2GTP (10bytes) = 01 FE 90 00 00 00 00 02 10 00 
Ok, this was a valid SDP request. We are the SECC. Sending SDP response.
SDP payload (20bytes) = FE 80 00 00 00 00 00 00 BC 66 69 FA 28 BE A3 59 3B 0E 10 00 
V2Gframe (28bytes) = 01 FE 90 01 00 00 00 14 FE 80 00 00 00 00 00 00 BC 66 69 FA 28 BE A3 59 3B 0E 10 00 
[44441ms] Connection from ('fe80::665:65ff:fe00:8f4b', 57240, 0, 4)
[44661ms] [EVSE] In state WaitForSupportedApplicationProtocolRequest, received (42bytes) = 01 FE 80 01 00 00 00 22 80 00 DB AB 93 71 D3 23 4B 71 D1 B9 81 89 91 89 D1 91 81 89 91 D2 6B 9B 3A 23 2B 30 02 00 00 04 00 40 
[44673ms] [EVSE] {
"msgName": "supportedAppProtocolReq",
"info": "34 bytes to convert", 
"error": "",
"result": "Vehicle supports 1 protocols. ProtocolEntry#1 ProtocolNamespace=urn:din:70121:2012:MsgDef Version=2.0 SchemaID=1 Priority=1 ",
"schema": "appHandshake",
"debug": ""
}
[44674ms] [EVSE] Detected DIN
[TESTSUITE] Setting up test case 1 TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
[44687ms] [EVSE] responding (12bytes) = 01 FE 80 01 00 00 00 04 80 40 00 40 
[44688ms] [EVSE] from 0 entering 1
[SNIFFER] EXI from 57240 to 15118 (34bytes) = 80 00 DB AB 93 71 D3 23 4B 71 D1 B9 81 89 91 89 D1 91 81 89 91 D2 6B 9B 3A 23 2B 30 02 00 00 04 00 40 
[SNIFFER] EXI from 15118 to 57240 (4bytes) = 80 40 00 40 
[SNIFFER] EXI from 57240 to 15118 (21bytes) = 80 9A 02 00 00 00 00 00 00 00 00 11 D0 18 11 95 94 02 3D 2C 00 
[44964ms] [EVSE] In state WaitForSessionSetupRequest, received (29bytes) = 01 FE 80 01 00 00 00 15 80 9A 02 00 00 00 00 00 00 00 00 11 D0 18 11 95 94 02 3D 2C 00 
[44976ms] [EVSE] {
"msgName": "SessionSetupReq",
"info": "21 bytes to convert", 
"error": "",
"result": "",
"schema": "DIN",
"g_errn": "0",
"header.SessionID": "0000000000000000",
"header.Notification_isUsed": "0",
"header.Signature_isUsed": "0",
"EVCCID.bytesLen": "6",
"EVCCID": "046565008f4b",
"debug": "Line532"
}
[44989ms] [EVSE] responding (31bytes) = 01 FE 80 01 00 00 00 17 80 9A 02 00 40 80 C1 01 41 81 C2 11 E0 20 1D 69 68 C0 C0 C0 C0 C0 80 
[TESTSUITE] Fired test case 1 TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
[44990ms] [EVSE] responding (40bytes) = 01 FE 80 01 00 00 00 20 80 9A 02 32 41 7B 66 15 14 A4 CB 91 E0 A0 2D 06 91 55 95 29 54 8C 08 41 E0 FC 1A F4 50 74 60 C0 
[44991ms] [EVSE] from 1 entering 2
[SNIFFER] EXI from 15118 to 57240 (32bytes) = 80 9A 02 32 41 7B 66 15 14 A4 CB 91 E0 A0 2D 06 91 55 95 29 54 8C 08 41 E0 FC 1A F4 50 74 60 C0 
[45185ms] connection closed
[45186ms] [EVSE] re-initializing fsmEvse due to broken connection
[45186ms] [EVSE] re-initializing fsmEvse
[45186ms] Trying to reset the TCP socket
[45187ms] pyPlcTcpSocket listening on port 15118
[45188ms] The socket is linked the following IP addresses:
[45189ms] ::1
[45189ms] ::1
[45189ms] ::1

Using SmartEVSE. Applying 5% PWM after 12V (DC) switches to 9V.
Car: Hyundai Ioniq Electric 2018 28kWh

DC Electric Vehicle Charging

Hi,

Does this project only allow reading data from the vehicle?

When I run this software with my PWM signal with 5% Duty ratio, can I switch it to State C for DC Charging? @uhi22

Stuck at step with testing exiConnector.py

Hi, I'm following along the manual at https://github.com/uhi22/pyPLC/blob/master/doc/installation_on_raspberry.md

pi@rpievse:~/myprogs/pyPlc $ python exiConnector.py
Testing exiConnector...
Traceback (most recent call last):
  File "/home/pi/myprogs/pyPlc/exiConnector.py", line 317, in <module>
    testReadExiFromExiLogFile()
  File "/home/pi/myprogs/pyPlc/exiConnector.py", line 265, in testReadExiFromExiLogFile
    file1 = open('PevExiLog.txt', 'r')
FileNotFoundError: [Errno 2] No such file or directory: 'PevExiLog.txt'


pi@rpievse:~/myprogs/pyPlc $ sudo python exiConnector.py
Testing exiConnector...
Traceback (most recent call last):
  File "/home/pi/myprogs/pyPlc/exiConnector.py", line 317, in <module>
    testReadExiFromExiLogFile()
  File "/home/pi/myprogs/pyPlc/exiConnector.py", line 265, in testReadExiFromExiLogFile
    file1 = open('PevExiLog.txt', 'r')
FileNotFoundError: [Errno 2] No such file or directory: 'PevExiLog.txt'

I ignored it and continued steps, since this step worked for me:

cd $home/myprogs/OpenV2Gx/Release
	./OpenV2G.exe DD809a0010d0400000c800410c8000
	./OpenV2G.exe EDB_5555aaaa5555aaaa

seeing some data but seeing "[EVSE] re-initializing fsmEvse due to broken connection"

[182099ms] [CONNMGR] 9 0 0 0 0 0 0  --> 5
[184888ms] [CONNMGR] 9 0 0 0 0 0 0  --> 5
[187676ms] [CONNMGR] 9 0 0 0 0 0 0  --> 5
[188353ms] received SLAC_PARAM.REQ
[addressManager] pev has MAC EC:65:CC:B6:85:DC
[188360ms] [EVSE] transmitting CM_SLAC_PARAM.CNF
[188615ms] received MNBC_SOUND.IND
[188620ms] received MNBC_SOUND.IND
[188708ms] received MNBC_SOUND.IND
[188710ms] received MNBC_SOUND.IND
[188713ms] received MNBC_SOUND.IND
[188716ms] received MNBC_SOUND.IND
[188802ms] received MNBC_SOUND.IND
[188805ms] received MNBC_SOUND.IND
[188808ms] received MNBC_SOUND.IND
[188895ms] received MNBC_SOUND.IND
[188897ms] [EVSE] transmitting ATTEN_CHAR.IND
[189742ms] received SLAC_MATCH.REQ
[189746ms] [EVSE] transmitting SLAC_MATCH.CNF
[190507ms] [CONNMGR] 9 0 0 0 0 0 0  --> 5
[193296ms] [CONNMGR] 9 0 0 0 0 0 0  --> 5
[addressManager] pev has IP fe80:0000:0000:0000:ee65:ccff:feb6:85dc
V2GTP (10bytes) = 01 FE 90 00 00 00 00 02 10 00
Ok, this was a valid SDP request. We are the SECC. Sending SDP response.
SDP payload (20bytes) = FE 80 00 00 00 00 00 00 05 A3 B7 59 63 83 F6 D4 3B 0E 10 00
V2Gframe (28bytes) = 01 FE 90 01 00 00 00 14 FE 80 00 00 00 00 00 00 05 A3 B7 59 63 83 F6 D4 3B 0E 10 00
[194321ms] Connection from ('fe80::ee65:ccff:feb6:85dc', 49153, 0, 4)
[SNIFFER] EXI from 49153 to 15118 (34bytes) = 80 00 DB AB 93 71 D3 23 4B 71 D1 B9 81 89 91 89 D1 91 81 89 91 D2 6B 9B 3A 23 2B 30 02 00 00 00 00 40
[194360ms] [EVSE] In state WaitForSupportedApplicationProtocolRequest, received (42bytes) = 01 FE 80 01 00 00 00 22 80 00 DB AB 93 71 D3 23 4B 71 D1 B9 81 89 91 89 D1 91 81 89 91 D2 6B 9B 3A 23 2B 30 02 00 00 00 00 40
[194375ms] [EVSE] {
"msgName": "supportedAppProtocolReq",
"info": "34 bytes to convert",
"error": "",
"result": "Vehicle supports 1 protocols. ProtocolEntry#1 ProtocolNamespace=urn:din:70121:2012:MsgDef Version=2.0 SchemaID=0 Priority=1 ",
"schema": "appHandshake",
"debug": ""
}
[194377ms] [EVSE] Detected DIN
[194392ms] [EVSE] responding (12bytes) = 01 FE 80 01 00 00 00 04 80 40 00 40
[194397ms] [EVSE] from 0 entering 1
[SNIFFER] EXI from 15118 to 49153 (4bytes) = 80 40 00 40
[194446ms] connection closed
[194450ms] [EVSE] re-initializing fsmEvse due to broken connection
[194451ms] [EVSE] re-initializing fsmEvse
[194451ms] Trying to reset the TCP socket
[194455ms] pyPlcTcpSocket listening on port 15118
[194456ms] The socket is linked the following IP addresses:
[194457ms] ::1
[194457ms] ::1
[194457ms] ::1
[196009ms] [CONNMGR] 9 0 0 0 0 0 0  --> 5
[198796ms] [CONNMGR] 9 0 0 0 0 0 0  --> 5
[201580ms] [CONNMGR] 9 0 0 0 0 0 0  --> 5
pi@rpievse:~/myprogs/pyPlc $ python pyPlc.py E
starting in EvseMode
initializing pyPlcWorker
[addressManager] we have local MAC 52:D2:E4:36:AE:06.
[addressManager] Found 1 link-local IPv6 addresses.
fe80::5a3:b759:6383:f6d4
[addressManager] Local IPv6 is fe80::5a3:b759:6383:f6d4
Linux interface is eth1
[addressManager] will give local MAC 52:D2:E4:36:AE:06
[addressManager] will give local MAC 52:D2:E4:36:AE:06
pyPlcIpv6 started with ownMac 52:D2:E4:36:AE:06
[addressManager] will give local MAC 52:D2:E4:36:AE:06
udplog started with ownMac 52:D2:E4:36:AE:06
logging to UDP Syslog is enabled
sniffer created at eth1
[422ms] [HARDWAREINTERFACE] Auto detection of serial ports. Available serial ports:
[437ms] [HARDWAREINTERFACE] ignoring /dev/ttyAMA0, because this is not an USB serial port
[438ms] [HARDWAREINTERFACE] ERROR: No serial ports found. No hardware interaction possible.
[457ms] [pyPlcWorker] Software version v0.8-18-g2b87bca
[458ms] [EVSE] initializing fsmEvse
[461ms] pyPlcTcpSocket listening on port 15118
[461ms] rpievse
[470ms] The socket is linked the following IP addresses:
[470ms] ::1
[470ms] ::1
[470ms] ::1
[501ms] [CONNMGR] ConnectionLevel changed from 0 to 5
[502ms] [CONNMGR] 9 0 0 0 0 0 0  --> 5
[504ms] transmitting SET_KEY.REQ, to configure the EVSE modem with random NMK
[537ms] received SET_KEY.CNF
[538ms] SetKeyCnf says 1, this is formally 'rejected', but indeed ok.
[572ms] [CONNMGR] ConnectionLevel changed from 5 to 15
[1590ms] [CONNMGR] 9 0 0 463 0 0 0  --> 15
[2692ms] [CONNMGR] 9 0 0 430 0 0 0  --> 15
[3796ms] [CONNMGR] 9 0 0 397 0 0 0  --> 15
[4908ms] [CONNMGR] 9 0 0 364 0 0 0  --> 15
[6008ms] [CONNMGR] 9 0 0 331 0 0 0  --> 15
[7109ms] [CONNMGR] 9 0 0 298 0 0 0  --> 15
[8209ms] [CONNMGR] 9 0 0 265 0 0 0  --> 15
[9311ms] [CONNMGR] 9 0 0 232 0 0 0  --> 15
[12092ms] [CONNMGR] 9 0 0 199 0 0 0  --> 15
[14875ms] [CONNMGR] 9 0 0 166 0 0 0  --> 15
[15468ms] received SLAC_PARAM.REQ
[addressManager] pev has MAC EC:65:CC:B6:85:DC
[15477ms] [EVSE] transmitting CM_SLAC_PARAM.CNF
[15733ms] received MNBC_SOUND.IND
[15738ms] received MNBC_SOUND.IND
[15826ms] received MNBC_SOUND.IND
[15829ms] received MNBC_SOUND.IND
[15832ms] received MNBC_SOUND.IND
[15835ms] received MNBC_SOUND.IND
[15922ms] received MNBC_SOUND.IND
[15925ms] received MNBC_SOUND.IND
[15928ms] received MNBC_SOUND.IND
[16015ms] received MNBC_SOUND.IND
[16017ms] [EVSE] transmitting ATTEN_CHAR.IND
[16863ms] received SLAC_MATCH.REQ
[16869ms] [EVSE] transmitting SLAC_MATCH.CNF
[17715ms] [CONNMGR] 9 0 0 133 0 0 0  --> 15
[20499ms] [CONNMGR] 9 0 0 100 0 0 0  --> 15
[addressManager] pev has IP fe80:0000:0000:0000:ee65:ccff:feb6:85dc
V2GTP (10bytes) = 01 FE 90 00 00 00 00 02 10 00
Ok, this was a valid SDP request. We are the SECC. Sending SDP response.
SDP payload (20bytes) = FE 80 00 00 00 00 00 00 05 A3 B7 59 63 83 F6 D4 3B 0E 10 00
V2Gframe (28bytes) = 01 FE 90 01 00 00 00 14 FE 80 00 00 00 00 00 00 05 A3 B7 59 63 83 F6 D4 3B 0E 10 00
[SNIFFER] EXI from 49153 to 15118 (34bytes) = 80 00 DB AB 93 71 D3 23 4B 71 D1 B9 81 89 91 89 D1 91 81 89 91 D2 6B 9B 3A 23 2B 30 02 00 00 00 00 40
[21356ms] Connection from ('fe80::ee65:ccff:feb6:85dc', 49153, 0, 4)
[21394ms] [EVSE] In state WaitForSupportedApplicationProtocolRequest, received (42bytes) = 01 FE 80 01 00 00 00 22 80 00 DB AB 93 71 D3 23 4B 71 D1 B9 81 89 91 89 D1 91 81 89 91 D2 6B 9B 3A 23 2B 30 02 00 00 00 00 40
[21409ms] [EVSE] {
"msgName": "supportedAppProtocolReq",
"info": "34 bytes to convert",
"error": "",
"result": "Vehicle supports 1 protocols. ProtocolEntry#1 ProtocolNamespace=urn:din:70121:2012:MsgDef Version=2.0 SchemaID=0 Priority=1 ",
"schema": "appHandshake",
"debug": ""
}
[21411ms] [EVSE] Detected DIN
[21423ms] [EVSE] responding (12bytes) = 01 FE 80 01 00 00 00 04 80 40 00 40
[21427ms] [EVSE] from 0 entering 1
[SNIFFER] EXI from 15118 to 49153 (4bytes) = 80 40 00 40
[21472ms] connection closed
[21477ms] [EVSE] re-initializing fsmEvse due to broken connection
[21477ms] [EVSE] re-initializing fsmEvse
[21478ms] Trying to reset the TCP socket
[21482ms] pyPlcTcpSocket listening on port 15118
[21483ms] The socket is linked the following IP addresses:
[21484ms] ::1
[21484ms] ::1
[21485ms] ::1
[23205ms] [CONNMGR] 9 0 0 67 0 0 0  --> 15
[25989ms] [CONNMGR] 9 0 0 34 0 0 0  --> 15
[28777ms] [CONNMGR] 9 0 0 1 0 0 0  --> 15
[28863ms] [CONNMGR] ConnectionLevel changed from 15 to 5
[31563ms] [CONNMGR] 9 0 0 0 0 0 0  --> 5
[34349ms] [CONNMGR] 9 0 0 0 0 0 0  --> 5
[37135ms] [CONNMGR] 9 0 0 0 0 0 0  --> 5

Any ideas about this?
[21472ms] connection closed
[21477ms] [EVSE] re-initializing fsmEvse due to broken connection
[21477ms] [EVSE] re-initializing fsmEvse

Remove hardcoded interface names

In pyPlcTcpSocket.py and pyPlcHomeplug.py we have still hardcoded interface names (eth0 or eth1).
Todo: Take these from the ini file.

pyPLC on Raspberry4 with OS lite

Hi guys!

Thanks for your hard work and great advances with this project.

I'm trying to run "pyPLC.py E S" in a raspberry without desktop and getting this message:

starting in EvseMode, simulated environment Traceback (most recent call last): File "/home/pi/myprogs/pyPlc/pyPlc.py", line 96, in <module> root = tk.Tk() ^^^^^^^ File "/usr/lib/python3.11/tkinter/__init__.py", line 2326, in __init__ self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _tkinter.TclError: no display name and no $DISPLAY environment variable
Do you faced this problem before? How can I run using this lite OS?

Thanks.

triggerConnectorLocking & triggerConnectorUnlocking

@uhi22
Hello again UHI
I'm thinking of making changes on the hardware side.
I need to look at fsmPev.py for the charging station software because the Response commands are there. FsmEvse.py Request commands appear.
Do the connector unlocking and closing functions unlock the connectors inside the vehicle or do they perform an operation at our charging station?

Question for very start

Hi, where can I find list of standard PLC messages? I understand EV and EVSE send them via TCP on CP line and I can read them, but I'd like to know whole list of these messages and how to compose and send them. Where could I find this information?

TCP connection lost after ContractAuthenticationResponse

This was observed when pyPLC is used in EvseMode, with Tesla car. Reported here: #6 (comment)

The linked trace with Tesla car shows the issue multiple times, but also contains two good cases, where the connection is stable.

Ideas for potential root causes:

  1. The os decides to reconfigure/shutdown/whatever the connection. This was discussed here: https://github.com/uhi22/pyPLC/blob/master/doc/installation_on_raspberry.md#disable-network-manager-for-the-ethernet-port
  2. Unstable/aborted/wrong CP signalling, 1kHz/5% PWM?
  3. Car fully charged and just rejects the further communication?
  4. (maybe more....)

rpi python pyPlc.py E S not working

Hello

I'm trying to simulate a pyPlc.
python pyPlc.py P S works, but EVSE does not.
The logs are shown below.

Thanks to you, I was able to try slac using the AR7420.

pyplc

Detail information for constructing circuit

Hello.

I used a translator, so my wording may be strange.

I am currently working on an EV related project in graduate school and I am very interested in this project.

I'm trying to construct the circuit myself based on the pictures attached to all the markdown, but I'm having trouble identifying the circuit components correctly.

  1. if you don't mind me asking, is it possible to get the circuit diagram drawn through the software for everyone who is interested in this project and wants to try to construct the circuit?

  2. I would like to purchase the components for the circuit, but the information is scattered in so many different markdown files, is it possible to list up the components used in the circuit?

[EVSE] Weird behaviour during communication when car is 100% charged

Hello!

I'd like to share a weird edge case I encountered today. The car was charged 100% at this point, but for some reason doesn't want to communicate with pyPLC anymore. I'm puzzled as everything seems to be OK.

Jul 14 00:08:31 pievse python3.9[21553]: [469700ms] Connection from ('fe80::xxx:xxx:xxx:xxx', 49160, 0, 3)
Jul 14 00:08:31 pievse python3.9[21553]: [469751ms] [EVSE] In state WaitForSupportedApplicationProtocolRequest, received (76bytes) = 01 FE 80 01 00 00 00 44 80 00 DB AB 93 71 D3 23 4B 71 D1 B9 81 89 91 89 D1 91 81 89 91 D2 6B 9B 3A 23 2B 30 02 00 00 04 00 01 D7 57 26 E3 A6 97 36 F3 A3 13 53 13 13 83 A3 23 A3 23 03 13 33 A4 D7 36 74 46 56 60 04 00 00 00 08 80
Jul 14 00:08:31 pievse python3.9[21553]: [469813ms] [EVSE] {
Jul 14 00:08:31 pievse python3.9[21553]: "msgName": "supportedAppProtocolReq",
Jul 14 00:08:31 pievse python3.9[21553]: "info": "68 bytes to convert",
Jul 14 00:08:31 pievse python3.9[21553]: "error": "",
Jul 14 00:08:31 pievse python3.9[21553]: "result": "Vehicle supports 2 protocols. ProtocolEntry#1 ProtocolNamespace=urn:din:70121:2012:MsgDef Version=2.0 SchemaID=1 Priority=1 ProtocolEntry#2 ProtocolNamespace=urn:iso:15118:2:2013:MsgDef Version=2.0 SchemaID=0 Priority=2 ",
Jul 14 00:08:31 pievse python3.9[21553]: "schema": "appHandshake",
Jul 14 00:08:31 pievse python3.9[21553]: "debug": ""
Jul 14 00:08:31 pievse python3.9[21553]: }
Jul 14 00:08:31 pievse python3.9[21553]: [469830ms] [EVSE] ERROR: Could not decode the supportedAppProtocolReq
Jul 14 00:08:31 pievse python3.9[21553]: [469834ms] [EVSE] Error: The connected car does not support DIN. At the moment, the pyPLC only supports DIN.
Jul 14 00:08:33 pievse python3.9[21553]: [471689ms] [CONNMGR] 9 0 0 0 0 0 0  --> 5
Jul 14 00:08:33 pievse python3.9[21553]: [471698ms] connection closed
Jul 14 00:08:33 pievse python3.9[21553]: [471701ms] [EVSE] re-initializing fsmEvse due to broken connection

Also; for some reason my car likes to return EVRESSSOC = 0 along with EnergyRequest = 0 if it's fully charged;

l 13 23:46:58 pievse python3.9[14583]: [1293353855ms] [EVSE] In state WaitForFlexibleRequest, received (46bytes) = 01 FE 80 01 00 00 00 26 80 9A 02 00 >
Jul 13 23:46:58 pievse python3.9[14583]: [1293353929ms] [EVSE] {
Jul 13 23:46:58 pievse python3.9[14583]: "msgName": "ChargeParameterDiscoveryReq",
Jul 13 23:46:58 pievse python3.9[14583]: "info": "38 bytes to convert",
Jul 13 23:46:58 pievse python3.9[14583]: "error": "",
Jul 13 23:46:58 pievse python3.9[14583]: "result": "",
Jul 13 23:46:58 pievse python3.9[14583]: "schema": "DIN",
Jul 13 23:46:58 pievse python3.9[14583]: "g_errn": "0",
Jul 13 23:46:58 pievse python3.9[14583]: "header.SessionID": "0102030405060708",
Jul 13 23:46:58 pievse python3.9[14583]: "header.Notification_isUsed": "0",
Jul 13 23:46:58 pievse python3.9[14583]: "header.Signature_isUsed": "0",
Jul 13 23:46:58 pievse python3.9[14583]: "EVRequestedEnergyTransferType": "3",
Jul 13 23:46:58 pievse python3.9[14583]: "EVChargeParameter_isUsed": "0",
Jul 13 23:46:58 pievse python3.9[14583]: "DC_EVChargeParameter_isUsed": "1",
Jul 13 23:46:58 pievse python3.9[14583]: "DC_EVStatus.EVRESSSOC": "0",
Jul 13 23:46:58 pievse python3.9[14583]: "DC_EVStatus.EVReady": "0",
Jul 13 23:46:58 pievse python3.9[14583]: "EVCabinConditioning_isUsed": "0",
Jul 13 23:46:58 pievse python3.9[14583]: "EVRESSConditioning_isUsed": "0",
Jul 13 23:46:58 pievse python3.9[14583]: "EVErrorCode": "0",
Jul 13 23:46:58 pievse python3.9[14583]: "DC_EVErrorCodeText": "NO_ERROR",
Jul 13 23:46:58 pievse python3.9[14583]: "EVMaximumCurrentLimit.Value": "3750",
Jul 13 23:46:58 pievse python3.9[14583]: "EVMaximumCurrentLimit.Multiplier": "-1",
Jul 13 23:46:58 pievse python3.9[14583]: "EVMaximumCurrentLimit.Unit_isUsed": "1",
Jul 13 23:46:58 pievse python3.9[14583]: "EVMaximumCurrentLimit.Unit": "3",
Jul 13 23:46:58 pievse python3.9[14583]: "EVMaximumPowerLimit_isUsed": "0",
Jul 13 23:46:58 pievse python3.9[14583]: "EVMaximumPowerLimit.Value": "0",
Jul 13 23:46:58 pievse python3.9[14583]: "EVMaximumPowerLimit.Multiplier": "0",
Jul 13 23:46:58 pievse python3.9[14583]: "EVMaximumPowerLimit.Unit_isUsed": "0",
Jul 13 23:46:58 pievse python3.9[14583]: "EVMaximumPowerLimit.Unit": "0",
Jul 13 23:46:58 pievse python3.9[14583]: "EVMaximumVoltageLimit.Value": "470",
Jul 13 23:46:58 pievse python3.9[14583]: "EVMaximumVoltageLimit.Multiplier": "0",
Jul 13 23:46:58 pievse python3.9[14583]: "EVMaximumVoltageLimit.Unit_isUsed": "1",
Jul 13 23:46:58 pievse python3.9[14583]: "EVMaximumVoltageLimit.Unit": "5",
Jul 13 23:46:58 pievse python3.9[14583]: "EVEnergyCapacity_isUsed": "1",
Jul 13 23:46:58 pievse python3.9[14583]: "EVEnergyCapacity.Value": "6890",
Jul 13 23:46:58 pievse python3.9[14583]: "EVEnergyCapacity.Multiplier": "1",
Jul 13 23:46:58 pievse python3.9[14583]: "EVEnergyCapacity.Unit_isUsed": "1",
Jul 13 23:46:58 pievse python3.9[14583]: "EVEnergyCapacity.Unit": "9",
Jul 13 23:46:58 pievse python3.9[14583]: "EVEnergyRequest_isUsed": "1",
Jul 13 23:46:58 pievse python3.9[14583]: "EVEnergyRequest.Value": "0",
Jul 13 23:46:58 pievse python3.9[14583]: "EVEnergyRequest.Multiplier": "1",
Jul 13 23:46:58 pievse python3.9[14583]: "EVEnergyRequest.Unit_isUsed": "1",
Jul 13 23:46:58 pievse python3.9[14583]: "EVEnergyRequest.Unit": "9",
Jul 13 23:46:58 pievse python3.9[14583]: "FullSOC_isUsed": "1",
Jul 13 23:46:58 pievse python3.9[14583]: "FullSOC": "100",
Jul 13 23:46:58 pievse python3.9[14583]: "BulkSOC_isUsed": "1",
Jul 13 23:46:58 pievse python3.9[14583]: "BulkSOC": "80",
Jul 13 23:46:58 pievse python3.9[14583]: "debug": "Line9057Line9260Line400"
Jul 13 23:46:58 pievse python3.9[14583]: }
Jul 13 23:46:58 pievse python3.9[14583]: [1293353959ms] [EVSE] Received ChargeParameterDiscoveryReq. Extracting SoC parameters via DC
Jul 13 23:46:58 pievse python3.9[14583]: Received SoC status from ChargeParameterDiscoveryReq.
Jul 13 23:46:58 pievse python3.9[14583]:     Current SoC 0%
Jul 13 23:46:58 pievse python3.9[14583]:     Full SoC 100%
Jul 13 23:46:58 pievse python3.9[14583]:     Energy capacity 68900 Wh
Jul 13 23:46:58 pievse python3.9[14583]:     Energy request -1 Wh
Jul 13 23:46:58 pievse python3.9[14583]:     EVCCID xxxxxxxxxx

I could create a workaround for this in the code to assume current_soc = full_soc when both values are explicitly 0. Let me know if that's acceptable.

PEV mode connection break after change the deltaSoc

I have successfully connected the pyPlc in PEV mode to my EVSE and completed the charging process without any issues. However, when I modify the code to change the deltaSoc in hardwareinterface.py to extend the charging period, the charging process consistently stops at around 30% SoC.

Below is the code I've modified:

image

And here is the error log:(57213 is my EVSE)

[80576ms] [PEV] {
"msgName": "CurrentDemandRes",
"info": "39 bytes to convert",
"error": "",
"result": "",
"schema": "DIN",
"g_errn": "0",
"header.SessionID": "76ef8536fc30cafd",
"header.Notification_isUsed": "0",
"header.Signature_isUsed": "0",
"ResponseCode": "OK",
"DC_EVSEStatus.EVSEIsolationStatus": "0",
"DC_EVSEStatus.EVSEIsolationStatus_isUsed": "1",
"DC_EVSEStatus.EVSEStatusCode": "1",
"EVSEStatusCode_text": "EVSE_Ready",
"DC_EVSEStatus.NotificationMaxDelay": "0",
"DC_EVSEStatus.EVSENotification": "0",
"EVSEPresentVoltage.Multiplier": "0",
"EVSEPresentVoltage.Value": "398",
"EVSEPresentVoltage.Unit": "V",
"EVSEPresentCurrent.Multiplier": "2",
"EVSEPresentCurrent.Value": "1",
"EVSEPresentCurrent.Unit": "A",
"EVSECurrentLimitAchieved": "1",
"EVSEVoltageLimitAchieved": "0",
"EVSEPowerLimitAchieved": "1",
"EVSEMaximumVoltageLimit.Multiplier": "2",
"EVSEMaximumVoltageLimit.Value": "4",
"EVSEMaximumVoltageLimit.Unit": "V",
"EVSEMaximumCurrentLimit.Multiplier": "2",
"EVSEMaximumCurrentLimit.Value": "1",
"EVSEMaximumCurrentLimit.Unit": "A",
"EVSEMaximumPowerLimit.Multiplier": "3",
"EVSEMaximumPowerLimit.Value": "25",
"EVSEMaximumPowerLimit.Unit": "W",
"debug": "Line442"
}
[80621ms] [PEV] responding (43bytes) = 01 FE 80 01 00 00 00 23 80 9A 02 1D BB E1 4D BF 0C 32 BF 50 D1 40 06 80 C0 C1 90 60 01 81 05 80 48 0C 08 36
01 00 C1 42 38 0C 00
[80621ms] [PEV] from 14:WaitForCurrentDemandResponse entering 14:WaitForCurrentDemandResponse
[SNIFFER] EXI from 57213 to 52880 (39bytes) = 80 9A 02 1D BB E1 4D BF 0C 32 BF 50 E0 00 00 80 00 01 82 84 70 18 28 18 00 84 04 0A 0A 00 80 50 30 01
03 03 80 C8 00
[81023ms] [CONNMGR] 9 0 0 0 0 0 318 --> 100
[SNIFFER] EXI from 57213 to 52880 (39bytes) = 80 9A 02 1D BB E1 4D BF 0C 32 BF 50 E0 00 00 80 00 01 82 84 70 18 28 18 00 84 04 0A 0A 00 80 50 30 01 03 03 80 C8 00
[SNIFFER] EXI from 57213 to 52880 (39bytes) = 80 9A 02 1D BB E1 4D BF 0C 32 BF 50 E0 00 00 80 00 01 82 84 70 18 28 18 00 84 04 0A 0A 00 80 50 30 01 03 03 80 C8 00
[82164ms] [CONNMGR] 9 0 0 0 0 0 285 --> 100
[83297ms] [CONNMGR] 9 0 0 0 0 0 252 --> 100
[SNIFFER] EXI from 57213 to 52880 (39bytes) = 80 9A 02 1D BB E1 4D BF 0C 32 BF 50 E0 00 00 80 00 01 82 84 70 18 28 18 00 84 04 0A 0A 00 80 50 30 01 03 03 80 C8 00
[84441ms] [CONNMGR] 9 0 0 0 0 0 219 --> 100
[85565ms] [CONNMGR] 9 0 0 0 0 0 186 --> 100
[86297ms] [PEV] from 14:WaitForCurrentDemandResponse entering 99:SequenceTimeout
[86353ms] [PEV] Safe-shutdown-sequence: setting state B
[86353ms] [HARDWAREINTERFACE] Setting CP line into state B.
[86353ms] [PEV] from 99:SequenceTimeout entering 111:SafeShutDownWaitForChargerShutdown

It appears that when the issue occurs, the PEV has sent a "CurrentDemandRes" message, but the [SNIFFER] is unable to capture it as it normally would. Are there any known issues that could cause this problem, or is there something incorrect with the code modification?

Plc Stamp Mini 2

Hello
Communication with the vehicle was achieved using the PLC module AR7420. Can I communicate with the vehicle using the PLC stamp mini with the same software? What does it take for me to do it?

PLC MODULE HARDWARE PROBLEM

I am using the tl-pa4010p module as PLC and I could not establish a connection with the vehicle. Can you recommend a plc module that can work with the software?

Viewing Sent and Received Messages Together in Evse Mode

Hello;
When Pyplc operates in evse mode, only the message packets sent by the electric vehicle are seen. What can I do to see both the message packets sent by the vehicle and the message packets sent by the charger when I run Pyplc in EVSE mode?

For example;
"supportedAppProtocolReq",
"supportedAppProtocolRes",

ISO15118 support?

At the moment, pyPLC/OpenV2Gx only support the DIN protocol.

Is it possible to add support for ISO15118, too?

Some discussion on this:
https://openinverter.org/forum/viewtopic.php?p=50180#p50180
https://openinverter.org/forum/viewtopic.php?p=50183#p50183
https://openinverter.org/forum/viewtopic.php?p=54026#p54026
https://openinverter.org/forum/viewtopic.php?p=54047#p54047

Current conclusion: Yes, "some kind of ISO15118" is doable with the current approach, but not the latest versions of the ISO15118. It is not clear, whether the ISO part of OpenV2G already includes all wished features.

If we want to go this way, the following steps are necessary:

  • Copy and adapt the state machines in pyPLC, so that we have state machines for DIN and for ISO.
  • Extend the command line interface of OpenV2Gx to support also the ISO.
    If the latest ISO shall be supported, we would need to search for an actual EXI codec. Maybe looking to everest what they do.

Regarding necessity / motivation: At the moment (2024), the chargers and cars seem to support DIN, and the hope is, that this will be continue for the next years. At least the chargers should support DIN "forever", because there are a lot of cars on the streets which are DIN-only. Maybe new cars omit the DIN and will support ISO only.
Which ISO-only-features would be relevant? Plug-and-charge, yes. This requires also the handling of certificates.

EVSE MODE CANBUS ERROR

Hello, even though I follow the installation steps separately for Raspberry Pi and Windows, I get such an error. How can I solve this error? Thank you.
Ekran Alıntısı

EvseMode: Car closes the connection after AppProtocolResponse

Start of the discussion was here: #6 (comment)

Cross references:
SmartEVSE/SmartEVSE-3#25
SmartEVSE/SmartEVSE-3#25 (comment)

Problem description: After successful SLAC, SDP and protocol handshake, the car closes the TCP connection. This happens stable with the BMW iX3. No problem with Tesla and Hyundai Ioniq.

Root cause: The openV2Gx sets the supportedAppProtocolRes.SchemaID = 1, because we assume, that the car sends a list of supported schemas where the first enty is DIN and has SchemaID 1. The iX3 sends the (one-and-only) DIN schema entry with SchemaID = 0 (which is allowed), and closes the connection after the pyPlc selects the SchemaID 1.

Clean solution would be, that the pyPlc parses the list of announced schemas, selects the entry with DIN, and sends back the SchemaID of that entry back to the car, no matter which value it is.
Potential workaround could be, to send no SchemaID at all. The SchemaID is an optional field, and in best case the vehicle is also happy without it. There is the risk, that some car types will accept this, maybe others not.

Remove old-style ifconfig

In addressManager, we still have a path which uses the deprecated ifconfig command. This path is disabled by cfg_useOldStyleIfconfig = 0, but is confusing.
Todo: Remove this path completely.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.