yashsingh1/xdaforums huggingface dataset:
[G Tablet General] twistedrotors:
Excellent idea. Let me know how I can help.

I've been looking through the datasheets and have come up with some more parts. Obviously the capacitors aren't required, but they are supposed to be there. This is what I have so far (I promise I'm not trying to one up you Fosser :D):

U28	GPS Module	- RXM-GPS-SG-B-ND

U29	5vdc VCC Reg	- NCP551SN33T1GOSCT-ND

C348	- U29 In to GND (0.1 uf 0402)	- 445-3445-1-ND

C349	- U29 Out to GND (1.0 uf 0402)	- 445-4978-1-ND

U22	3.3vdc Bkpbatt Reg	- MCP1700T1802ETTCT-ND

C347	- U22 Out to GND (1.0 uf 0402)	- 445-4978-1-ND

C355	- U22 In to GND (1.0 uf 0402)	- 445-4978-1-ND

L11	Ferrite Bead	- 240-2391-1-ND

U34	Voltage Level Translator	- 296-21978-1-ND

R302 – (1k ohm 0201)	- P1.0KAGCT-ND

C273 – (0.1 uf	0201)	- 445-4711-1-ND

C272 – (0.1 uf	0201)	- 445-4711-1-ND

ANT2	Antenna Connector U.FL	- H9161CT-ND

ANT	Antenna (Active)	- 931-1014-ND

That's just a prelim list to get the GPS module working with both the VCC regulator and VBACKUP regulator. No jumpers will be required if the above components are used. This may or may not be a complete list. Use at your own risk. Part numbers are all for Digikey.

I am running VEGAn 5.1.1. Maverick is pretty nice but it can't compete with Google Maps. It looks like Roebeet may be aware of the inverted longitude issue. It's mentioned on the NotionInkHacks.com forum. Hopefully we can get his attention on this.

-John

P.S.- Here's the site I've been referencing for GPS protocol. WAAYYY more info than we need. :p http://aprs.gids.nl/nmea/
[G Tablet General] fosser2:
I'm not sure why yet, but my setup is still having issues. Right now I am currently seeing 12 but my gps will not "link" to any of them. I do not have the gps lock indicator at the top of my tablet anymore either. I'm trying to figure out what I did wrong. If it keeps doing it, I may try switching roms.
[G Tablet General] jmdearras:
You have a signal problem, antenna or location. "in view" does not mean your GPS is seeing them, just that they are above the horizon, and available to be seen.
[G Tablet General] jmdearras:
Hopefully, I am stating the obvious, but you all do realize GPS reception is generally only adequate outdoors.
[G Tablet General] fosser2:
haha ya I got that :p
[G Tablet General] rajeevvp:
fosser2, twistedrotors: A superb job with the GPS hardware.

Hmm... I had a quick look at the problem, and as far as I'm able to make it out, it looks like a Java problem. The NMEA strings are parsed there and not in /system/lib/libgps.so.

Let's see your gps.conf file, anyway.
[G Tablet General] fosser2:
twistedrotors, quick question. In your part list that you put together you say to use (L11 Ferrite Bead - 445-6406-1-ND) This ferrite bead is different than the one that I used. I am using http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=445-2171-1-ND this chip. The data sheet for the gps says

After reading this am I using the wrong ferrite bead or was the one in your part list not correct? Currently I am having issues properly picking up the satellites so I am wondering if it might have to do with this ferrite bead.

EDIT: I just got out of a chat with Digi-Key and they recommended this chip. http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=240-2391-1-ND (240-2391-1-ND)
[G Tablet General] fosser2:
I finally got my gps partially running again. My gps.conf file was not properly configured (not that it still is) So if you run into this problem edit this file to look like the following.

I did not figure this out, I read it at the following link

I hope this helps out.

ps. use the root explorer app to edit the file at system/ect

EDIT: there is an app called "faster fix" thats free in the market. supposedly it changes this file automatically for you!

After using the app "faster fix" my gps.conf is the following.

I would love to find a way to automatically have gps turned on when the tablet is powered up. It really sucks doing echo command every time.
[G Tablet General] fosser2:
I installed honeycomb and decided to mess around w/ gps on that. The GPS configuration is much different on honeycomb. The config file refers to a gps.xml file that has all of the settings and code in it.
[G Tablet General] twistedrotors:
My desk is in front of a big window. I get a GPS lock in about 5 seconds from a warm boot. :)

