This repository consists of AGL demos on Dragonboard410c.
List of demos:
HVAC (Heat Ventilation and Air Control) demo focussed on demostrating the HVAC GUI present in AGL demo platform. This involves controlling the fan speed and temperature.
For demonstration purposes, default HVAC GUI is modified as below:
- Controlling Fan Speed
- Controlling Left temperature - Controlling Light intensity
- Controlling Right temperature - Controlling Light intensity
- Dragonboard410c
- 96Boards Compliant Power Supply
- Linksprite 96Boards Touch Screen
- Sensors Mezzanine
- Audio Mezzanine(Required if using External Arduino)
- Arduino Uno(Optional)
- DC motor with Propellers
- L298 Motor Driver
- 5mm LED's
- 330 ohm resistors
- Connecting wires
Note: It is assumed that Sensors Mezzanine is placed on top of Dragonboard410c
Controlling Fan Speed and LED intensity are handled by the Arduino. Sensors Mezzanine has an ATMega328 microcontroller comaptible with Arduino Uno. You can use that or any external Arduino Uno for PWM control.
In case of using Sensors Mezzanine, the sketch can be uploaded by using Dragonboard410c itself. For more info, see here.
Following are the steps for getting the required arduino sketch:
If using Sensors Mezzanine, please follow the below steps on Dragonboard410c running Debian otherwise use Arduino IDE on the host system for programming.
$ cd ~/Documents
$ git clone https://github.com/96boards-projects/agl-demo.git
$ cd agl-demo/arduino/hvac
Now open the hvac.ino
using Arduino IDE and flash it onto the Sensors
Mezzanine or Arduino Uno.
Execution environment: Host PC
$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat libsdl1.2-dev xterm cpio curl
AGL uses repo tool for maintaining repositories. We need to download the source on the host machine and cross compile it for Dragonboard410c.
$ export AGL_TOP=$HOME/workspace_agl
$ mkdir -p $AGL_TOP
$ mkdir -p ~/bin
$ export PATH=~/bin:$PATH
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Next, download the stable branch of AGL.
$ cd $AGL_TOP
$ repo init -b dab -m dab_4.0.2.xml -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
$ repo sync
Note:
- As of writing latest stable branch of AGL is 4.0.2. Always download the most recent stable release.
- Replace AGL_TOP with the top level directory of cloned AGL source.
Now, build the agl-demo-platform for Dragonboard410c.
$ source meta-agl/scripts/aglsetup.sh -m dragonboard-410c agl-demo agl-appfw-smack agl-devel agl-netboot
Now move to the directory where you have cloned the agl-demo
project from 96Boards Projects Org.
$ cd agl-demo
Copy the custom HVAC recipie to AGL source
$ cp hvac_git.bb $(AGL_TOP)/meta-agl-demo/recipes-demo-hmi/hvac/hvac_git.bb
Execute bitbake
command by moving to the build directory of AGL source.
$ cd $(AGL_TOP)/build
$ bitbake agl-demo-platform
Note: Replace AGL_TOP with the top level directory of cloned AGL source
Build will take quite some time depending upon the host machine configuration.
Once the build has been completed, we have to flash the boot and rootfs images onto Dragonboard410c. Now, boot Dragonboard into fastboot mode by following the instructions here. Then follow the below instructions to flash AGL onto Dragonboard410c.
$ cd $AGL_TOP/build/tmp/deploy/images/dragonboard-410c
$ sudo fastboot flash boot boot-dragonboard-410c.img
$ sudo fastboot flash rootfs agl-demo-platform-dragonboard-410c.ext4
Once flash has been completed. Proceed to the below sections to execute HVAC demo.
- Make sure the Dragonboard410c is powered off
- Connect DC motor and LEDs to Arduino as per above schematic
- Connect LCD to Dragonboard410c via HDMI cable for display and Micro USB cable for touch input
- Power on your 96Boards CE with compatible power supply
- Dragonboard410c should now boot into AGL and homescreen should be visible.
Note:
- If you are using Arduino on Sensors Mezzanine, no need to connect Rx/Tx lines and 5v line from motor driver.
- If you are using external Arduino, place Audio Mezzanine on top of DB410c. Then connect Rx/Tx lines from level shifted LS connector at the centre.
Execution environment: Dragonboard410c
Navigate to the HVAC application from the Homescreen.
- To control the Fan speed, change the position of the slider at the top.
- To control the LED intensities, change the values of L/R temperatures by dragging up
the
LO
box.
A demo Qt application which displays temperature data from TMP007 recursively at 3 seconds interval. This demo can be used as a template for developing applciations using AGL framework.
- Dragonboard410c
- 96Boards Compliant Power Supply
- Linksprite 96Boards Touch Screen
- Sensors Mezzanine
- TMP007 Sensor
Boot agl-demo-platform on Dragonboard410c as mentioned in HVAC Demo.
Set up the SDK environment for building AGL applications by following this guide.
- Make sure the Dragonboard410c is powered off
- Connect Linksprite Touch Screen
- Connect Sensors Mezzanine
- Connect TMP007 senosr to I2C-0 port on Sensors Mezzanine
- Power on your Dragonboard410c with compatible power supply
Execution environment: Host PC
Now, the demo application can be built using the SDK environment inside Docker container on host.
First navigate to the docker-worker-generator
directory then follow the
below steps to login to the SDK Docker container and build the demo application.
$ ./contrib/create_container 0;
Now SSH into the Docker container using the shown command in terminal and build the application.
$ ssh -p 2222 devel@mybuilder.local;
$ source /xdt/sdk/environment-setup-<your_target>
$ git clone https://github.com/96boards-projects/agl-demo
$ cd agl-demo/db410c-temp
$ qmake
$ make
After the successful build, applciation package will be available under package
directory.
Copy it to the Dragonboard410c running AGL using SD card and start the application as below:
Execution environment: Dragonboard410c
Note: Before starting the application,
homescreen
needs to be disabled as mentioned here.
$ cd <package_directory>
$ afm-util install db410c-temp.wgt
Now, you should be able to see the Application ID: db410c-temp@0.1
$ afm-util start db410c-temp@0.1
Now, the application window will get opened and the temperature data will be shown as below: