2 title: AGL Demo Control Panel
4 # AGL Demo Control Panel
8 This document describes the design and usage of the **AGL Demo Control Panel**, a **Qt5-based** tool that allows you to control and interact with various **Automotive Grade Linux (AGL)** demo applications. The tool uses **Kuksa.val** and **CAN frame messages** to communicate with the target machine that runs the AGL image(s). You can use the tool to perform tasks such as starting and stopping scripts, changing the vehicle speed and engine RPM, adjusting the HVAC settings, and providing Steering Inputs. The tool is designed to **demonstrate** the capabilities and features of AGL in a **user-friendly** and **interactive** way.
9 ### Application Overview
11 To use the control panel, you need to connect the main machine that runs the control panel to the target machine that runs the AGL image(s) using a **LAN/ethernet cable**. You also need to configure the IP address of the Kuksa server and set your preferences in the tool’s settings menu.
13 ![Layers_And_Extensions](images/AGL-Demo-Control-Panel/Application-Logic.png)
19 If errors occur in Debian based/Rasbian OS during installation, follow the steps mentioned below and skip to step 2:
21 $ nano requirements.txt
22 # -> Comment pyqt5 dependency using "#"
23 $ sudo apt install python3-pyqt5 python3-qtpy pyqt5-dev-tools python3-pyqt5.qtsvg -y
28 $ python3 -m venv control-panel
29 $ source control-panel/bin/activate
34 $ pip3 install -r requirements.txt
35 $ pyrcc5 assets/res.qrc -o res_rc.py
39 Before using the `AGL Demo Control Panel`, we need to make sure to run the Kuksa.val server and also have our `can0` interface set up (Optional).
41 ### 1. Connect the Machines
43 First, we need to connect the machines, i.e. the host machine (Running the control panel) and the target machine (running the AGL image) via LAN or a bridged network (QEMU or VM)
44 ### 2. CAN interface (WIP)
46 To set up the CAN interface between the Host system and the target machine(s) we use [cannelloni](https://github.com/mguentner/cannelloni),
48 1. Create the virtual CAN interface with the command:
51 $ sudo ip link add dev can0 type vcan
54 2. On both machines, bring the virtual CAN interface online with the command:
57 $ sudo ip link set up can0
60 3. Install cannelloni from its [GitHub repository](https://github.com/mguentner/cannelloni) and run cannelloni with the following commands.
62 _Note_: `cannelloni` is available in AGL, just add `IMAGE_INSTALL:append = " cannelloni"` to your `conf/local.conf`
64 Host Machine (Running `AGL Demo Control Panel`)
66 cannelloni -I can0 -R <target-ip> -r 20000 -l 20000
68 Target Machine (Running AGL image)
70 cannelloni -I can0 -R <host-ip> -r 20000 -l 20000 -p
73 You should now be able to send and receive CAN messages between the two machines using the vcan interface and cannelloni.
75 ### 3. Configuration for Kuksa-val-server/ Kuksa databroker
77 Run the `kuksa-val-server`/`databroker` on `0.0.0.0` by either restarting the server, editing `/etc/default/kuksa-databroker` or add the `agl-demo-preload` as a feature to your build of AGL. The server should be started using the `--address 0.0.0.0` argument.
79 Now, you can create a custom configuration to save your specific preferences for the settings page by creating the `*.ini*` files in the,
80 - `/etc/agl-demo-control-panel.ini`
81 - `$HOME/.local/share/agl-demo-control-panel/config.ini`
85 preferred-config=AGL-kuksa-val-server
87 # [cutom-config-template]
90 # protocol=<ws|grpc> # ws/grpc -> kuksa-val-server, grpc -> databroker
91 # insecure=<true|false>
92 # cacert=<default|/path/to/CA.pem>
93 # token=<default|/path/to/token>
94 # tls_server_name=<name>
105 ### 4. Start AGL Demo Control Panel
107 1. To start the control panel
109 $ cd /Path/to/agl-demo-control-panel
110 $ source control-panel/bin/activate
114 ![Layers_And_Extensions](images/AGL-Demo-Control-Panel/Dashboard.png)
117 - Start (load default config from drop-down menu)
118 - Configure: make changes as required
121 - Secure Mode: if toggled **"on"**, specify the `CA.pem File`
122 - Protocol: websocket ← ? → gRPC
124 - JWT/Auth Token path
125 - CA.pem certificate path
128 - Page settings: Configure the visibility of pages and switch between CAN and Kuksa messages by using the toggle for the same.
130 ![Layers_And_Extensions](images/AGL-Demo-Control-Panel/Settings_Page.png)
132 1. Navigate to the desired page using the provided buttons at the bottom
136 | ![Layers_And_Extensions](images/AGL-Demo-Control-Panel/IC.png) |
140 | ![Layers_And_Extensions](images/AGL-Demo-Control-Panel/HVAC.png) | ![Layers_And_Extensions](images/AGL-Demo-Control-Panel/SC.png) |