That is disheartening to hear. I was wondering though, why do bluetooth GPS receivers work fine? They send out the same NMEA strings, just over bluetooth. The gps.conf file that I made is below, but it's nothing special. The module acts the same whether the file is present in /system/etc/ or not. I get the feeling that it's not being used on my system.

server us.pool.ntp.org

NTP_SERVER=us.pool.ntp.org

#server 1.north-america.pool.ntp.org

#server 2.north-america.pool.ntp.org

#server 3.north-america.pool.ntp.org

SUPL_HOST=supl.google.com

SUPL_PORT=7276

Whoops! My bad, I wasn't paying attention and used the one listed on the first page of this thread. I've changed my post to the new chip that you recommended.

That's odd, the Maps and Navigation program should enable the GPS when you start them up. On my tablet at least, when I start Maps and then check that gps_enable file it is set to 1.

-John
[G Tablet General] Vlad_z:
Maybe I missed your reply, but can you post raw NMEA strings coming from internal GPS device and if you have bluethooth gps then that one too. So we can see why java code did not parsed W/E indicators correctly in one case and doing fine in other. May be upper/lower case character issue, extra space or etc.
[G Tablet General] rajeevvp:
That is a good question. I'm not really sure who does what data-munging and where on Android. What we need is an Android + GPS expert. Fortunately we may have just such a guy on this board, here:

http://xdaforums.com/showthread.php?t=721150

I've also sent him a PM. Let's hope he can help us out if it's a Java issue. If, instead, he tells us that it actually is a Linux/C thing, then I'll handle it.

Yup, that is how it should be. You shouldn't need to toggle it yourself. My feeling is that Froyo-based ROMs will work correctly compared to Gingerbread-based ROMs--something got lost in the transition from one to the other. Anybody care to reload the ViewSonic stock ROM, or a stock-ish ROM like TnT-Lite 4.4.0 to see if the GPS works correctly better?

ADDED: Found a page on the board which lists a lot more gps.conf settings. I'm not sure how much applies to our tablet--most of the settings seem to be for carrier-based GPS hardware--but there is an intriguing setting called ENABLE_NMEA=<true|false>:

http://xdaforums.com/showthread.php?t=1008252&page=7

So, I would recommend this as your /system/etc/gps.conf

# GPS configuration

# Network time Protocal
# sample: north-america.poll.ntp.org 0.pool.ntp.org 1.poll.ntp.org
NTP_SERVER=us.pool.ntp.org

# SUPL - Secure User Plane Location for A-GPS
# sample:
SUPL_HOST=supl.google.com
SUPL_PORT=7276

#C2K: what is C2K
#C2K_HOST=default
#C2K_PORT=0

DEBUG_LEVEL=5
ENABLE_NMEA=true

XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin

It may not help with our problem, but, it will help you get a faster GPS "fix".
[G Tablet General] fosser2:
ya, i'll do it right now. Give me 20min because i gotta downgrade bootloaders from 1.2-1.1
[G Tablet General] fosser2:
I downgraded to TnT4.4 and I can't get a fix. It seems to be an issue overall with my tablet. Can someone tell me what I need to check to get a proper fix? I have updated my gps.conf file to match

I have no idea but it seems to fix on random. I also still have to enable my gps through echo every time. Maps does NOT turn it on automatically (on any rom version)
[G Tablet General] rajeevvp:
Try installing the latest pershoot kernel for Froyo-based ROMs from http://droidbasement.com/db-blog/.
[G Tablet General] ThatGeekGuy:
I have been following this thread since the start, and want to thank everyone for the work they're putting in on this. I'll probaly wait until things get nailed down before ordering parts, but am comfortable in doing the surface mount component soldering.
[G Tablet General] twistedrotors:
Both myself and Fosser have the same inverted longitude problem. Using a modified version of Maverick has allowed us to correctly display our location but the Maps and Navigation apps will not work.

Excellent! Thank you! I will update my gps.conf to match that. :)

That is really really weird. I just tried to boot my tablet to verify that mine does enable the VCC regulator when Maps is started but my battery is completely dead. As soon as it charges enough to boot then I'll check it out.

-John
[G Tablet General] fosser2:
-twistedrotors

Just wondering what ROM that you are using during testing. Thanks.
[G Tablet General] Vlad_z:
Yes, I've read this. Looks like modified version of Maverick just changed sign of Longitude AFTER it gets value from Android GPS Location provider (like post processing):

Latitude = android.location.getLatitude * -1 ;

Problem might be in android.location parser. It would help to diagnose problem if we can see raw NMEA strings coming from BT GPS as well as internal one. There must be something different in those strings granted that android OS parsed one string correctly and in other ignores "W/E" indicator.
[G Tablet General] fosser2:
If I can get my gps to work I will dump the NMEA strings for you. what command do I have to use to do this?
[G Tablet General] twistedrotors:
Well from all the research I've done it seems that NMEA sentences have a standard structure that they are supposed to follow. Below are some NMEA sentences from both my internal GPS module and my Droid BT tethered to my PC and running ShareGPS. I have used my Droid BT tethered to my Gtab as a GPS "mouse" and it does show my correct location. No inverse longitude. Hope this helps.

Internal GPS:

$GPGSV,3,2,11,32,47,200,21,06,29,127,24,03,28,146,26,13,23,317,*7C

$GPGSV,3,3,11,31,17,061,,19,07,167,,07,05,267,16*43

$GPRMC,205906.000,A,2944.9776,N,09522.7800,W,0.00,133.72,100511,,,A*73

$GPVTG,133.72,T,,M,0.00,N,0.0,K,A*09

$GPGGA,205907.000,2944.9776,N,09522.7800,W,1,07,1.4,51.6,M,-23.7,M,,0000*5B

$GPGSA,A,3,32,16,20,06,23,30,31,,,,,,2.8,1.4,2.5*38

$GPRMC,205907.000,A,2944.9776,N,09522.7800,W,0.00,133.72,100511,,,A*72

$GPVTG,133.72,T,,M,0.00,N,0.0,K,A*09

$GPGGA,205908.000,2944.9776,N,09522.7800,W,1,07,1.4,51.6,M,-23.7,M,,0000*54

$GPGSA,A,3,32,16,20,06,23,30,31,,,,,,2.8,1.4,2.5*38

$GPRMC,205908.000,A,2944.9776,N,09522.7800,W,0.00,133.72,100511,,,A*7D

And BT GPS:

$GPGGA,213641,2944.989067,N,09522.780658,W,1,09,,,,19.9,M,,*1C

$GPVTG,nan,T,nan,M,0.0,N,0.0,K,A*23

$GPRMC,213641,A,2944.989067,N,09522.780658,W,0.0,,160511,0.0,W,A*3E

$GPGSA,A,3,03,06,07,13,16,19,20,23,32,,,,,,*11

$GPGSV,3,1,9,03,48,115,25,06,42,092,24,07,19,289,23,13,48,324,18*2D

$GPGSV,3,2,9,16,47,035,22,19,29,150,31,20,28,212,15,23,85,018,23*7D

$GPGSV,3,3,9,32,19,187,21*13

$GPGGA,213642,2944.989065,N,09522.780660,W,1,09,,,,19.9,M,,*16

$GPVTG,nan,T,nan,M,0.0,N,0.0,K,A*23

$GPRMC,213642,A,2944.989065,N,09522.780660,W,0.0,,160511,0.0,W,A*34

VEGAn 5.1.1. And I tested the "auto" enable and it does in fact work on my tablet. When I startup the Maps application then the enable pin of U29 automatically goes high. I have no idea why it's not working on yours.

-John
[G Tablet General] herbert1:
Normally Android uses just GGA and RMC Nmea sentences in order to build the location instances.

NMEA gives latitude, longitude, altitudes (2 values) and horizontal accuracy (hdop) and RMC gives latitude, longitude, bearing and speed.

You have to take into account the direction N/S E/W to compute correctly the lat/lon (value is positive for N and E, negative for S/W).
[G Tablet General] jwlehane:
3 people. I just came back to gtab forums after a long absence, because my gtab seems to have been fried in a soldering experiment to get the power connector re connected. I had a professional do it, but after reading this awesome thread, i wish I had done it myself and started learning this stuff.

