yashsingh1/xdaforums huggingface dataset:
[G Tablet General] rajeevvp:
It's strange that we haven't met yet. According to our GPSes, we're both in the exact same location, no? :D
[G Tablet General] fosser2:
hahaha I guess so. Should be my next door neighbor :p
[G Tablet General] fosser2:
I'll try this out for you quick.

EDIT: Starting the GPS app then running the echo command does also work. Google maps accurately pulled my location.
[G Tablet General] herbert1:
3rd alpha version of app
[G Tablet General] rajeevvp:
Beta gps_fake-0.1 program attached.

The program is for people developers who don't have a serial-port GPS but want to test their apps on such devices. The program's method of operation is pretty specific to nVidia's Tegra 2-based Harmony boards ie. it acts like the typical internal GPS hardware would (if it were installed) on those boards. If your app works with this fake GPS device, then it should work on, at least, these tablets: ViewSonic gTablet, Notion Ink Adam and the Hannspree Hannspad. It is less useful for people with nVidia's Tegra 2-based Ventana boards--ie. people with the Asus Transformer, the Motorola Xoom, and their kin. Ventana based boards use a different GPS implementation compared to the Harmony based boards with a built-in GPS like the NI Adam.

Tested and verified to work on the gTablet only.

See README.txt inside the distribution file for more details.
[G Tablet General] fosser2:
wow, I'm impressed with this one. This 3rd version works great. The start/stop gps checkbox does toggle the GPS on and off. The only problem that I have with it, (in the short time I tested it), is that when you first start it up, the GPS start box is checked. You have to uncheck it, then recheck it to get it to work. The first run, the program does ask for superuser privileges. It did the same thing in CM 7 also.

ps. in the next build switch the icons quick :p that quick one that I made has grown on me hahaha
[G Tablet General] fosser2:
I'm giving this a try right now! I'll let you know what I think about it.

EDIT: first try, failed. Thought I could edit init.rc then reboot. Forgot I can't do that because init.rc gets rewritten every boot. dang it.

EDIT2: Attempting to rebuild boot.img. I hope I used the right command.

EDIT3: Rebuild on boot.img did not work. Stuck at viewsonic birds screen...

EDIT4: Well I have determined that I do not have the know-how to sucessfully re-assemble a boot.img. If anyone has the know how please download the attachment and re-assemble it for me. In the meantime, I am going to try out this program on the latest nightly of CM.
[G Tablet General] rajeevvp:
I got to thinking about this, and I think there is a way to turn the GPS on and off on demand.

Instead of turning the device on and off when the calling apps are foregrounded/backgrounded--which, at present, looks impossible--you could turn the device on when a location request comes in and then turn it off (a short while) after the response has been sent back. A mild amount of buffering will be needed to preserve state, I suspect.

How does this sound? This way the user need not turn the device on manually at all.
[G Tablet General] rajeevvp:
Try running the program (with the appropriate options) right after the tablet has booted. I doubt that this will work, but, give it a try anyway.

PS. I hope you don't mind my supplying your location information in the nmea.txt file. I could try changing the location to Siberia if you object...
[G Tablet General] fosser2:
haha I don't care. It's too late for me to attempt to change it right after tablet is booted. I'm flashing a new image right now.
[G Tablet General] fosser2:
-rajeevvp

Ok, I have messed around for awhile but still can't seem to get your program to initialize for me. Currently I am running the latest nightly of CM. I added the following lines to the "init.local.rc" file.

service gps-fake logwrapper /data/local/bin/gps-fake -f /emmc/nmea.txt
user root
group root
oneshot

I have also added the gps-fake file to the above location "/data/local/bin/gps-fake" After restarting the tablet I guess this is where I get stuck. If I go into maps or some other gps program is the GPS supposed to just auto start itself? Or do I have to run a different command through terminal to initiate the process. I guess this is where I'm a bit confused.
[G Tablet General] rajeevvp:
It won't work as is. You don't have the compatibility library that is missing on GB (and Honeycomb?) ROMs that allow /system/bin/system_server talk to libgps.so (which is still Froyo-based). Lemme gin up a quick update file for you. For the fake GPS, you don't need to set permissions to /dev/ttyHS3--which is where I too am stuck at the moment.

That looks right, but, I haven't tried starting the program that way via init.local.rc. I used the second method mentioned in the README.txt file--adding the command to /data/local/userinit.sh.

After you flash the update, GPS operation should be as it is on Froyo-based ROMs. You won't have to do anything special.

Just don't enable herbert1's alpha-test program. :rolleyes: At least, not yet. We'll eventually have to make sure that both the default GPS provider and the mock GPS location provider (both of which will use the same internal GPS device) will work well together.
[G Tablet General] rajeevvp:
Updated 2011-07-13

ClockworkMod installable zip file to enable the custom (Linx RXM-GPS-SG) internal GPS module on Froyo-, Gingerbread- & Honeycomb-based firmware distributions for the ViewSonic gTablet.

Note:

1. You don't need to enable the fake GPS device after you flash this update.

2. GPS should work on Froyo-, Gingerbread- and Honeycomb-based ROMs.

3. You can also enable the fake GPS program using /system/etc/init.local.rc or /data/local/userinit.sh (both, CM-7.x only) after you've flashed this zip file, but, it will be sorta pointless. Why use a fake GPS device when you have the real thing?

4. If the fake GPS program is also activated, then that will take over GPS functions from the real device. The real GPS will be enabled and disabled as usual, and it will send NMEA strings to /dev/ttyHS3.orig, but now, no program will read that data. The fake GPS program will, instead, supply its own NMEA data from the nmea.txt file.

To go back to using the real GPS, just comment out the fake GPS-related bits in init.local.rc or userinit.sh.
[G Tablet General] fosser2:
Umm...WOW thats all I have to say. At first I didn't think it was working when I tried it in CM7. I forgot to enable the permissions. Make sure that you run the following commands before running it on CM7.

$ su
# echo "chmod 666 /dev/ttyHS3" >> /data/local/userinit.sh
# chmod 755 /data/local/userinit.sh

I am booting it into honeycomb and am going to try it in just a few minutes. This is incredible...Even the GPS symbol shows at the top of the screen! Also any programs that require internal gps auto-toggle it on and off properly. When I opened Maps up, GPS turned on, when I closed it, it turned off. :D

EDIT: Now onto the bad news. After installing it into the Honeycomb build (BoS a6.0) it puts it into a boot loop. The bootloop occurs right after the words "powered by VegaComb and Adam HC" go away. The main home screen flashes for a second then snaps back to the power by screen. I also installed the fix then did a data wipe. It sill bootlooped. Looking through the files that we flashed I am surprised it does this. The only 2 files that get flashed are libgps.so and gps.tegra.so correct? Well we know since I have flashed libgps.so many times that the gps.tegra.so is the culprit. I have no idea what coding you changed in that file but I'm wondering what could have caused this to happen...

EDIT2: Tutorial Updated for all the recent development going on.
[G Tablet General] rajeevvp:
That bug report is, in a way, encouraging, because it now looks like /system/bin/system_server is loading both gps.tegra.so and libgps.so correctly, as it is on GB. Then, when the functions in gps.tegra.so are called, system_server crashes. Android tries to restart it and then it crashes again, giving us that boot loop behaviour.

Lemme see what I can do. Also, since we only have to fix GPS on HC now, stick to BoS or another HC ROM. Still, if all else fails, we can always rely on herbert1's InternalGPS4GTab app which we know works HC.
[G Tablet General] fosser2:
I'm pretty sure the data lines are connected, the only thing that was missing was the chip and regulators.
[G Tablet General] dzasta:
In many cases, after you power off, the bigger decoupling caps on the voltage supplies are still charged which gives you the impression that some Vcc pins still show voltage. the only way to know for sure would be to disconnect battery, wait 5 minutes, then measure said pins. if the pins are actually always powered, it would definitely drain the battery. at best LDO's are around 80% efficient so battery drain would be noticeable.

in regards to U39, since you already have the tab open, could you trace the tx and rx pins from the gps module for us and see where they go? :D
[G Tablet General] fosser2:
haha i second this notion :D
[G Tablet General] twistedrotors:
That's going to be up to you and how you feel about your soldering abilities. I've soldered enough surface mount components that I feel confident rebuilding the power circuit completely.

Just got back to the house and I'm going to start going through the regulator datasheets to figure out what capacitors are needed.

Thanks again for starting this thread and getting the ball rolling!

Good call, this is why I like having multiple people working on a project! :)

I disconnected the battery, let it sit, checked voltages and found nothing present. ~0vdc at both points. Reconnected the battery, immediately rechecked the points and they both have voltage. 3.3vdc and 5vdc respectively.

I'll do my best tracing the data lines but if they do not go to the U39 pads (which I really hope they don't) then it may be impossible to find where they go without a schematic of the main board.

-John

