Starting User Application

This section details the two methods used to start the user application, i.e., manually and automatically.

Starting User Application Manually

The user application can be started manually. This can be done on the primary and secondary screens.

Primary Screen

To start the user application manually for the primary screen, follow the steps below:

  1. Transfer the your-app executable to the /opt/bin location on the Display, using the USB.
$ mount -o remount,rw /
$ cp /run/media/sda1/your-app /opt/bin
$ sync
$ mount -o remount,ro /
  1. Add the permission to execute the application with the following commands:
$ cd /opt/bin
$ chmod +x your-app
$ ./your-app

Secondary Screen

To start the user application manually for the secondary screen, follow the steps below:

$QT_QPA_EGLFS_FB=/dev/<screen> QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/<touch>:rotate=<touch_rotation>
//Example:
QT_QPA_EGLFS_FB=/dev/fb2 QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/touchscreen1:rotate=180

Technical Fields and Functions Information The following table lists the variables and their description used in the code above:

Field/Function Description
Select fb0 for Main Screen
Select fb2 for Secondary Screen
Select touchscreen0 for Main Screen touch
Select touchscreen1 for Secondary Screen touch
<touch_rotation> Select 0,90, or 180 as per the screen

Starting User Application Automatically

Choosing a startup mode is essential to starting the user application automatically. It is crucial to choose only one startup mode at a time; if both are enabled, the race condition can occur and the system can behave unexpectedly.

Normal Startup Mode

In Normal Startup mode, the user application starts when most of the elements are initialized. Because of this, the system boots a bit slowly.

To start the application in the Normal Startup mode, follow the steps below:

  1. Transfer the your-app executable to the /opt/bin location on the Display, using the USB.
$ mount -o remount,rw /
$ cp /run/media/sda1/your-app /opt/bin
  1. Create a link file of the user application.
$ cd /opt/bin
$ ln -sf your-app normal.app.<screen> //Select <screen> as 0 for Main Screen and 1 for secondary screen
  1. Enable the systemd service.
$ systemctl enable startup-app@<screen>
$ sync
$ mount -o remount,ro /

The application starts in Normal Startup mode.

Early Startup Mode

The Early Startup mode is an optional startup method that speeds up the user application's start time. When selected, your app starts in less than ten seconds. It is important to note that some interfaces and modules may not be available in this mode. It is the developer's responsibility to make sure that certain functionalities are available at the early start of the boot process.

Warning
In Early Startup mode, some components are not initialized within this time such as CAN bus, GPS, and more.

To enable the Early Startup mode, follow the steps below:

  1. Transfer the your-app executable to the /opt/bin location on the Display, using the USB.
$ mount -o remount,rw /
$ cp /run/media/sda1/your-app /opt/bin
  1. Create a link file for the user application.
$ cd /opt/bin
$ ln -sf your-app early.app.<screen> //Select <screen> as 0 for Main Screen and 1 for secondary screen
$ sync
$ mount -o remount,ro /

The application starts in Early Startup mode.

Important
Display reboot is required for the automatic startup. To enable the automatic app startup, it is important to have soft link of the application in the location: /opt/bin with the name early.app or normal.app