I love this thread, and hope it has a happy ending.

Johnnykickball
[G Tablet General] Vlad_z:
There are differences in internal vs. BT strings:

$GPGGA,205907.000,2944.9776,N,09522.7800,W,1,07,1.4,51.6,M,-23.7,M,,0000*5B

vs.

$GPGGA,213642,2944.989065,N,09522.780660,W,1,09,,,,19.9,M,,*16

time goes as a float in one case and coordinates goes with more "precision" in another - I'm not sure if this is enough to fool android gps parser.

I'll try to look at android.location package.
[G Tablet General] jmdearras:
If I had to guess, the code was written by someone in the China quarter of the world where you can ignore the E/W and N/S indicators, the lat/lon is always positive.
[G Tablet General] fosser2:
I wonder if theres any patch someone could make that could invert the data after it comes in from the chip...Kind of what is built into Maverick already.
[G Tablet General] Vlad_z:
I am looking at this possibility. Basically, we would need new/corrected location provider.
[G Tablet General] rajeevvp:
That sort of variation is quite okay according to the specs, and conformant parsers should not have a problem with them. I ran those NMEA strings, and another file which twistedrotors gave me some time back, through the C code in gpsd-2.96bis, and the strings were accepted without any problems. gpsd on Linux even told me that I was in Texas.

