Adding file naming and indexing
[AGL/documentation.git] / docs / 01_Getting_Started / 03_Build_and_Boot_guide_Profile / 02_Flutter_Instrument_Cluster_(qemu-x86).md
1 ---
2 title: Flutter Instrument Cluster (qemu-x86)
3 ---
4
5 # Build and Boot AGL Flutter Instrument Cluster demo image made for GSoC
6
7 ## 0. Prepare Your Build Host
8
9 - Install the required tools to build an AGL Image. For detailed explanation, check [Preparing Your Build host](https://docs.automotivelinux.org/en/master/#01_Getting_Started/02_Building_AGL_Image/02_Preparing_Your_Build_Host/)
10
11 ## 1. Define Your Top-Level Directory
12
13 ```bash
14 $ export AGL_TOP=$HOME/AGL
15 $ echo 'export AGL_TOP=$HOME/AGL' >> $HOME/.bashrc
16 $ mkdir -p $AGL_TOP
17 ```
18
19 ## 2. Download the repo Tool and Set Permissions
20
21 ```bash
22 $ mkdir -p $HOME/bin
23 $ export PATH=$HOME/bin:$PATH
24 $ echo 'export PATH=$HOME/bin:$PATH' >> $HOME/.bashrc
25 $ curl https://storage.googleapis.com/git-repo-downloads/repo > $HOME/bin/repo
26 $ chmod a+x $HOME/bin/repo
27 ```
28
29 ## 3. Download the AGL Source Files
30 To download the latest **master** branch  AGL files, use the following commands:
31 ```bash
32 $ cd $AGL_TOP
33 $ mkdir master
34 $ cd master
35 $ repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
36 $ repo sync
37 ```
38
39 ## 4. Initialize the build environment using aglsetup.sh Script
40 To initialize the build environment, we must use the setup script.
41 This script is available here:
42 ```bash
43 $ $AGL_TOP/master/meta-agl/scripts/aglsetup.sh
44 ```
45 Run the script:
46
47 ```bash
48 $ cd $AGL_TOP
49 $ source master/meta-agl/scripts/aglsetup.sh -b build-flutter-cluster -m qemux86-64 agl-demo agl-devel
50 ```
51
52 - Here `-b` is used to specify the build directory and `-m` is used to specify the target platform.
53
54 - Running this script, will create a build directory if it does not exist. Default build directory: `$AGL_TOP/master/build-flutter-cluster`
55 - Default target paltform: `qemux86-64`
56
57 ** NOTE: Set the API key in local.conf **
58
59 - By default navigation will not work, you need to set your openrouteservie API key to the variable `OPENROUTE_API_KEY` in your local.conf
60 - It is present at `$AGL_TOP/master/build-flutter-cluster/conf/local.conf`
61
62 - Example: Just add `OPENROUTE_API_KEY = "your_openrouteservice_api_key"` to the end of local.conf
63
64
65 ## 5. Using BitBake
66
67 ```bash
68 $ cd $AGL_TOP/master/build-flutter-cluster
69 $ source agl-init-build-env
70 $ bitbake agl-cluster-demo-platform-flutter
71 ```
72
73 ## 6. Deploying the AGL Demo Image
74 Boot the image using QEMU
75
76 ```bash
77 $ cd $AGL_TOP/master/build-flutter-cluster
78 $ source agl-init-build-env
79 $ runqemu kvm serialstdio slirp publicvnc
80 ```
81
82 ## 6. Run the Graphics
83 To get graphics of the app, you need VNC client like VNC Viewer or Vinagre
84
85 - Open the VNC client
86 - Enter the server address as `localhost:0`
87
88 That's it, you should get something like this:
89 ![Screenshot](images/flutter_instrument_cluster.png)
90
91 ## 7. To start navigation widget
92 To get the navigation, you need to use `kuksa_viss_client` or `kuksa_vss_init.py` script.
93
94 #### **Using inbuilt `kuksa_vss_init.py` script**
95
96  After running the build, you should get this:
97
98 ```bash
99 Automotive Grade Linux 13.93.0 qemux86-64 ttyS0
100
101 qemux86-64 login:
102
103 ```
104
105 Login as root
106
107 ```bash
108 qemux86-64 login: root
109 ```
110 Now run the script
111
112 ```bash
113 root@qemux86-64:~# /usr/sbin/kuksa_vss_init.py
114 ```
115
116 #### **Using `kuksa_viss_client`**
117
118 Know more about kuksa_viss_client, [Follow this](https://github.com/eclipse/kuksa.val/tree/master/kuksa_viss_client)
119
120 - Run the kuksa_viss_client
121 - Authorize using token
122
123 Then
124
125 ```bash
126 Test Client> setValue Vehicle.Cabin.SteeringWheel.Switches.Info true
127 ```
128 ![Screenshot](images/flutter_instrument_cluster_map.png)