SkillAgentSearch skills...

PyPLC

Electric vehicle CCS charging investigations with Python

Install / Use

/learn @uhi22/PyPLC
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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

2026-02-21 Discharge-Experiments on BeagleBone with FoccciCape

A lot happened in the meanwhile. The highlights:

  • Added ISO1 (experimental) additional to DIN70121
  • Added MQTT communication
  • BeagleBone with FoccciCape acts as bidirectional charging station. https://openinverter.org/forum/viewtopic.php?t=6745&start=75 e.g. in the Discharge-Demo-Box (DiDeBoCCS) https://github.com/uhi22/DiDeBoCCS
  • Bugfix in OpenV2Gx: Avoid the NotReady during CableCheck

2023-06-29 v0.9 Released

Highlights:

  • pyPLC in EvseMode runs together with the SmartEvse and fetches the SOC from the car before AC charging: https://github.com/SmartEVSE/SmartEVSE-3/issues/25. Thanks to arpiecodes, ArendJanKramer, fluppie and co for the contributions.
  • pyPLC works as CCS-to-CHAdeMO bridge on johu's Touran: https://openinverter.org/forum/viewtopic.php?p=57908#p57908, https://www.youtube.com/watch?v=tfCaqdUFx3Q Congratulations and thanks for the excellent collaboration.
  • celeron55 is on a 5000km road trip with the EVPrevia through Europe and uses pyPLC as the main charging solution. https://openinverter.org/forum/viewtopic.php?p=57940#p57940 and https://www.youtube.com/watch?v=bcMmEXSlFD8 Congratulations and enjoy the trip.

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

  • On 3 of 4 tested charger models, the light-bulb-demo works: AlpitronicHPC, ABB HPC, ABB Triple. The Ionity Tritium overshoots the target voltage due to missing load, and aborts.
  • Welding detection gives negative or no answer.
  • Traces https://github.com/uhi22/pyPLC/blob/master/results/2022-12-21_westpark_alpi_charge_ok_with_bulb.pcapng and https://github.com/uhi22/pyPLC/blob/master/results/2022-12-21_alpi_ABBHPC_ABB_Ionity_lightbulb_3of4ok.decoded.txt
  • Pictures and discussion in https://openinverter.org/forum/viewtopic.php?p=50172#p50172

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 i

Related Skills

View on GitHub
GitHub Stars220
CategoryDevelopment
Updated2d ago
Forks46

Languages

Python

Security Score

100/100

Audited on Mar 31, 2026

No findings