It looks like my gut feeling about this was right: Apparently this is a known issue and a bug report has been filed with Google (see esp. comment #11 there):

https://code.google.com/p/android/issues/detail?id=15500

And, here on this board:

http://xdaforums.com/showthread.php?t=1027071

http://xdaforums.com/showthread.php?t=970419

The "NMEA listener not working" bug affects the Motorola XOOM too:

http://community.developer.motorola...-sentences-not-being-received-nest/td-p/12982

http://osdir.com/ml/Android-Developers/2011-03/msg04802.html

Plenty more if you google for: "NMEA listener" +"gingerbread"

Given all this, the question still is: how does GPS over Bluetooth work? My uneducated guess (I'm not a Java guy) is that when it's over bluetooth, clients use a different set of interfaces--ie. one not based on NmeaListener--to get the GPS data.

This is, I think, where my expertise hits a wall. The Java guys on the board will have to take over. I'll be around, though, if you guys need any systems-side assistance.

Cheers.

Rajeev
[G Tablet General] herbert1:
I confirm, these variations are not very significant.

The time is HHMMSS (hour minute seconds) with typically 1 fix per second so...

The lat/lon is DDMM (degres*100 + minutes (in decimal)) so the last digits are not very significant.

I'm parsing the NMEA sentences myself then I generate the android location fixes which are forwarded using the mock API... ;)
[G Tablet General] fosser2:
I installed a LED into my tablet today on pin 7 (Lock Indicator) I also got a new multimeter in the mail today so I will be doing some more messing around with my setup. I am still trying to figure out why my location will not lock in. I switched to vEGAn 5.1.1 ROM. When I launch maps or any "gps service" I do get power to my gps now. (it sure is helpful to have the LED) I will post a pic in a bit.

Here is a picture w/ the case on. I melted a small hole through the casing so the light can shine through :D
[G Tablet General] fosser2:
Another problem that I have run into...antenna reception. I am trying to figure out a good placement for the antenna. It works fine with the case backing off, but as soon as I put it back on, it loses its fix. Is there any way that I can "amplify" the antenna or is there a perfect location for it? Also would a different antenna work better for this setup?

EDIT: I may have found a good location. I'll post back in a bit

̶E̶D̶I̶T̶2̶:̶ ̶y̶e̶p̶ ̶t̶h̶e̶ ̶s̶p̶o̶t̶ ̶i̶s̶ ̶l̶o̶o̶k̶i̶n̶ ̶p̶r̶e̶t̶t̶y̶ ̶g̶o̶o̶d̶.̶ ̶<̶1̶0̶s̶e̶c̶s̶ ̶a̶n̶d̶ ̶I̶ ̶g̶e̶t̶ ̶a̶ ̶l̶o̶c̶k̶

EDIT3: scratch the pretty good from above. it works ok. i wish my antenna was more powerful?

EDIT4: I'm thinking that gps cannot lock if battery is below 10%

Well I think i'm relocating the antenna. I'll post back later.
[G Tablet General] twistedrotors:
Hhhhmmm, very interesting. Does BlueGPS4Droid just listen to the bluetooth serial port for the NMEA sentences? Could something like that work for us? Listen to the GPS serial port instead, parse up the sentences and generate a mock location? Cause that would be really awesome. :D

Nice job with the LED!

-John
[G Tablet General] herbert1:
Yes, I just need an InputStream where I could read the NMEA sentences.
[G Tablet General] rajeevvp:
/dev/ttyHS3 is what you need. Port params: 9600,8,N,1

fosser2, twistedrotors: can you guys do a "hexdump -C /dev/ttyHS3" to confirm that that is where the GPS data appears?

herbert1: If you need any JNI code written to talk to the serial port, just ask--although, I think Java already has serial port-related APIs.
[G Tablet General] herbert1:
In the android SDK there is just a subset of the java API and, if I remember correctly, we don't have serial ports API.

Since I don't have any usb GPS, I haven't tried to read serial ports yet.
[G Tablet General] twistedrotors:
Awesome!

Will do ASAP.

Edit: Done. Couldn't get a lock cause it's crappy-ish weather and I don't feel like going outside. lol! But you can see that the NMEA strings are in fact coming in to ttyHS3.

export PATH=/data/local/bin:$PATH
$ $
$ su
# hexdump -C /dev/ttyHS3
00000000 24 47 50 47 47 41 2c 31 35 33 37 32 39 2e 31 30 |$GPGGA,153729.10|
00000010 37 2c 2c 2c 2c 2c 30 2c 30 30 2c 2c 2c 4d 2c 30 |7,,,,,0,00,,,M,0|
00000020 2e 30 2c 4d 2c 2c 30 30 30 30 2a 35 42 0a 0a 24 |.0,M,,0000*5B..$|
00000030 47 50 47 53 41 2c 41 2c 31 2c 2c 2c 2c 2c 2c 2c |GPGSA,A,1,,,,,,,|
00000040 2c 2c 2c 2c 2c 2c 2c 2c 2a 31 45 0a 0a 24 47 50 |,,,,,,,,*1E..$GP|
00000050 47 53 56 2c 33 2c 31 2c 31 32 2c 31 38 2c 34 33 |GSV,3,1,12,18,43|
00000060 2c 30 39 34 2c 2c 32 32 2c 36 37 2c 30 34 33 2c |,094,,22,67,043,|
00000070 2c 31 34 2c 36 32 2c 33 33 39 2c 2c 33 31 2c 33 |,14,62,339,,31,3|
00000080 38 2c 31 39 36 2c 2a 37 32 0a 0a 24 47 50 47 53 |8,196,*72..$GPGS|
00000090 56 2c 33 2c 32 2c 31 32 2c 32 35 2c 31 37 2c 31 |V,3,2,12,25,17,1|
000000a0 31 35 2c 2c 32 31 2c 31 33 2c 31 35 39 2c 2c 31 |15,,21,13,159,,1|
000000b0 32 2c 31 32 2c 30 37 37 2c 2c 31 31 2c 31 31 2c |2,12,077,,11,11,|
000000c0 33 31 32 2c 2a 37 33 0a 0a 24 47 50 47 53 56 2c |312,*73..$GPGSV,|
000000d0 33 2c 33 2c 31 32 2c 31 39 2c 31 31 2c 32 36 37 |3,3,12,19,11,267|
000000e0 2c 2c 30 39 2c 31 31 2c 30 33 37 2c 2c 30 36 2c |,,09,11,037,,06,|
000000f0 30 34 2c 32 32 38 2c 2c 32 34 2c 30 32 2c 33 32 |04,228,,24,02,32|
00000100 33 2c 2a 37 30 0a 0a 24 47 50 52 4d 43 2c 31 35 |3,*70..$GPRMC,15|
^C
#

-John
[G Tablet General] rajeevvp:
Android may not, but Java has it:

http://www.oracle.com/technetwork/java/index-jsp-141752.html

I remember colleagues messing with it some years ago.

There's nothing very special about reading from a serial port as the hexdump example shows. If you have the port parameters set up correctly (and this can be done with an "stty ..." command beforehand), you can just read data off the port like you would with a socket descriptor (you'll have to open the device in non-blocking mode and then wait for data to become available).

However, it might not be that easy in this case, because of the problem described below:

Time for another test.

1. Do a "hexdump -C /dev/ttyHS3" and just let it run.

2. While the hexdump is running, try to use Google Maps.

Now we have 2 programs reading from the same port, which will cause all sorts of interesting problems:

a) No program will get perfect copies of all the data.

