Skip to content

Latest commit

 

History

History
60 lines (40 loc) · 1.75 KB

README.md

File metadata and controls

60 lines (40 loc) · 1.75 KB

Simple python example

Quick start

If you have python3 installed jump ahead to this guide.

Setup

pip3 install --upgrade pip
pip3 install grpcio requests protobuf

Example; from here run:

python3 ecu.py --url <address>

To show available options/usage run script with -h.

python3 ecu.py -h

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:

python3 -m pip install grpcio-tools
python3 -m pip install grpcio-tools protobuf

Example; from here run:

python3 ecu.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/*