Author Topic: Android  (Read 68528 times)

ianfallon

Re: Android
« Reply #60 on: September 16, 2015, 12:34:14 pm »
I've had everything running all morning here and eventually I got a message saying SkyDemon (Android) had lost the input (after a couple of hours at least).

Had to restart the Pi. I didn't have it connected to the monitor so can't report any messages from the Pi - sorry.

chrismills

Re: Android
« Reply #61 on: September 16, 2015, 02:01:48 pm »
Thanks for comments everyone. I'm not sure that these problems are entirely due to my Android app. All the PilotAwareAndroid app does is recognise when updated location data is available and send it to the Pi over WiFi. There may be some issues with Android killing processes that are asleep. I don't have a thorough understanding of this at the moment. Moving, rather than being stationary, might yield better results with more frequent position updates preventing the process from sleeping. There is a byte at the end of the P3i sentence which indicates valid gps signal but this is hard coded to true. I assumed that since I'm only sending gps data when the position changes, then it must be valid.
As far as traffic goes, that's all handled by the Rasp Pi.

Chris
« Last Edit: September 17, 2015, 01:05:18 am by chrismills »

rg

Re: Android
« Reply #62 on: September 16, 2015, 02:05:14 pm »
I just went for a drive.  5mins down the road I notice the aircraft was not moving.  My bluetooth GPS was updating and ADS-B traffice was all moving around above.  Restarted PilotAwareAndroid.  That seemed to fix things for about 5minutes then my location stopped updating.  After that I started to get SD messages that GPS location was lost. Clicking Go Flying>Using FLARM fixed it but location was not updating. 

Using Go Flying>Location Service nav functions 100%

I thought it was probably that the app was not staying alive.  I use Bluetooth GPS to make the GNS 2000 work for my location so I know android is not kill off the background processes.

Admin

Re: Android
« Reply #63 on: September 16, 2015, 03:15:07 pm »
One potential issue here.

PilotAware keeps sending the last known location received from the GPS to SkyDemon.
This stops Skdemon from timing out.
Maybe I should send an empty NMEA string If I receive no new GPS updates, I am concerned
this may cause SkyDemon to timeout

ianfallon

Re: Android
« Reply #64 on: September 16, 2015, 03:55:51 pm »
For balance, I have had it all running for hours this afternoon with no sign of anything stopping working at all  :)

rg

Re: Android
« Reply #65 on: September 16, 2015, 05:16:38 pm »
Quote
PilotAware keeps sending the last known location received from the GPS to SkyDemon.
This stops Skdemon from timing out.
Maybe I should send an empty NMEA string If I receive no new GPS updates, I am concerned
this may cause SkyDemon to timeout

Yeah but I think thats alright for maybe 60 seconds or so. There comes a point when we need to be alerted to fact that we don't have good GPS.

Admin

Re: Android
« Reply #66 on: September 16, 2015, 05:30:49 pm »
Quote
PilotAware keeps sending the last known location received from the GPS to SkyDemon.
This stops Skdemon from timing out.
Maybe I should send an empty NMEA string If I receive no new GPS updates, I am concerned
this may cause SkyDemon to timeout

Yeah but I think thats alright for maybe 60 seconds or so. There comes a point when we need to be alerted to fact that we don't have good GPS.

Not quite so simple  :-\
In iOS Location Services, they only supply updates on a 'significant change', so when stationary, you receive no updates, because your location has not changed. iOS Location Services, do have an error condition which is called if the GPS is lost, and I think I use this in the CollisionAware App.

Chris you may need to check if Android has an equivalent error condition, I can then leave you to, constantly provide updates (if the no significant change issue occurs on Android), and stop or provide empty messages on the GPS error condition.

If you use a serial device, when the unit is still alive, but not providing good info you get something like this

$GPGGA,,,,,,,,,,*54

so simply the msg type, and a set of empty fields, followd by a checksum.

rg

Re: Android
« Reply #67 on: September 16, 2015, 08:19:32 pm »
Okay.  I think the problem is probably in the android app.  My location services were good....I could see stats updating in bluetooth gps app and when I stopped navigating and click go flying with location services instead of farm everything was fine. It also seemed to start when I restarted the android pilot aware app.

chrismills

Re: Android
« Reply #68 on: September 17, 2015, 01:17:00 am »
Thanks for letting me know your problems rg.
I do still need to spend some time trying to understand sleep and resume, etc.

I am a little confused by your setup however. In your posts you mention GNS2000, bluetooth apps and using location services for navigation and I'm not clear on how this all fits together.

Please could you describe in a bit more detail exactly how you are set up and which software you're using.

