How to check if GPS is available?

Post Reply
p2m
Posts: 5
Joined: Tue Jun 07, 2016 9:21 am
languages_spoken: english
ODROIDs: C1+and C2
Has thanked: 0
Been thanked: 0
Contact:

How to check if GPS is available?

Post by p2m »

I have developed an app for ODROID C2 (Android Marshmallow (v2.6)) and smartphones and I need to check if GPS is available.
I have no GPS for ODROID C2. I tried:
packageManager.hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS)
and:
locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)
both return "true". Is there a way to check if GPS is actually available?
I don't wanna hardcode if(device == "ODROID") ...

User avatar
codewalker
Posts: 1363
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all
Has thanked: 61 times
Been thanked: 96 times
Contact:

Re: How to check if GPS is available?

Post by codewalker »


p2m
Posts: 5
Joined: Tue Jun 07, 2016 9:21 am
languages_spoken: english
ODROIDs: C1+and C2
Has thanked: 0
Been thanked: 0
Contact:

Re: How to check if GPS is available?

Post by p2m »

The link explains how to check the GPS status, if you have GPS. I have no GPS on ODROID and I'm looking for a way to know it.

User avatar
odroid
Site Admin
Posts: 38033
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1999 times
Been thanked: 1206 times
Contact:

Re: How to check if GPS is available?

Post by odroid »

You can check the device node /dev/ttyUSB0 or /dev/ttyACM0.
If it doesn't exist, the USB GPS is not connected.

User avatar
rooted
Posts: 8723
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 743 times
Been thanked: 375 times
Contact:

Re: How to check if GPS is available?

Post by rooted »

GPS is available you just need to attach GPS.

*edit*
I misunderstood, as odroid answered you can check the /dev entries

1milenia
Posts: 60
Joined: Mon Mar 06, 2017 3:05 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: How to check if GPS is available?

Post by 1milenia »

ive had no luck with the usb gps reciever from ameridroid

User avatar
rooted
Posts: 8723
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 743 times
Been thanked: 375 times
Contact:

Re: How to check if GPS is available?

Post by rooted »

1milenia wrote:ive had no luck with the usb gps reciever from ameridroid
I have the odroid sourced USB GPS dongle and it works great, better than I expected actually.

synportack24
Posts: 114
Joined: Sat Jan 10, 2015 10:16 am
languages_spoken: English, German, Korean
ODROIDs: C0, C1, C1+, C2, XU4
Location: 대한민국 - 안양시
Has thanked: 0
Been thanked: 3 times
Contact:

Re: How to check if GPS is available?

Post by synportack24 »

rooted wrote:
1milenia wrote:ive had no luck with the usb gps reciever from ameridroid
I have the odroid sourced USB GPS dongle and it works great, better than I expected actually.
Have a look at the guide https://magazine.odroid.com/wp-content/ ... manual.pdf
along with that, Android contains a file in its root system partition known as "build.prop" check for the following lines that they are correct:

Code: Select all

 ro.kernel.android.gps=/dev/ttyACM0
 ro.kernel.android.gps.speed=9600
I've had good luck with the ODROID GPS, all the drivers needed for it are in the Android image already.

1milenia
Posts: 60
Joined: Mon Mar 06, 2017 3:05 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: How to check if GPS is available?

Post by 1milenia »

tried to install gpsd came up with error on my odroid c2 android lollipop

Image

User avatar
rooted
Posts: 8723
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 743 times
Been thanked: 375 times
Contact:

Re: How to check if GPS is available?

Post by rooted »

1milenia wrote:tried to install gpsd came up with error on my odroid c2 android lollipop

Image
You can't use apt on Android

1milenia
Posts: 60
Joined: Mon Mar 06, 2017 3:05 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: How to check if GPS is available?

Post by 1milenia »

how do yo do it in android

User avatar
rooted
Posts: 8723
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 743 times
Been thanked: 375 times
Contact:

Re: How to check if GPS is available?

Post by rooted »

I don't know what your doing?

1milenia
Posts: 60
Joined: Mon Mar 06, 2017 3:05 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: How to check if GPS is available?

Post by 1milenia »

i tried to follw the instructions in this link

Have a look at the guide https://magazine.odroid.com/wp-content/ ... manual.pdf
along with that, Android contains a file in its root system partition known as "build.prop" check for the following lines that they are correct:

just wish it was plug and play

User avatar
odroid
Site Admin
Posts: 38033
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1999 times
Been thanked: 1206 times
Contact:

Re: How to check if GPS is available?

Post by odroid »

If Ameridroid sells the exactly same model as this link http://www.hardkernel.com/main/products ... 2502154078
it should work out of the box.

1milenia
Posts: 60
Joined: Mon Mar 06, 2017 3:05 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: How to check if GPS is available?

Post by 1milenia »

this is the one i purchased from ameridroid

http://ameridroid.com/products/usb-gps-module



Image

Image

User avatar
odroid
Site Admin
Posts: 38033
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1999 times
Been thanked: 1206 times
Contact:

Re: How to check if GPS is available?

Post by odroid »

It seems to be identical one.
Open terminal app and type lsusb and ls /dev/ttyA*.
Show us the outputs.

1milenia
Posts: 60
Joined: Mon Mar 06, 2017 3:05 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: How to check if GPS is available?

Post by 1milenia »

this is what i get with lsusb

Image

them with dev

Image

User avatar
odroid
Site Admin
Posts: 38033
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1999 times
Been thanked: 1206 times
Contact:

Re: How to check if GPS is available?

Post by odroid »

Identical one.
Try cat /dev/ttyACM0 and it will show you endless NMEA streams.
If it is okay, install GPS test app.
https://play.google.com/store/apps/deta ... ss.gpstest

1milenia
Posts: 60
Joined: Mon Mar 06, 2017 3:05 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: How to check if GPS is available?

Post by 1milenia »

this is what i got

Image

Image

User avatar
odroid
Site Admin
Posts: 38033
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1999 times
Been thanked: 1206 times
Contact:

Re: How to check if GPS is available?

Post by odroid »

The GPS receiver doesn't have good RF sensitivity.
So you have to place the GPS on an open space like loof top or car dash board.
It doesn't detect the satellite signal on window side in a building.

1milenia
Posts: 60
Joined: Mon Mar 06, 2017 3:05 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: How to check if GPS is available?

Post by 1milenia »

i just now put it in the the middle of the dash and it worked ,then i shut the car of tried it again the i had no fix ,
theres no consistancy with it i gave it a few minutes to lock and nothing
can you guys update next version of lollipop with a fix ,most of us use it for car pc,

1milenia
Posts: 60
Joined: Mon Mar 06, 2017 3:05 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: How to check if GPS is available?

Post by 1milenia »

this is a big issue this member has the same issue on the c1

viewtopic.php?f=115&t=18142


and this person

viewtopic.php?f=78&t=9040

User avatar
odroid
Site Admin
Posts: 38033
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1999 times
Been thanked: 1206 times
Contact:

Re: How to check if GPS is available?

Post by odroid »

joerg's patch should be included in C2 marshmallow images.
viewtopic.php?f=137&t=26198&p=185759#p185759

User avatar
joerg
Posts: 1375
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 92 times
Been thanked: 211 times
Contact:

Re: How to check if GPS is available?

Post by joerg »

@odroid
As you see here this whole discussion is dejavu :viewtopic.php?f=137&t=26198
I checked already if is working with my ublox7 based gps mouse. It's working. I think there is no general difference between ublox6, 7 or 8 in NMEA messages.
I already asked the user for logfiles, to have something to investigate, but he isn't able to provide.
I gave the hint to check with u-center if GLONASS is enabled and to disable if yes.
I gave hints how to install adb drivers on Windows.
I gave hint to put a usb memory to the C2 and copy the logfile to there.
As this point, unlucky, I can't help more. Because I don't own an ublox 8 based gps dongle.
May some other forum member here, who does own an Ublox-M8 based GPS module, can help to test?

User avatar
odroid
Site Admin
Posts: 38033
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1999 times
Been thanked: 1206 times
Contact:

Re: How to check if GPS is available?

Post by odroid »

I see. We need to narrow down any possible root causes.
I will double check which chipset is included in our GPS module.
It should be Ublox 6 (6010). But I will contact our GPU module manufacturer on Monday to make sure.

Update: Our GPS module has Ublox7 (7020) chipset.
So it is worth to capture the long GPS outputs log.
But when we tested the GPS with Google maps, it always fixed the GPS within 1~2 minutes on our building loof top.
viewtopic.php?f=137&t=26198&p=185759#p185759

1milenia
Posts: 60
Joined: Mon Mar 06, 2017 3:05 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: How to check if GPS is available?

Post by 1milenia »

we use it on the front middle of car dashes,thanks for trying to find a solution
alot of car audio forums are looking for a fix 2 minutes is a long time to get a fix in a car

