Skip to main content

ANSRTrack Program Development using QT5

 

ANSRTrack Program Development using QT5

This post is about the software development and distribution of my new linux-based High Altitude Balloon Tracker program.

 
ANSRTrack ver 0.1

I’ve been working for a while on rewriting the program we use at Arizona Near Space Research to automatically point antennas at our high alititude balloons in flight.  I wrote a routine for the pic microprocessor line back about 15 years ago, then I dropped out of the club for a while.

 
Pic-Based Tracker

When I returned to the club in 2015 or so, I found that Gary, K7GGG had written a new program with similar functionality to control his rotors during the flight.  I have been using his program since that time.  It’s a great little program written in Microsoft C# using visual studio.

 
K7GGG Program

 

 
K7GGG Balloon Tracking Program

As I participated in the flights, I found that often I had not pointed the antenna array precisely at true north to begin the flight.  That is necessary to get good tracking with the very narrow beamwidth of out 5ghz downlink dish.  Unfortunately, it turns out to be fairly difficult to find true north and point a mechanical array of steel there within a degree or two.

 
Antenna Array

My solution to this is to rewrite the code, implementing a method to fudge the target azimuth and elevation figures by up to 10 degrees in either/both planes.  I did not have access to Gary’s source code, and I had long since lost the original code to my pic microcontroller, so I was pretty much starting from scratch.

I had some experience with C# in my professional life, and found it to be not to my liking, as I do not care for the ever and often changing world of Microsoft Windows based computers.  I want my new application to run on linux, and hopefully the Raspberry PI running it’s version of linux.

I found an alternative development system called Qt (pronounced Cute).  It has a huge open source library supporting all of the graphical widgets I would want.  It’s been quite a learning experience, but I’ve come to like the results.

My new program is in a state where all of the basic functionality is working now.  It’s time to create a real runtime version that can be deployed to other linux machines.  This is a little tricky, in that linux apps use dynamically linked libraries (as do Windows Apps).  Making sure that the program loads the correct libraries, instead of some old or wrong ones already installed on someone’s machine is the challenge.

There are three methods that I have found to do this.

1. Statically link the libraries and create one huge binary file containing all of the libraries it may need.

2. Find the “special” libraries that the program needs, that are not likely to be already installed on most linux computers.  Put these in a directory structure with my main executable file, and set an environment variable to find those libraries, in addition to those already installed.

3. Create a stand-alone “Application” file, that has these special libraries packaged inside, along with my executable.  The user downloads the App, and is able to place it wherever he wants on his computer. He just executes the App, and it runs regardless of where it is physically stored.  These are commonly called AppImages in the linux world.

I did not try option #1, as it sounded a little unwieldy.  I was able to find success with option #2, although it required the user to click on a batch file to launch it, in order to set that variable to look in the right place for the libraries.

Option #3 was a challenge, but I finally found success with it.  I really like this method, as it is a very clean install for the user, and I can distribute the program with a single file.  The user does not have to unpack, unzip, move it to a specific place, or anything other than mark it as executable after he downloads it.  That’s pretty cool.  I understand that is pretty much how Mac programs work, as well.

 
AppImage Directory containing 3 programs

So that’s where I’m at.  I’ve tested this distribution process with a second linux machine (which does not have Qt installed) at my house, as well as with a “live-usb” image of Linux Mint that I have on a USB stick.  I’m going to continue testing it on other live images to see how it works with other versions of linux (debian, ubuntu, centos, etc…).  As long as the target machine has the same architecture as my machine (x86_64), people claim it should work.  We will see.

Comments

Popular posts from this blog

Building the W8NX Short Trap Dipole

Yaesu G-450XL Rotator Repair

Kenwood TS-790A Light Replacement