Author Topic: Enhancement Requests  (Read 106986 times)

Admin

Enhancement Requests
« on: July 29, 2015, 09:15:28 pm »
First Posting
« Last Edit: July 29, 2015, 09:18:07 pm by Admin »

chrismills

Re: Enhancement Requests
« Reply #1 on: August 02, 2015, 11:36:31 pm »
Hi Lee.
House move completed. Ready to have a go at writing Android version of app. Have ordered kit of parts which should all be here this week.  Any documentation or tips on where to start, source code etc that I could get started with?
BW Chris Mills

Shortwing

Re: Enhancement Requests
« Reply #2 on: August 03, 2015, 10:52:29 am »
I may be able to assist with an android app - I have some experience.  If you need any assistance chrismills shout

Admin

Re: Enhancement Requests
« Reply #3 on: August 03, 2015, 01:09:11 pm »
Excellent!

Where to start - I have no idea, I have never done any android development  :o
I do have a wealth of experience on Linux, and of course Android is built on Linux.

Let me give a brief overview.

The CollisionAware App does nothing more than connect to a listening posix socket on PilotAware,
then it streams the Location services information through the socket connection.
in essence - thats it!

So I would start by investigating :-
1. How to access location services on Android
2. Socket Comms on Android

I would hope (2) is Linux/Posix compliant, in which case we can just lift the code straight from the
IOS Application.

We could probably take most of this info offline through direct email, but let me start by saying this is
what the code in the IOS callback thread looks like for grabbing the location data.

Quote
gps.f32lat    = (Float32) (currentLocation.coordinate.latitude);
gps.f32lon    = (Float32) (currentLocation.coordinate.longitude);
gps.i32altmtr = (int32_t) (currentLocation.altitude);
gps.course    = (int32_t) (currentLocation.course);
gps.speedms   = (int32_t) (currentLocation.speed);
           
// convert Metres to feet
gps.i32altft  = gps.i32altmtr * METRES_TO_FEET;
gps.speedkns  = gps.speedms * MS_TO_KNOTS;

Hopefully location services data in Android is all in the same format - but may not be the case.

so as you can see from above I grab the data into a structure, and then this is sent over the posix socket,
in another thread with a specific interval period of 1 second

Quote
        //
        // If we are connected to the port
        //
        sprintf(tbuf, "$P3IGGA,%f,%f,%d,%d,%d,%d,%d,%d,*FF\r\n",
                gps.f32lat, gps.f32lon, gps.i32altft,
                gps.course, gps.speedkns, date, time,
                gps.valid);
        if (sendData(gps.sockfd, tbuf, &gps.commsok) <= 0) {
            NSLog(@"sendData Failed self=%@", self);
        }

This is then received by PilotAware and used accordingly.

Is this enough bootstrap info ?
As I mentioned 2 things to investigate, accessing location services, setting up posix thread connections.

Thx
Lee

grvbc

Re: Enhancement Requests
« Reply #4 on: August 03, 2015, 01:36:21 pm »
Really pleased that you guys are on the Android app version - it'll open it up to many more and thereby encourage adoption.

On that note - can PilotAware pick up location info from the RS232 with NMEA already?  I.e. for those of use that want to use the aircraft's already installed GPS.  I guess the question is more a case of - do we have to have a phone/pad for other functionality (such as licencing)?

In my personal case I'd love to use the installed 496 to send NMEA location to PilotAware, and be able to display the traffic alerts graphically on the traffic-capable GPS, rather than need to have a phone/pad in the cockpit too.

All the kit ordered now and on the way.

Thanks

Admin

Re: Enhancement Requests
« Reply #5 on: August 03, 2015, 02:05:28 pm »
Quote
can PilotAware pick up location info from the RS232 with NMEA already?  I.e. for those of use that want to use the aircraft's already installed GPS.  I guess the question is more a case of - do we have to have a phone/pad for other functionality (such as licencing)?
The RPi has only one serial port, and this is occupied by the ARF, however all is not lost.
I have already tested a USB-RS232 interface and had success.
The question is, does the installed GPS generate classic RS232 (ie +/-15v) or RS232-TTL, there is a difference, but both can be handled.

Quote
In my personal case I'd love to use the installed 496 to send NMEA location to PilotAware, and be able to display the traffic alerts graphically on the traffic-capable GPS, rather than need to have a phone/pad in the cockpit too.
This is probably a little more complicated, and I would not have a clue where to begin.
I presume the 496 takes RS232 input as well, so its a case of data formatting.

I have to be honest, seems like a long way off before getting around to that

Andy Fell