There are a few little catches and tricks in the way  that android location services work, for example, unless set up specifically to use ONLY the GPS data, the LocationManager object will get position data from any available source, this includes using the IP address of any network access and also triangulating from the mobile phone network.

Let me know how you're set up and I'll have a think.

Chris

rg

Re: Android
« Reply #69 on: September 17, 2015, 02:33:43 pm »
Hi Chris.

The GNS 2000 is one of these http://www.transair.co.uk/sp+GNS-2000-Bluetooth-Receiver+GNS2000?utm_campaign=Googlebase&utm_medium=organic&utm_source=Googlebase&gclid=CjwKEAjwyemvBRDFpN3E5_bs9BQSJAA5n8L2H8BjDVI8LfDg2p93iWrcn8LPZHSY9xVRleq4dFprDRoC1Szw_wcB

So it can stick on the windshield and no fear of the cessna wing shielding it.

Android doesn't natively support Bluetooth GPS like iOS so you need an app and mock GPS providers enabled.  The app that recommended is this https://play.google.com/store/apps/details?id=googoo.android.btgps

So it supplies location services. 

Your app is correctly seeing the location. I just think its probably going to sleep when in tha background.

Russ

chrismills

Re: Android
« Reply #70 on: September 18, 2015, 07:39:13 pm »
Thanks Russ. That's way more complicated than my setup and I'm not sure if I'll be able to easily debug.

I'm running PilotAwareAndroid on my phone, sending P3i sentence to PilotAware box which adds on ADSB data and forwards to my Android tablet running SkyDemon.
I've also managed a successful test with running SD on my phone at same time as PilotAwareAndroid.

Adding in BT GPS and mock locations with more GPS software running might be causing problems.

Lee is developing his system to include 'internal' gps (possibly USB) which will probably increase reliability of GPS data, rather than relying on phones which are designed to sleep, pause and generally save battery, rather than provide super reliable position data. I'm not sure how much more mileage there is in the Android app at the moment but I'll keep chipping away for now.

I'll load updates to the Play Store and they should be pushed out as they are available.

Chris

rg

Re: Android
« Reply #71 on: September 18, 2015, 08:12:06 pm »
Yeah I can see the apps are limited. I'm slightly dubious that  a £10 usb  gps stick will be very good.

I'll try tomorrow  just using the inbuilt tablet gps.
« Last Edit: September 18, 2015, 10:09:52 pm by rg »

Andy Fell

Re: Android
« Reply #72 on: September 21, 2015, 08:50:50 pm »
Hi,

I finally had time to try it :-)

Well, it connected once, although the GPS data was a little flaky (but I excused it on the basis I an indoors so the tablet doesn't get strong GPS signals).. then I updated skydemon as I noticed I was on an old version.. after that I couldn't get Skydemon to connect to the pilotaware anymore (the app is running in the background correctly reporting GPS data). 

After much rebooting, I got it to connect again, but although the pilotaware was receiving ADSB sentences, no traffic was reported (although my position was correctly placed on the screen).

Andy
« Last Edit: September 21, 2015, 09:07:43 pm by Wobblewing »

Admin

Re: Android
« Reply #73 on: September 21, 2015, 08:55:29 pm »
Hi,

I finally had time to try it :-)

Well, it connected once, although the GPS data was a little flaky (but I excused it on the basis I an indoors so the tablet doesn't get strong GPS signals).. then I updated skydemon as I noticed I was on an old version.. now I can't get Skydemon to connect to the pilotaware anymore (the app is running in the background correctly reporting GPS data). 

any ideas?

Andy

Whats the error message from SkyDemon ?
is it 'Failed to establish a connection ...' ?

If you have an HDMI monitor attached, do you see any messages ?

Andy Fell

Re: Android
« Reply #74 on: September 21, 2015, 09:08:20 pm »
Hi,

I finally had time to try it :-)

Well, it connected once, although the GPS data was a little flaky (but I excused it on the basis I an indoors so the tablet doesn't get strong GPS signals).. then I updated skydemon as I noticed I was on an old version.. now I can't get Skydemon to connect to the pilotaware anymore (the app is running in the background correctly reporting GPS data). 

any ideas?

Andy

Whats the error message from SkyDemon ?
is it 'Failed to establish a connection ...' ?

If you have an HDMI monitor attached, do you see any messages ?

Much rebooting sorted it.. I modified my reply, see above :-) Can see my position, no traffic shown (but receiving ADSB sentences - reported by the WebUI)
« Last Edit: September 21, 2015, 09:10:01 pm by Wobblewing »