diff --git a/pyPlcHomeplug.py b/pyPlcHomeplug.py index 56f6d20..19e3e81 100644 --- a/pyPlcHomeplug.py +++ b/pyPlcHomeplug.py @@ -908,7 +908,9 @@ class pyPlcHomeplug(): if ((not self.isEvseModemFound()) and (not self.isSimulationMode)): self.nEvseModemMissingCounter+=1 self.addToTrace("[PEVSLAC] No EVSE seen (yet). Still waiting for it.") - if (self.nEvseModemMissingCounter>5): + # At the Alpitronic we measured, that it takes 7s between the SlacMatchResponse and + # the chargers modem reacts to GetKeyRequest. So we should wait here at least 10s. + if (self.nEvseModemMissingCounter>10): if (self.isSimulationMode): self.addToTrace("[PEVSLAC] No EVSE modem. But this is fine, we are in SimulationMode.") else: diff --git a/pyPlcIpv6.py b/pyPlcIpv6.py index 4e17df1..3199074 100644 --- a/pyPlcIpv6.py +++ b/pyPlcIpv6.py @@ -249,6 +249,8 @@ class ipv6handler(): self.IpRequest[5] = plen & 0xFF self.IpRequest[6] = 0x11 # next level protocol, 0x11 = UDP in this case self.IpRequest[7] = 0x0A # hop limit + # We are the PEV. So the EvccIp is our own link-local IP address. + self.EvccIp = self.addressManager.getLinkLocalIpv6Address("bytearray") for i in range(0, 16): self.IpRequest[8+i] = self.EvccIp[i] # source IP address for i in range(0, 16): @@ -351,6 +353,7 @@ class ipv6handler(): # self.SeccIp = [ 0xfe, 0x80, 0, 0, 0, 0, 0, 0, 0xe0, 0xad, 0x99, 0xac, 0x52, 0xeb, 0x85, 0xd3 ] # 16 bytes, a default IPv6 address for the vehicle # todo: On EVSE side, extract the vehicles IP address from the SDP communication + # Just a default, will be overwritten later: self.EvccIp = [ 0xfe, 0x80, 0, 0, 0, 0, 0, 0, 0x06, 0x65, 0x65, 0xff, 0xfe, 0, 0x64, 0xC3 ] #self.ownMac = [ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 ] # 6 bytes own MAC default. Should be overwritten before use. self.ownMac = self.addressManager.getLocalMacAddress() diff --git a/pyPlcTcpSocket.py b/pyPlcTcpSocket.py index 17e0e57..d9dddaf 100644 --- a/pyPlcTcpSocket.py +++ b/pyPlcTcpSocket.py @@ -63,7 +63,7 @@ class pyPlcTcpClientSocket(): self.sock.setblocking(0) # make this socket non-blocking, so that the recv function will immediately return self.isConnected = True except socket.error as e: - self.addToTrace("connection failed", e) + self.addToTrace("connection failed" + str(e)) self.isConnected = False def transmit(self, msg): diff --git a/pyPlcWorker.py b/pyPlcWorker.py index 4913e19..e65b14e 100644 --- a/pyPlcWorker.py +++ b/pyPlcWorker.py @@ -9,6 +9,7 @@ import fsmEvse import fsmPev from pyPlcModes import * import addressManager +import time class pyPlcWorker(): @@ -43,6 +44,9 @@ class pyPlcWorker(): def callbackReadyForTcp(self, status): if (status==1): self.workerAddToTrace("[PLCWORKER] Network is established, ready for TCP.") + self.workerAddToTrace("[PLCWORKER] Waiting....") + time.sleep(5) + self.workerAddToTrace("[PLCWORKER] now...") if (self.oldAvlnStatus==0): self.oldAvlnStatus = 1 if (self.mode == C_PEV_MODE): diff --git a/readme.md b/readme.md index eb7384f..d6f99b4 100644 --- a/readme.md +++ b/readme.md @@ -282,6 +282,15 @@ version request broadcast message, to find out, whether we have at least two hom 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-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. + ## 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. @@ -294,12 +303,10 @@ functions Monitor() and Sniffer(), but these are included from a path ../nda/ wh Any idea how to enable full-transparency of the AR7420? -- [all modes] replace the fix-configured addresses (MAC, IP) in the python script by the real one from the operating system - ## Other open topics - [*EvseMode*] [*PevMode*] Fill V2G messages as far as needed, to convince the car to accept it. -- [*PevMode*] Implement SDP to get the chargers IPv6 address -- [*PevMode*] Testing on real charger +- [*PevMode*] Find out TCP connection issue on Alpitronics +- [*PevMode*] Implement TCP connection retry - improve docu (update layer diagram, improve hardware docu, add link to evse which provides the 5% PWM) - Resolve the todo-markers in the code - (and much more) diff --git a/results/2022-11-25_v0.2_ABB_until_ChargeParamDiscovery.pcapng b/results/2022-11-25_v0.2_ABB_until_ChargeParamDiscovery.pcapng new file mode 100644 index 0000000..261f362 Binary files /dev/null and b/results/2022-11-25_v0.2_ABB_until_ChargeParamDiscovery.pcapng differ diff --git a/results/2022-11-25_v0.2_alpi_SDP_ok_TCP_fail.pcapng b/results/2022-11-25_v0.2_alpi_SDP_ok_TCP_fail.pcapng new file mode 100644 index 0000000..ecc8ba8 Binary files /dev/null and b/results/2022-11-25_v0.2_alpi_SDP_ok_TCP_fail.pcapng differ