User avatar
odroid
Site Admin
Posts: 38033
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1999 times
Been thanked: 1206 times
Contact:

Re: How to check if GPS is available?

Post by odroid »

@1milenia
Can you try to toggle the GLONASS option with u-center program on a Windows PC as "joerg" recommended?

1milenia
Posts: 60
Joined: Mon Mar 06, 2017 3:05 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: How to check if GPS is available?

Post by 1milenia »

you see most of us are not experts with the terminal,we can do basic things we try to learn as much as we can we use google as our friend ,but most of the time we have no idea
for example you ask this ,(Can you try to toggle the GLONASS option with u-center program on a Windows PC as "joerg" recommended?)if you could show us step by step how to do this it would help alot
thats why we go to a forum to learn how to do this stuff,
average people who buy these product have an idea how to work it but when it comes to the technical part we need help


Posts: 22446
Joined: Fri Feb 22, 2013 9:14 am
languages_spoken: English
ODROIDs: ODROID

User avatar
odroid
Site Admin
Posts: 38033
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1999 times
Been thanked: 1206 times
Contact:

Re: How to check if GPS is available?

Post by odroid »

We've shipped over 2,000pcs of GPS receiver and there was no such issue so far.
So your GPS module could be defective or the GLONASS mode was enabled by unknown root cause.
Therefore I recommended "u-center" to check the mode.

Anyway, we've tried to make our official peripherals work out of the box or minimum configuration.
But it is very far from perfection.

We will try the u-center software to enable the GLONASS mode and let you know the result.
If it doesn't help, please contact Ameridroid with a link of this thread to change your GPS receiver.

1milenia
Posts: 60
Joined: Mon Mar 06, 2017 3:05 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: How to check if GPS is available?

Post by 1milenia »

thanks for you efforts ,im sorry for not noing to much im still doing alot of reading on this ,but how do i check u-center

User avatar
odroid
Site Admin
Posts: 38033
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1999 times
Been thanked: 1206 times
Contact:

Re: How to check if GPS is available?

Post by odroid »

We've just tried the u-center but our GPS module doesn't support the GLONASS switching.
So your GPS module seems to be defective.
Please contact Ameridroid with a link of this thread.
They will replace it soon hopefully.
Sorry for the inconvenience caused.

kcroot
Posts: 21
Joined: Fri Mar 17, 2017 2:17 am
languages_spoken: english
ODROIDs: XU4, C2
Location: Myślenice, Poland
Has thanked: 0
Been thanked: 0
Contact:

Re: How to check if GPS is available?

Post by kcroot »

1milenia wrote:tried to install gpsd came up with error on my odroid c2 android lollipop

Image
LOL apt on Android

1milenia
Posts: 60
Joined: Mon Mar 06, 2017 3:05 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: How to check if GPS is available?

Post by 1milenia »

thats what happens when you try to learn lol

User avatar
rooted
Posts: 8723
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 743 times
Been thanked: 375 times
Contact:

Re: How to check if GPS is available?

Post by rooted »

1milenia wrote:thats what happens when you try to learn lol
It's okay, everyone can't know everything ;)

synportack24
Posts: 114
Joined: Sat Jan 10, 2015 10:16 am
languages_spoken: English, German, Korean
ODROIDs: C0, C1, C1+, C2, XU4
Location: 대한민국 - 안양시
Has thanked: 0
Been thanked: 3 times
Contact:

Re: How to check if GPS is available?

Post by synportack24 »

kcroot wrote:
1milenia wrote:tried to install gpsd came up with error on my odroid c2 android lollipop
LOL apt on Android
Everyone has to start somewhere, mocking someone does no good welcoming them to the community.


Most GPS use NMEA (such as the one you have) and will work with ODROID out of the box with no drivers or setting changes. I have my ODROID gps sitting beside my window and I've noticed that it can sometimes take a few minutes to get a fix, most of the time it's just a couple seconds.
Last edited by synportack24 on Sat May 13, 2017 9:55 am, edited 1 time in total.

1milenia
Posts: 60
Joined: Mon Mar 06, 2017 3:05 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: How to check if GPS is available?

Post by 1milenia »

rooted and synportack24 thanks for being supportive ,when people bring you down it just gives a bad rep to this forum

User avatar
codewalker
Posts: 1363
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all
Has thanked: 61 times
Been thanked: 96 times
Contact:

Re: How to check if GPS is available?

Post by codewalker »


Post Reply

Return to “Android”

Who is online

Users browsing this forum: No registered users and 5 guests