Skip to content

Latest commit

 

History

History
60 lines (46 loc) · 2.04 KB

README.md

File metadata and controls

60 lines (46 loc) · 2.04 KB

Simple python example

Setup

pip3 install grpcio requests protobuf

Example; from here run

python3 ecu.py --ip <ip_address>

for a more advanced example

python3 ecu_advanced.py --ip <ip_address>

To show available options/usage run script with -h

python3 ecu.py -h

make sure to provide an ip that points to your installation when running the script OR change the ip in the code on this line (keep the port 50051)

this example works on any linux as it uses udp per default. If you like to use can you need a can enabled device. Then enable this line

Setup Windows

Download python 3.x from here

Follow the installer

it's recommended to enable "Add python.exe to Path"

Run shell (terminal or powershell) as administrator, install necessary tools via pip

python -m pip instaLL grpcio-tools
python -m pip install grpcio-tools protobuf

Example; from here run

python3 ecu.py --ip <ip_address>

for a more advanced example

python3 ecu_advanced.py --ip <ip_address>

To show available options/usage run script with -h

python3 ecu.py -h

make sure to provide an ip that points to your installation when running the script OR change the ip in the code on this line (keep the port 50051)

Re-generate stubs

to re-generate files (already generated in the common/generated folder)

python -m grpc_tools.protoc -I../../../proto_files --python_out=./common/generated --grpc_python_out=./common/generated ../../../proto_files/*