Skip to content

96boards-projects/agl-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AGL demo for 96Boards

This repository consists of AGL demos on Dragonboard410c.

List of demos:

1. HVAC Demo

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:

  1. Controlling Fan Speed
  2. Controlling Left temperature - Controlling Light intensity
  3. Controlling Right temperature - Controlling Light intensity

Table of Contents

1) Hardware

1.1) Hardware Requirements

Note: It is assumed that Sensors Mezzanine is placed on top of Dragonboard410c

2) Software Setup

2.1) Arduino

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.

2.2) Dragonboard410c

Execution environment: Host PC

Software Dependencies:

$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
     build-essential chrpath socat libsdl1.2-dev xterm cpio curl

Downloading AGL Source Code

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:

  1. As of writing latest stable branch of AGL is 4.0.2. Always download the most recent stable release.
  2. Replace AGL_TOP with the top level directory of cloned AGL source.

Building AGL

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.

Flashing AGL onto Dragonboard410c

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.

3) Hardware Setup

Circuit Diagram

  • 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:

  1. If you are using Arduino on Sensors Mezzanine, no need to connect Rx/Tx lines and 5v line from motor driver.
  2. 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.

4) HVAC Demo

Execution environment: Dragonboard410c

Navigate to the HVAC application from the Homescreen.

  1. To control the Fan speed, change the position of the slider at the top.
  2. To control the LED intensities, change the values of L/R temperatures by dragging up the LO box.

2. Demo Application

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.

Table of Contents

1) Hardware

1.1) Hardware Requirements

2) Software Setup

Boot agl-demo-platform on Dragonboard410c as mentioned in HVAC Demo.

2.1) SDK Environment

Set up the SDK environment for building AGL applications by following this guide.

3) Hardware Setup

  • 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

4) Demo Application

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 [email protected];
$ 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: [email protected]

$ afm-util start [email protected]

Now, the application window will get opened and the temperature data will be shown as below:

Demo Application