mirror of
https://github.com/uhi22/pyPLC.git
synced 2024-11-20 01:13:58 +00:00
docu: sudo-less run on Raspberry
This commit is contained in:
parent
5e63e82ee7
commit
719ed51d20
1 changed files with 15 additions and 0 deletions
|
@ -98,6 +98,16 @@ Open a second console window, and start here the pev in simulation mode
|
||||||
`sudo python pyPlc.py P S`.
|
`sudo python pyPlc.py P S`.
|
||||||
We should see how the EVSE and PEV are talking to each other.
|
We should see how the EVSE and PEV are talking to each other.
|
||||||
|
|
||||||
|
## Sudo-less run of pyPLC
|
||||||
|
|
||||||
|
The access to the ethernet raw data requires sudo. To avoid this, the following setting may help:
|
||||||
|
- Find out the path of python: `which python`. This gives something like /usr/bin/python
|
||||||
|
- Find out the "real" name of the python. The above /usr/bin/python may be a link, but we need the location where it points to.
|
||||||
|
`ls -al /usr/bin | grep python`. This shows e.g. that python is a link to python3, and python3 is a link to python3.9, and this is the real file.
|
||||||
|
- Give python the permission to access the raw ethernet traffic, e.g. `sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/python3.9`
|
||||||
|
(discussed in https://github.com/SmartEVSE/SmartEVSE-3/issues/25#issuecomment-1563519025)
|
||||||
|
- When this was done, the `python pyPlc.py E` etc work without `sudo`.
|
||||||
|
|
||||||
## Auto-start of the PEV software
|
## 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.
|
Use case: You use a RaspberryPi in the car, and want to start the charging software just by powering-up the Raspberry.
|
||||||
|
@ -138,6 +148,11 @@ the service:
|
||||||
sudo systemctl start pev.service
|
sudo systemctl start pev.service
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To stop the service:
|
||||||
|
```
|
||||||
|
sudo systemctl stop pev.service
|
||||||
|
```
|
||||||
|
|
||||||
To view the log of the service, run
|
To view the log of the service, run
|
||||||
- `journalctl --unit=pev` or
|
- `journalctl --unit=pev` or
|
||||||
- `journalctl -f -u pev.service`
|
- `journalctl -f -u pev.service`
|
||||||
|
|
Loading…
Reference in a new issue