This tutorial will show you how to compile QGC for Autoquad on a Raspberry 3.
This will allow you to fully configure your Autoquad Flight controller. With some additional hardware this unit can also be configured as a Ground Control Station (GCS) for FPV, displaying live telemetry and video from the craft.
Min Requirements:
- Raspberry 3
this is preferred since it has integrated Bluetooth and Wifi capability which might come handy in your new GCS
- min. 16GB uSD card, class 10
- keyboard and mouse
- display solution/monitor with HDMI interface
Optional items:
- wireless (preferrably Bluetooth) keyboard/mouse
- custom add-on board for display interface
this is what I'm using here
- USB2.0 Frame Grabber
will be used to capture the live video from the craft. Also requires remaining FPV equipment (camera/video TX/RX, etc)
Hardware used for this tutorial:
- Raspberry 3
- Samsung Evo Class 10 uSD card, 16GB, 8GB card for 'startover image' (see text)
- custom display adapter with and Sharp 10.1in WXGA LQ101K1LY05 module
- Basetech USB 2.0 Video Grabber (https://www.conrad.de/de/basetech-usb-2 ... 68633.html)
Once everything is done you will end-up with something like this:
https://youtu.be/Bn4qsIh4eKI
But: FIRST COMES THE PAIN!
Preparation:
- download the Raspbian Jessie (latest is 2016-03-18 at the time of writing) image from https://www.raspberrypi.org/downloads/raspbian/
- download SD Card Formatter 4.0 from https://www.sdcard.org/downloads/formatter_4/
Use the tool to format your 'uSD card
- download Win32DiskImager from https://sourceforge.net/projects/win32diskimager/
Use Win32Diskimager to install the image file on your uSD card.
Details on this process are available here https://www.raspberrypi.org/documentati ... windows.md
NOTE: There is the risk that you need to start from scratch because something went wrong or you want to try a different approch. That's why I'm using TWO uSD cards, a small 8GB for making a 'start-over' installation - inclusing all the basic bit's and pieces - and a larger one for working/testing.
You can read and write images with Win32Image writer tool; restarting with a fresh image is much faster then doing all from sratch agein!
Format the (startover) uSD card using SD card formatter and install the Raspbian image by using Win32DiskImager.
Insert the (startover) uSD card in your RPi3 and boot the system for the first time.
Now we need to configure some things:
- Code: Select all
sudo raspi-config
Under Boot options select the desired login sheme
Some more settings under Advanced options
You will be prompted to reboot the system
df -h /
Tip: This command will display partition size
Execute below commands one after another. You need to reboot at the end.
- Code: Select all
sudo apt-get update
sudo apt-get upgrade
sudo rpi-update
sudo reboot
Make some additional installations next:
Install a VNC server. Will come handy later.
- Code: Select all
sudo apt-get install tightvncserver
Install the device tree compiler and get the Raspberry device tree sources from git.
Note: Git is part of the Raspbian distribution, so need need to install the packages.
- Code: Select all
sudo apt-get install device-tree-compiler
wget https://raw.githubusercontent.com/raspberrypi/firmware/master/extra/dt-blob.dts
EDIT:Prevent Raspberry from 'screen blackening'
Install 'set' tools
- Code: Select all
sudo apt-get install x11-xserver-utils
Note: You will use 'nano' editor for doing some of the following settings. In 'nano' you will have to push [STRG]+O to write (save) the file and [STRG]+X for closing nano when you're done
Disable screen blanking on console by editing the file '/etc/kbd/config'
- Code: Select all
sudo nano /etc/kbd/config
and change the relevant lines like this
- Code: Select all
BLANK_TIME=0
BLANK_DPMS=off
POWERDOWN_TIME=0
Edit X-power saving settings in the autostart file
- Code: Select all
sudo nano /etc/xdg/lxsession/LXDE/autostart
Search for the 'xscreensaver' settings and commend them out (adding # at the beginning of the line)
- Code: Select all
@lxpanel --profile LXDE
@pcmanfm --desktop --profile LXDE
#@xscreensaver -no-splash
@xset s noblank
@xset s off
@xset -dpms
- Code: Select all
sudo nano /etc/lightdm/lightdm.conf
Update the /etc/lightdm/lightdm.conf file by adding the following command in the [SeatDefaults] section
- Code: Select all
[SeatDefaults]
...
xserver-command=X -s 0 -dpms
...
Install/check gcc, SDL1.2, udev.
- Code: Select all
sudo apt-get install build-essential libsdl1.2-dev libudev-dev
Install bluetooth tools
- Code: Select all
sudo apt-get install bluetooth bluez blueman
Install 'mplayer' audio/movie player
- Code: Select all
sudo apt-get install mplayer2
Install DFU-utils, needed for FW flashing
- Code: Select all
sudo apt-get install dfu-util
Clone the Autoquad Ground Control Repository
As already pointed out, Git is already installed on a Raspberry Pi! To clone (checkout) the QGC repository, run the following commands (in the directory that you want the qgroundcontrol_aq folder to be created):
- Code: Select all
git clone https://github.com/AutoQuad/qgroundcontrol_aq.git
cd qgroundcontrol_aq
git submodule update --init
Install additional libraries for text-to-speech support (festival)
- Code: Select all
sudo apt-get install festival-dev festival
Connect an active speaker/headphone to the 3.5mm jack and test speach output
- Code: Select all
echo "Testing speach synthesis on the F-Pi-V - Ground control Station for Autoquad." | festival --tts
Main task for this tutorial is installing/configuring QT on the Raspberry Pi for building AQ QGC.
EDIT 31/03/2016:
- Added note to 'startover' uSD image
Your (startover) uSD card is finished here. Now it's a good idea to generate an image file from your uSD and store it on your PC.
I'm using a 8GB card for this, so it's easy to transfer the image to a 16GB or larger card. If you want to use a larger card fto proceed with the next steps (QT installation etc) make sure to expand the filsystem again after you've booted the larger card for the first time.
- Added missing pictures on GPU Memory Split and how to disable screensaver
EDIT 05/04/2016:
- Since xscreensaver shows up an annoying massage after each boot I've changed the instructions on how to disable screen blanking