From 4372155a74e6be4aee4a9b4f2987c51c6d98c450 Mon Sep 17 00:00:00 2001 From: uhi22 Date: Mon, 27 Feb 2023 13:11:16 +0100 Subject: [PATCH] docu: headless Pi as PEV with OLED --- doc/installation_on_raspberry.md | 49 ++++++++++++++++++++++++++++++++ doc/todo.md | 1 + readme.md | 4 +++ 3 files changed, 54 insertions(+) diff --git a/doc/installation_on_raspberry.md b/doc/installation_on_raspberry.md index 42a7f4f..5da143f 100644 --- a/doc/installation_on_raspberry.md +++ b/doc/installation_on_raspberry.md @@ -82,6 +82,55 @@ Open a second console window, and start here the pev in simulation mode `sudo python pyPlc.py P S`. We should see how the EVSE and PEV are talking to each other. +## Auto-start of the PEV software + +Use case: You use a RaspberryPi in the car, and want to start the charging software just by powering-up the Raspberry. + +(Based on https://gist.github.com/emxsys/a507f3cad928e66f6410e7ac28e2990f) + +We want to run the pevNoGui.py as superuser automatically after startup. To achieve this, we create a service, which we give the name "pev". + +``` + cd /lib/systemd/system/ + sudo nano pev.service +``` + +In this file, we write the following, to configure the new service: + +``` + [Unit] + Description=The PEV. + After=multi-user.target + + [Service] + Type=simple + ExecStart=/home/pi/myprogs/myPlc/starter.sh + Restart=on-abort + + [Install] + WantedBy=multi-user.target +``` + +Finally we configure the attributes of the service, change the starter shell file to be executable, reload the service configuration and enable and start +the service: + +``` + sudo chmod 644 /lib/systemd/system/hello.service + chmod +x /home/pi/pyPlc/starter.sh + sudo systemctl daemon-reload + sudo systemctl enable pev.service + sudo systemctl start pev.service +``` + +To view the log of the service, run `journalctl --unit=pev` or `journalctl -f -u pev.service`. + +Todo: The service log will grow very large, because it contains the complete communication during the charging session. Do we need to take care to +keep the log slim? + +The next time we power-up the pi, even without a HDMI display and keyboard connected, the OLED should show the charge progress now. +Using an RaspberryPi 3 without additional startup time optimization, the time from power-on until the start of SLAC is ~21 seconds. + + ## Nice-to-have: Password-less SSH connection from the Windows notebook to the Pi https://strobelstefan.org/2019/10/16/zugriff-via-ssh-ohne-passworteingabe-anmeldung-erfolgt-durch-ausgetauschten-ssh-schluessel/ diff --git a/doc/todo.md b/doc/todo.md index 4404102..823ff77 100644 --- a/doc/todo.md +++ b/doc/todo.md @@ -22,6 +22,7 @@ - [ ] docu: add hardwareInterface into software architecture puml - [ ] docu: create hardware architecture picture - [x] docu for Dieter (Schematic, concept idea, DieterLV, DieterHV, ...) +- [x] add OLED display to the PEV controller - [ ] in addressManager, replace the print by addToTrace - [ ] Resolve the todo-markers in the code - [ ] Still fixed addresses (MAC, IP) used somewhere? diff --git a/readme.md b/readme.md index 06bb0cd..b7423ba 100644 --- a/readme.md +++ b/readme.md @@ -311,6 +311,10 @@ hardware side. Without the load, we see the intended 230V precharge voltage, and - 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 +### 2023-02-27 PEV mode with OLED-display works on headless Raspberry +- Charging status is shown on OLED display. Details in [hardware.md](doc/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](doc/installation_on_raspberry.md) ### Test results on real-world chargers See [charger_test_results.md](doc/charger_test_results.md)