Re: Enhancement Requests
« Reply #6 on: August 03, 2015, 10:50:55 pm »
I'm already using a Garmin96C for NMEA data out (RS232 +/-12V format) for the ADS-B ES trial..

A USB<>RS232 adapter thingy could also be wired to this 96C data out to receive NMEA input to the RPi (same data as being sent to my transponder).  http://uk.farnell.com/ftdi/chipi-x10/cable-usb-db9-male-rs232-10cm/dp/2352019

Should be a driver already available for virtual comm port?  then use this stream to send to tablet via flarm intfc?

Cheers
Andy
« Last Edit: August 03, 2015, 10:55:01 pm by Wobblewing »

Vince

Re: Enhancement Requests
« Reply #7 on: August 03, 2015, 11:13:11 pm »

Quote
In my personal case I'd love to use the installed 496 to send NMEA location to PilotAware, and be able to display the traffic alerts graphically on the traffic-capable GPS, rather than need to have a phone/pad in the cockpit too.
This is probably a little more complicated, and I would not have a clue where to begin.
I presume the 496 takes RS232 input as well, so its a case of data formatting.

I have to be honest, seems like a long way off before getting around to that

This should not be a great hurdle as to feed the Garmin with traffic data just requires passing it in the TIS format. I will dig out the spec and post it here.
Sign up to Stranded Flyer to assist your fellow aviators in those difficult situations.

www.strandedflyer.net

chrismills

Re: Enhancement Requests
« Reply #8 on: August 04, 2015, 12:25:40 am »
Thanks Lee. I'll do some homework. Might be bit of a slow start. BT are going to take 10 days to switch my broadband on!
Chris

Admin

Re: Enhancement Requests
« Reply #9 on: August 04, 2015, 01:19:31 pm »
Thanks Lee. I'll do some homework. Might be bit of a slow start. BT are going to take 10 days to switch my broadband on!
Chris

Hi Chris,

Had a quick googla around, and I think these are a good starting point

1. Install the Android SDK
https://developer.android.com/sdk/index.html

2. Build your first App
https://developer.android.com/training/basics/firstapp/index.html

3. (the meat) Location Services
http://www.vogella.com/tutorials/AndroidLocationAPI/article.html

Thx
Lee

Admin

Re: Enhancement Requests
« Reply #10 on: August 04, 2015, 01:26:07 pm »
I'm already using a Garmin96C for NMEA data out (RS232 +/-12V format) for the ADS-B ES trial..

A USB<>RS232 adapter thingy could also be wired to this 96C data out to receive NMEA input to the RPi (same data as being sent to my transponder).  http://uk.farnell.com/ftdi/chipi-x10/cable-usb-db9-male-rs232-10cm/dp/2352019

Should be a driver already available for virtual comm port?  then use this stream to send to tablet via flarm intfc?

Cheers
Andy

Hi Andy
Yes already tested a similar device and I got it to work.
I was only really considering NMEA-out (to go to an ADS-B transponder) rather than NMEA-in for the GPS info.

This is going to require a configuration interface.
My initial thoughts were to build this into the IOS/Android Apps.
I am now thinking it is much better to use a web interface (as I am now doing for license key entry)
This makes it independant of IOS & Android, such that the IOS/Android apps now become nothing more than
another GPS source.

In the long run that makes everything cleaner I think, and also solves the requirements of people wanting
to use those Kobo Minis for XCsoar

Thx
Lee

Vince

Re: Enhancement Requests
« Reply #11 on: August 04, 2015, 08:46:30 pm »
I would recommend leaving options open so the configuration can be done via web interface, iOS app or droid app. Start with the website interface but build into it the ability for the apps to read and set the configuration.

Vince
Sign up to Stranded Flyer to assist your fellow aviators in those difficult situations.

www.strandedflyer.net

chrismills

Re: Enhancement Requests
« Reply #12 on: August 05, 2015, 05:45:57 pm »
Thanks for the pointers to get me started Lee.

On a slightly different note, I can't help wondering if including an off the shelf GPS module in the unit might be a good option. They are pretty cheap and the ones I've used in other projects in the past simple output standard NMEA sentences over a serial connection. I've parsed the sentences with an arduino nano to get the data I needed so I guess it sould be easy with a Pi.

Chris

Andy Fell

Re: Enhancement Requests
« Reply #13 on: August 13, 2015, 10:07:26 am »
Agree on the web interface for configuration, makes things much cleaner.

Cheers
Andy

chrismills

Re: Enhancement Requests
« Reply #14 on: August 15, 2015, 09:27:53 pm »
Hi Lee,
All parts arrived now and thinking about getting soldering iron out.
Any reason not to use 3.3V supply from Pi on GPIO pin 1, instead of using voltage regulator?

ChrisMills