Edit: Just a note for reference, the gps module datasheet cites 3.0-4.2 vdc for VCC and 1.3-6.0 vdc for backup battery.
[G Tablet General] rdtshaw:
Great thread! As soon as I get a replacement tab from vs, (touch screen issues), I'd love to experiment with this. I have all the equipment available to me. Cheers!

Rob
[G Tablet General] fosser2:
Quick update: parts ordered! now onto the waiting. Keep the posts coming.
[G Tablet General] jmbach:
This is GREAT! Its great when a community comes together.

Keep track of the parts cost and vendors used and after it is working post the info. I am looking forward to this mod!
[G Tablet General] fosser2:
Don't worry, I will keep everyone informed. Another request, although I have parts coming, please keep tracing the circuits and see if we can get the "power supply" circuit working again!!
[G Tablet General] SirhanSirhan:
Does the firmware support this upgrade?
[G Tablet General] fosser2:
There is calls for it in the code, so we'll see I guess. When the parts come I will let everyone know.
[G Tablet General] twistedrotors:
Hey Fosser, and everyone else following this thread, I have a little more info to update.

First, the originally proposed regulator http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=NCP51460SN33T1GOSCT-ND will not work for U22. The powered pad on the PCB for U22 has 3.3v on it. That regulator from Digikey is a 3.3v output, so it needs more than that on its input to work. 4.2v is minimum according to the datasheet. On top of that, as far as I can tell the pinout is wrong. The hot input pad (3.3v) on the U22 footprint is the one that would tie to that regulators GND pin. This does not appear to be the device that the manufacturer intended to use here. I thought maybe a diode in a SOT-23 package would work, and it might, but I don't see why. 3.3v is well within the range of the GPS modules backup battery input voltage, so why not just use that. And what's with all the filtering capacitors if you're not using a regulator. Unless I'm miss understanding something completely. I'd really like a second set of eyes (or more) looking at this. Below is a screenshot from the proposed regulator datasheet for reference.

Second, this regulator http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=NCP551SN33T1GOSCT-ND should work just fine for U28. The pinout is correct as far as I can tell. Furthermore, the constant hot voltage on the U28 input pin shouldn't be a problem as this regulator has an enable pin. It appears to be connected (there's a via connected to it on the PCB) and I assume the Gtabs cpu has control of the pin. From the datasheet this regulator doesn't need much in the way of capacitors. Recommended 0.1uf cap on the input and a 1.0uf on the output, ceramic or tantalum for either is acceptable. Screenshot below of U28 footprint.

And finally, here's a list of the capacitors that appear to be applicable to the GPS modules power supply section. I've looked closely at pictures I took while my Gtab was open and I think I got the connections right but I didn't actually ohm anything out so I'd appreciate it if someone else would squint at the pictures as well. Further below is the picture of the GPS module area again for reference. I took higher resolution pictures myself, but none of them were as sharp as this original. I suck at taking pictures. Lol!

C344	- U22 Output to GND

C345	- U22 Output to GND

C346	- U28 Input to GND

C350	- U28 Output to GND

C351	- U28 Output to GND

C352	- U28 N/C to GND

C356	- U28 Output to GND

C357	- U28 Output to GND

C358	- L11 to GND

C347	- U22 Output to GND

C348	- U22 Input to GND

C349	- U28 Output to GND

C355	- U22 Input to GND

And so the saga continues!

-John

Edit: FWIW, the GPS module might work just fine without the backup battery connected. Time to first fix may be extended though, something like 15 minutes! You may be able to bridge that 3.3v pad at U22 to the output pad of U22 and call it a day.

Oh, and standard disclaimer applies: I ACCEPT NO RESPONSIBILITY FOR ANY DAMAGE OCCURRING TO YOUR TABLET IF YOU USE ANY OF MY INFORMATION! Just sayin'. ;-)
[G Tablet General] twistedrotors:
Warranty REALLY voided now!

So I've had this gps module for a while but I didn't think to use it in my Gtab because it wouldn't fit. But I got to thinking, who cares if it fits? I just want to see if it works!

Tested the GPS with my computer and it works just fine. Spits out standard NMEA data at 9600 baud. Runs at 3.3v, even better!

