Please note this is a 100% solo effort (thus far). I just went out and bought an old Samsung Galaxy Tab 10.1 for this task. I wanted to see if I could learn something as I have been intentionally avoiding Android over the years.
I've spent the last few days navigating from the *old* (http://forums.openpi...evelopment old) thread to the *new* thread (http://forums.openpilot.org/topic/18671-android-gcs-development-new/) and about every damn place in between that you could wind up. =] I don't care to admit how much time I have spent staring at git, Fisheye changes, Pull requests, etc.
None the less I have been making some progress. I felt like I was cluttering up the *new* thread so I wasted to start my own. Several of you already know that the Google Play version of OpenPilot legacy Android GCS has a wonderful Nag screen that I have been on a quest to get out of my face.
Here is where I am for now, not bad really for a few days work! I also now understand the innards of WHY certain firmware versions are prevented from connecting.
Just in case anyone was following along I'll start adding notes here and keep them isolated.
To make a long story short, several versions of the available GCS apk files do not include the correct UAVO .jar files.
I have prepackaged some of them here if you need them for your own testing (and do not wish to compile them)
The archive file is located here: http://www.digitalmu...n.com/uavos.jar
$ tar czvf uavos.jar ./OpenPilot/androidgcs/assets/uavos/ a ./OpenPilot/androidgcs/assets/uavos a ./OpenPilot/androidgcs/assets/uavos/0393a8fb439f831f.jar a ./OpenPilot/androidgcs/assets/uavos/29b837c47aba763e.jar a ./OpenPilot/androidgcs/assets/uavos/385035f6cd225ea2.jar a ./OpenPilot/androidgcs/assets/uavos/bd99d74f71222a7d.jar
They are associated with the following UAVO versions:
#UAVO_GIT_VERSIONS := 5e14f53 # 12.10.2 #UAVO_GIT_VERSIONS := 85c222e # 14.01 #UAVO_GIT_VERSIONS := b58620c # ??? (random git pick) UAVO_GIT_VERSIONS := c267d73 # 13.06.04
To generate these files I looked for a few target commits to build after.
For example I looked for rel-13.06.04 that had been "merged into next" by using
git log | more
Author: Alessio Morale <email@example.com>
Date: Sat Aug 17 15:39:52 2013 +0200
Merge remote-tracking branch 'origin/rel-13.06.04'
The above entry coresponds to
I truncated the commit hash down to 7 chars and used it in the make file
UAVO_GIT_VERSIONS := c267d73
you see this when you compile... the number after the "->" becomes the jar file name. This gives you a success indicator
- OpenPilot UAVObject Generator - Done: processed 97 XML files and generated 97 objects with no ID collisions. Total size of the data fields is 3689 bytes. generating java code UAVOTAR c267d73 UAVOUNTAR c267d73 UAVOHASH c267d73 -> 385035f6cd225ea2 UAVOJAVA c267d73 385035f6cd225ea2
I was able to use this build (and associated 385035f6cd225ea2.jar) with a board running RELEASE-13.06.04
The existing (TauLabs) OpenPilot GCS GooglePlay App uses the following jar file.
This corresponds to the version the mention in the description as RELEASE-12.10.2
The version is set in the current Makefile for the most recent source (And is what the GooglePlay app is compiled with)
UAVO_GIT_VERSIONS := 5e14f53
This is based on the following git commit entry
Author: Oleg Semyonov <firstname.lastname@example.org>
Date: Thu Nov 29 17:31:50 2012 +0200
Merge remote-tracking branch 'origin/rel-12.10.2' into next
Again, we simply truncate down to the first 7 characters to get the UAVO hash.
Logically working with the latest release would follow the same guide lines.
UAVO_GIT_VERSIONS := 85c222e
Author: Alessio Morale <email@example.com>
Date: Fri Feb 21 19:16:02 2014 +0100
Merge branch 'rel-14.01' into next
Instead we get a failure...
D/UsbRequestJNI( 1752): init D/TelemetryTask( 1752): Entering UAVTalk processing loop E/HidUAVTalk( 1752): Dropped data. Size:220 data length: 39 D/UAVTalk ( 1752): Canceling transaction: GCSTelemetryStats D/UAVTalk ( 1752): Canceling transaction: GCSTelemetryStats
or if we try to use the PFD
E/AndroidRuntime( 1752): FATAL EXCEPTION: main E/AndroidRuntime( 1752): java.lang.NullPointerException E/AndroidRuntime( 1752): at org.openpilot.androidgcs.fragments.PFD.objectUpdated(PFD.java:75) E/AndroidRuntime( 1752): at org.openpilot.androidgcs.fragments.PFD.onOPConnected(PFD.java:64) E/AndroidRuntime( 1752): at org.openpilot.androidgcs.ObjectManagerActivity$OnConnectionListener.update(ObjectManagerActivity.java:433)
vs. what we see on a successful attempt:
D/TelemetryTask( 1596): Entering UAVTalk processing loop D/OPTelemetryService( 1596): Starting dex loader D/dalvikvm( 1596): DexOpt: --- BEGIN 'bd99d74f71222a7d.jar' (bootstrap=0) --- D/dalvikvm( 1623): DexOpt: load 6ms, verify+opt 0ms, 103636 bytes D/dalvikvm( 1596): DexOpt: --- END 'bd99d74f71222a7d.jar' (success) --- D/dalvikvm( 1596): DEX prep '/data/data/org.openpilot.androidgcs/app_jars/bd99d74f71222a7d.jar': unzip in 3ms, rewrite 134ms
There is also a trick that I learned at https://github.com/T.../pull/942/files to add in a boat load of historic UAVObjects
git log --format=%h -- shared/uavobjectdefinition/ | head -n 6 | tr '\n' ' '
which gives you: UAVO_GIT_VERSIONS := 3cf1662 b846ba3 a0baa17 4a29db4 55fc327 ebe320b
At the very least there have been some major changes that I need to look into. I think some of my problems connecting to 14.x are USB related. For exampled I noted some things in Tau handles their USB data based on a quick diff of UAVTalk.java
diff -y ./src/org/openpilot/uavtalk/UAVTalk.java ../../TauLabs//androidgcs/src/org/taulabs/androidgcs/telemetry/HidUAVTalk.java
There was some recent work centered around http://torvafirmus-a...terface-in.html so I need to wrap my head around what IF anything that means in the context of my connectivity issues to 14.x.
Again if anyone is trying to follow along I have uploaded one of the .apk files from a recent compile here that should work with 13.06.06: http://www.digitalmu...idgcs-debug.apk
The Google API is set to 16 so you will need at least a 4.x device.
$ adb install ./build/androidgcs/bin/androidgcs-debug.apk 1268 KB/s (1197385 bytes in 0.921s) pkg: /data/local/tmp/androidgcs-debug.apk Success
This binary is my attempt to merge the rel-14.01 code, With what is left of the legacy GCS here 11 months ago - http://git.openpilot...b8aff9b5bb0d7f4
$ git checkout origin/rel-14.01 Switched to branch 'origin/rel-14.01'
(do some voodoo)
I have some patches that facilitated some forward movement (for me) which I am sharing at http://www.digitalmu...13.06.04.tar.gz (and attached to the post)
This is literally a hack, I modded some files, checked out the branch and did a cp into the current code:
$ cp -rfv ../OpenPilot/Makefile ../OpenPilot/androidgcs . ; cp -rfv ../OpenPilot/flight/uavobjects flight/; cp -rfv ../OpenPilot/ground/openpilotgcs/src/plugins/uavobjects ground/openpilotgcs/src/plugins/; cp -rfv ../OpenPilot/ground/openpilotgcs/src/libs ground/openpilotgcs/src/; cp ../OpenPilot/make/scripts/version-info.py make/scripts/
More to some soon hopefully! Don't mind my mess... let me know if you have questions or wanna help me out. I am currently combing the "3rd party" issues lists to see how different the Google Play app is since the *current* code is kept under wraps.
This is my current TODO reading list (in no particular order):