b) Each program will get whatever it can grab as the kernel tries to satisfy both programs.

c) You can't predict the order in which the programs will get a chance to read, or the amount of data each will get. You can't control this either.

d) You can't even lock a serial (aka. character special device) for exclusive use.

My prediction is that Google Maps will either a) be very slow at coming up with a location or b) work incorrectly.

The straightforward solution is something like this:

Write a multiplexer program to supply the serial port data to 2 programs: a) the system_server program, which is what's reading the serial port now (and ultimately supplying the data to Google Maps), and b) our NMEA parser and mock location provider.

This program will have to be started up right at the beginning when the system boots up because, it has to be the first to open the port. It will then:

1. Start up, then move /dev/ttyHS3 to /dev/ttyHS3.orig

2. Create a new /dev/ttyHS3 file (a new pseudo-tty device) so that the Android programs continue to operate as before.

3. Create a new file somewhere on the system for our program to use. This could either be a file which could be opened directly, or it could be a TCP/IP port you can connect to--whichever is convenient. No need for JNI in either case.

4. Copy all data to and from /dev/ttyHS3.orig which only we are reading to /dev/ttyHS3 and the other file (or port).

Herbert1: Let me know if this sounds good.
[G Tablet General] rajeevvp:
hexdump -C /dev/ttyHS3 > /mnt/sdcard/hexdump.txt

or,

hexdump -C /dev/ttyHS3 | tee /mnt/sdcard/hexdump.txt

if you want to store the output in a file and want to see it too.

Hmm. Don't know what to make of the second part, but, it's interesting that running hexdump didn't affect Google Maps at all. Maybe it doesn't need continuous output to get the location, and it's okay if a few NMEA strings are missed. Or it could be that when you switched focus from the Terminal to Maps, the kernel put the Terminal Emulator (and thus the hexdump) to sleep. Whatever the case, it's unwise to rely on that sort of behaviour.
[G Tablet General] fosser2:
Yes I was thinking the same thing. I was hoping that it didn't pause when the program was pushed to the background but that is a very good possibility. I can say that between the terminal editor and google maps my gps never lost its lock. I was watching the indicator light.
[G Tablet General] herbert1:
I know I should have read more carefully all the previous posts, but could you remember me how you start the GPS ?
[G Tablet General] fosser2:
the gps starts automatically when you run a program like maps or navigation. In terminal the gps can be started by running

echo 1 > /sys/devices/platform/gps_control/enable

Is this what you were asking?
[G Tablet General] herbert1:
Yes , exactly. Thanks
[G Tablet General] scyld:
Awesome job, keep up the good work :)

Just one question: I know that this had to have been mentioned somewhere, but... if it's not too much to ask, would you mind uploading a pic of the GPS chip installed?

I'm just wondering about, for instance VBACKUP (pin 11) to A+... do you use short lengths of wires for "off-socket" connections like these?

Thanks again!
[G Tablet General] fosser2:
Here is a picture.

VBACKUP is supplied from the U22 jumper pin. I will be ordering the proper chip to go there in the near future because it's not supposed so operate like that.
[G Tablet General] rajeevvp:
I was slow yesterday night, wasn't I? The GPS shutting off when you background Maps is the correct behaviour, isn't it? Why waste power keeping the GPS on if it's not being used?

If you try this command in a Terminal you should see the output toggling between 0 and 1 when you background and foreground Maps:

( while :; do cat /sys/devices/platform/gps_control/enable; sleep 1; done )
[G Tablet General] fosser2:
Yep, that is the behavior that I am getting.