So I soldered everything up to the Gtab, booted up and NO location available in Maps or Navigation. :(

So Fosser, I'm wondering, what does that GPS script do that Roebeet says he found and deleted? How does it "detect" an installed GPS module. I figure either my module isn't sending out data in the right format or the Gtab doesn't think it's there.

-John

P.S. - On a good note, that 3.3v pad at U22 will power a GPS module just fine. :D
[G Tablet General] fosser2:
I just put mine in, and i'm hoping I didnt f*** it up. Very beta still, but I'm messing around w/ different fw's right now to see if I can get it working. I will post back soon, keep up the good work!!! twistedrotors - I'm not sure yet. There has only been one report of getting this to work...I really wish I knew what fw chevy6.055 was running when he installed his chip. I also need to get my hands on a digital multimeter, I'll snag one from the college tomm probably.
[G Tablet General] rajeevvp:
Ah! That was what I was asking before. The Malata-written GPS device driver code is minimal. All it does is enable or disable the GPS GPIO pins. There are no functions to read data at all--which is why I asked if the data lines were connected somewhere and if so, where? Is it connected to the serial ports? or the SDIO ports? or something else?

Whatever the case, you can enable or disable the GPS GPIO pins/port by doing this. To enable, as root:

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

Verify:

$ cat /sys/devices/platform/gps_control/enable
1
$ dmesg | fgrep gps_control
<4>[36641.069145] gps_control: gps_control_write_sysfs_enable() enable=1

To disable, again as root:

# echo 0 > /sys/devices/platform/gps_control/enable

Verify it is turned off:

$ cat /sys/devices/platform/gps_control/enable
0
$ dmesg | fgrep gps_control
<4>[37293.039557] gps_control: gps_control_write_sysfs_enable() enable=0

Best of luck!

Note: The '$' and '#' characters are just prompts. Do not type them in. Lines with a '#' have to be run as root, and lines beginning with '$' can be executed by any user.
[G Tablet General] twistedrotors:
Rajeevvp, thank you! I followed your steps and below is what I got. Not sure what this means. Maps and Navigation still won't show my location but I feel like we're getting closer. Keep the ideas coming!

-John

export PATH=/data/local/bin:$PATH
$ $su
# cat /sys/devices/platform/gps_control/enable
0# echo 1 > /sys/devices/platform/gps_control/enable
# cat sys/devices/platform/gps_control/enable
1

#dmesg | fgrep gps_control
<4>[ 6.278742] gps_control: gps_control_init
<4>[ 6.282859] gps_control: gps_control_probe
<6>[ 6.287209] input: gps_control as /devices/virtual/input/input3
<4>[ 6.293931] gps_control: gps_control_probe success
<4>[ 89.146276] gps_control: gps_control_write_sysfs_enable() enable=1
<4>[ 113.946364] gps_control: gps_control_write_sysfs_enable() enable=0
<4>[ 119.182694] gps_control: gps_control_write_sysfs_enable() enable=1
<4>[ 135.043619] gps_control: gps_control_write_sysfs_enable() enable=0
<4>[ 155.488611] gps_control: gps_control_write_sysfs_enable() enable=1
<4>[ 179.982983] gps_control: gps_control_write_sysfs_enable() enable=0
<4>[ 356.238448] gps_control: gps_control_write_sysfs_enable() enable=1
<4>[ 421.857271] gps_control: gps_control_write_sysfs_enable() enable=1
<4>[ 519.218100] gps_control: gps_control_write_sysfs_enable() enable=0
<4>[ 527.692363] gps_control: gps_control_write_sysfs_enable() enable=1
<4>[ 647.176363] gps_control: gps_control_write_sysfs_enable() enable=0
<4>[ 732.972095] gps_control: gps_control_write_sysfs_enable() enable=1
<4>[ 758.299880] gps_control: gps_control_write_sysfs_enable() enable=0
<4>[ 1013.987623] gps_control: gps_control_write_sysfs_enable() enable=1
<4>[ 1042.523397] gps_control: gps_control_write_sysfs_enable() enable=0
[G Tablet General] fosser2:
When I get back today, I'll try this out too. Thanks for this info.
[G Tablet General] fosser2:
well heres what mine generated.

Mountain Laurel build 1.1.0

<4>[ 10.923786] gps_control: gps_control_init
<4>[ 10.927907] gps_control: gps_control_probe
<6>[10.932288] input: gps_control as /devices/virtual/input/input3
<4>[ 10.939034] gps_control: gps_control_probe success
<4>[ 425.571800] gps_control: gps_control_write_sysfs_enable() enable=1
<4>[ 800.693288] gps_control: gps_control_write_sysfs_enable() enable=1
<4>[ 825.931744] gps_control: gps_control_write_sysfs_enable() enable=1

Brilliant Corners build 1.2.0

<4>[ 10.850268] gps_control: gps_control_init
<4>[ 10.85439] gps_control: gps_control_probe
<6>[10.858777] input: gps_control as /devices/virtual/input/input3
<4>[ 10.865516] gps_control: gps_control_probe success
<4>[ 244.288299] gps_control: gps_control_write_sysfs_enable() enable=1

not sure what it all means...but maybe progress? lol

-still no go in maps or navigation. I'll be getting a multimeter tonight to test my solder points.
[G Tablet General] rajeevvp:
Ah yes! I forgot to ask about the extra "enable = 1" messages. Are all those messages there due to your enabling or disabling the GPS GPIO pins using echo, or is something else (Maps, maybe) making that happen? Please tell me it is the latter.
[G Tablet General] fosser2:
Sorry, its due to the echo right now I think.
[G Tablet General] fosser2:
Awesome sounds good :) I'm glad you know whats going on, because this is beyond me :p

