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 » Mon Apr 24, 2017 4:16 pm

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: 920
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all
Has thanked: 32 times
Been thanked: 51 times
Contact:

Re: How to check if GPS is available?

Post by codewalker » Mon Apr 24, 2017 4:45 pm


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 » Mon Apr 24, 2017 5:08 pm

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: 34118
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 667 times
Been thanked: 613 times
Contact:

Re: How to check if GPS is available?

Post by odroid » Mon Apr 24, 2017 6:52 pm

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: 7602
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 659 times
Been thanked: 177 times
Contact:

Re: How to check if GPS is available?

Post by rooted » Tue Apr 25, 2017 6:08 am

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 » Fri Apr 28, 2017 8:24 am

ive had no luck with the usb gps reciever from ameridroid

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

Re: How to check if GPS is available?

Post by rooted » Fri Apr 28, 2017 8:33 am

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.

User avatar
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: 2 times
Contact:

Re: How to check if GPS is available?

Post by synportack24 » Sat Apr 29, 2017 7:43 am

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 » Sun Apr 30, 2017 4:55 am

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

Image

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

Re: How to check if GPS is available?

Post by rooted » Sun Apr 30, 2017 9:34 am

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 » Sun Apr 30, 2017 10:37 am

how do yo do it in android

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

Re: How to check if GPS is available?

Post by rooted » Sun Apr 30, 2017 8:49 pm

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 » Mon May 01, 2017 2:18 am

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: 34118
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 667 times
Been thanked: 613 times
Contact:

Re: How to check if GPS is available?

Post by odroid » Mon May 01, 2017 9:12 am

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 » Mon May 01, 2017 11:24 am

this is the one i purchased from ameridroid

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



Image

Image

User avatar
odroid
Site Admin
Posts: 34118
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 667 times
Been thanked: 613 times
Contact:

Re: How to check if GPS is available?

Post by odroid » Mon May 01, 2017 11:57 am

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 » Tue May 02, 2017 8:01 am

this is what i get with lsusb

Image

them with dev

Image

User avatar
odroid
Site Admin
Posts: 34118
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 667 times
Been thanked: 613 times
Contact:

Re: How to check if GPS is available?

Post by odroid » Tue May 02, 2017 9:26 am

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 » Wed May 03, 2017 6:44 am

this is what i got

Image

Image

User avatar
odroid
Site Admin
Posts: 34118
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 667 times
Been thanked: 613 times
Contact:

Re: How to check if GPS is available?

Post by odroid » Wed May 03, 2017 8:26 pm

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 » Thu May 04, 2017 8:31 am

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 » Thu May 04, 2017 11:19 am

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: 34118
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 667 times
Been thanked: 613 times
Contact:

Re: How to check if GPS is available?

Post by odroid » Thu May 04, 2017 7:46 pm

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

User avatar
joerg
Posts: 1041
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: 33 times
Been thanked: 72 times
Contact:

Re: How to check if GPS is available?

Post by joerg » Thu May 04, 2017 8:07 pm

@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: 34118
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 667 times
Been thanked: 613 times
Contact:

Re: How to check if GPS is available?

Post by odroid » Thu May 04, 2017 8:29 pm

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 » Sat May 06, 2017 8:38 am

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: 34118
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 667 times
Been thanked: 613 times
Contact:

Re: How to check if GPS is available?

Post by odroid » Sat May 06, 2017 10:15 am

@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 » Sun May 07, 2017 2:27 am

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: 34118
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 667 times
Been thanked: 613 times
Contact:

Re: How to check if GPS is available?

Post by odroid » Mon May 08, 2017 2:47 pm

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 » Tue May 09, 2017 10:08 am

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: 34118
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 667 times
Been thanked: 613 times
Contact:

Re: How to check if GPS is available?

Post by odroid » Tue May 09, 2017 12:49 pm

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 » Wed May 10, 2017 3:15 pm

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 » Thu May 11, 2017 9:29 am

thats what happens when you try to learn lol

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

Re: How to check if GPS is available?

Post by rooted » Thu May 11, 2017 2:42 pm

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

User avatar
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: 2 times
Contact:

Re: How to check if GPS is available?

Post by synportack24 » Fri May 12, 2017 8:54 am

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 » Sat May 13, 2017 6:24 am

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: 920
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all
Has thanked: 32 times
Been thanked: 51 times
Contact:

Re: How to check if GPS is available?

Post by codewalker » Wed Aug 21, 2019 12:24 pm


Post Reply

Return to “Android”

Who is online

Users browsing this forum: No registered users and 2 guests