EDIT: for the heck of it I'm trying another Honeycomb mod quick (Flashback a5.0) (reason being roebeet is slowing down development on BoS and recommended Flashback as a good alternative)

EDIT2: I can also report that Flashback a5.0 successfully bootloops also when the GPS patch is installed :p Anyhoot, I figured that this would happen.
[G Tablet General] rajeevvp:
Andrew, in the tutorial post, could you link to the post containing the zip file instead of linking directly to the zip? I will be changing that zip file to do a "chmod 0666 /dev/ttyHS3" soon, and I don't know if people following the direct link will get an updated file. I know that if they follow the post, they can always get the latest version of the attachment.
[G Tablet General] fosser2:
Yep, no problem. Will switch it now.
[G Tablet General] BuckeyBall:
Hi rajeevvp -

I'm MrGuy over at TabletRoms - just thought I'd say congrats for implementing the GB GPS interface as it was meant to be. Just thought I'd clarify things by saying the GPS app was never meant for GB - it was just a convenient solution. As for HC, I've been told that the interface has changed significantly - though I didn't verify it - I decided to write a generic solution instead :)

I'll be keeping an eye on this - if you manage to reverse it and implement it I'd be over the moon - One step closer to a 100% complete HC rom!
[G Tablet General] rajeevvp:
That's very gracious of you MrGuy, but, I cannot take credit for writing that GB<->Froyo compatibility library. Credit for that should actually go to Ricardo Cerqueira of CM. My own role was rather more modest--recognizing what was missing (after writing about a dozen test programs), and then compiling the missing piece.

Alright, try the new Gingerbread-GPS-fix-signed.zip in the original post. I've put in debug messages to help localize where in gps.tegra.so /system/bin/system_server is failing. Look for (copious) "gps-shim" messages in adb, or, the log file /data/misc/gps/gps-shim.log in case adb is unusable for some reason.
[G Tablet General] fosser2:
The new version of the program still has the same bootlooping issue. I can't ADB into the device normally and I'm not exactly sure how to do it via Clockwork "mount /data" If I can figure out how to get into the data folder while it is still bootlooping I will be able to get your log file for you.
[G Tablet General] rajeevvp:
Boot into ClockworkMod; then:

adb shell mount /data
adb pull /data/misc/gps/gps-shim.log .
[G Tablet General] fosser2:
Sorry kinda just ran outa of time for the day. I will mess around with this more after I work.

EDIT: I found a few minutes to quick try it. After starting up CWM, I ran the first command. It error ed out and said "error: device not found" I have no idea why...I have apx drivers installed are there other adb drivers that I need?
[G Tablet General] rajeevvp:
Unplug the cable from the gTab, wait a few moments, and then plug it back in again. Sometimes, adb doesn't recognize the gTablet the first time around.

Use the updated Gingerbread-GPS-fix-signed.zip file which now also modifies the one of the /init*.rc files (/init.rc for HC; /init.harmony.rc for CM-7.0.3; or, /init.nvidia.rc for CM-7.1.x) to set the correct permissions for /dev/ttyHS3.
[G Tablet General] fosser2:
I'm still working through driver related issues with adb. This is really starting to piss me off.

EDIT: finally!!! got adb running....

EDIT2:

C:\Android\platform-tools>adb pull /data/misc/gps/gps-shim.log .
remote object '/data/misc/gps/gps-shim.log' does not exist

I have no idea why the file does not exist. But it is not properly producing the debug data that you need...

EDIT3: I let it bootloop for like 20min hoping that during that time it would be able to write the debug file...Nope.
[G Tablet General] rajeevvp:
Try this next time.

Hmm. Try the new Gingerbread-GPS-fix zip file. I've now inserted log messages at the very beginning of the initialization sequence.

Q: There is a /data/misc/ directory on HC, isn't there? I'm only creating the gps/ directory under that one for storing the log file.