yashsingh1/xdaforums huggingface dataset:
[G Tablet General] fosser2:
Haha awesome, sounds like a plan. Keep up the good work!

EDIT: Lol, I've been sitting at this page a bunch today just clicking refresh. I can't wait to try the beta version of what you got going on!
[G Tablet General] fosser2:
I will not be focusing any more efforts on the compass mod, just because I don't really need a compass in my tablet because as long as you are moving the GPS takes care of that. If someone wants to pick up where I left off on that one, be my guest. The following is all of the info (most likely correct) that I have compiled about this mod.

Since the gTablet and the Malata Z-Tablet are pretty much the same, I pulled out all the info I could on the compass.

Compass model number: "mmc3140 electric compass"

Enable code:

#################################################
# #
# mmc3140 electric compass #
# #
#################################################

# change ecompass device permission
chmod 666 /dev/mmc31xx
chmod 666 /dev/ecompass_ctrl

The company who makes this sensor is Memsic. It can be found on this site. http://www.memsic.com/products/sensor-components/magnetometers.html For one to get the chip, there would most likely have to be a specific request sent out to Memsic to obtain the chip. The chip mmc3140 is found on the board under "Three-Axis" Magnetometers. Here is a picture of the board. The chip that is needed is premounted on this board. Here is another picture of the chip without a board.

Finally here is another link where more info can be found on the chip. You will need to translate it using Google Translate (Chinese to English). http://www.dltdl.com/newproducts/list_29_31.html

I took a quick peek on the board of the gTablet and I think that the Magnetometer would be mounted on the backside of the board, to the left of the voltage level translator that we installed for the GPS to function. It also looks like 1 resistor would be needed to function. Here is a picture of the location I think it goes.

From the looks of it, a heat gun would probably be needed to install this chip.

I hope this helps anyone who was wondering what Magnetometer the gTablet could potentially have installed.
[G Tablet General] mike_ekim:
Thank you very much
[G Tablet General] fosser2:
rajeevvp,

Any update on the software side of this?
[G Tablet General] twistedrotors:
Nope, none of the caps are polarized. If I'm remembering correctly, when I looked over the datasheets for all the components none of them said they needed tantalum capacitors so I just picked ceramic caps to make it simple. Also, I don't remember there being any markings near the capacitor pads on the board indicating which direction to solder a polarized cap in.

The module should output NMEA sentences as long as it has power but without satellites to view they will not contain much meaningful data.

Hey Fosser and Rajeevvp, glad to see you guys are still messing around with this! I just ordered the components to do this mod myself as I never could get that standalone GPS module to work when it was enclosed inside the Gtablets case. :)

-John
[G Tablet General] fosser2:
Hooray! he's back :p
[G Tablet General] insignia96:
Great post!

I love this post! I would be so happy to give my tablet GPS. This only thing is,not to get too greedy, is if I'm going to do this, I'd rather solder on a chip that is combo 3G-GPS. I noticed whilst scanning some pictures of the board that there is a place labelled SIM1 is there anyway to get the tablet running with 3G and GPS? as far as I remembered from my cellular experimenting they usually go hand in hand right? If anyone has succeeded at adding 3G data (CDMA or GSM) to their tablet I would be very interested in any information you could give me. If there is a way to add both 3G and GPS, I would be ready to do this in nothing flat, I am not an amazing programmer but I'd be willing to help develop Cyanogen mod 7 to work with this if there is anything I can do to help. I have had some low-level hardware experience also! Any info is greatly appreciated!
[G Tablet General] lanegd01:
There is thread on ez-pad.net. Be aware it is in Chinese. They inserted 3G module into a zpad they used the ericcson module. If I take the back off mine in the near future I will edit the post with model number.
[G Tablet General] lanegd01:
Btw how is the honeycomb GPS software coming on.
[G Tablet General] insignia96:
Yeah, I was reading a post on the first page about that ericcson 3G module. For me, after considering it for a while, I realized that I might just get a droid phone with unlimited data, then share wifi to my g Tablet with a GPS module installed like some here have done. There has already been so much work done on these that trying to do it all over again just to add 3G would kind of suck. As for the software, if anyone has had any success with GPS on gingerbread I am interested. I run CyanogenMod 7.0.3, I can't downgrade to another ROM because only Cyanogen 7.0.2+ supports Netflix with acceptable video quality, and streaming Netflix is one of the primary things I use my tablet for. Let me know and thanks!
[G Tablet General] fosser2:
For the software for the sim card, I'm guessing it is possible. I saw the spot on the board for it but since I am stingy I don't wanna pay for data plans :p My guess is that if you run Android 2.2 the sim card will be another solder in the connector and resistors and drop it in. It is most likely already working in the kernel but just not built onto the board. As for the software for gingerbread and honeycomb I'm hoping rajeevvp will keep us posted on how far he is with the software side of things.
[G Tablet General] herbert1:
Where are you with the modified version ? Any news ?

If you have problems, I can try to make an alternate version which will read data directly from a file and you could try and test how it will work using /dev/ttyHS3 ?

I haven't proposed it before because I thought Noting Ink or someone else could provide a correct driver...

The only problem for me, is that I can't test anything since I just have a bluetooth GPS.
[G Tablet General] fosser2:
MrGuy over at the tabletroms forums did almost exactly what we need. He did it for the Adam Ink. http://tabletroms.com/forums/showthread.php?1178-GPS-Fix The source is on that page. The only thing that the coding is missing is the echo command to turn the GPS on for our tablet. If someone could grab the code from him and add the echo command our GTablet should have GPS working on android 2.3+

EDIT: herbert1 it would be pretty neat to add a /dev/ttyHS3 | /dev/ttyHS2 toggle between bluetooth gps and internal gps into your BlueGPS program. That was just a thought. If you want to update BlueGPS to pull from /dev/ttyHS3 please let me know. I would most definitely test it for you!
[G Tablet General] herbert1:
Here is a modified version of BlueGPS4droid in order to read NMEA data from a file.

Instead of giving the name of a bluetooth device you have to give the path of a file. It's working with plain files so I hope it will also work with /dev/ttyHS3.

You will still have to start the GPS manually (echo command).

You should be able to see on the logcat if it recognizes NMEA sentences or not.

If you can post a copy of the logcat it could be usefull for me.

If it's working, we should be able to integrate the echo command later and clean the code...

For the source code, the simplest option could be to have a git repository somewhere (github/google code/sourceforge as you want), so we all could modify the code.

So how to use it :

1) enable GPS (don't know if you can)

2) start internalGPS4GTab

3) choose a NMEA device (device path: ako /dev/ttyHS3)

4) eventually activate "auto-enable location provider" in "location provider options"

5) start the reading service using the start checkbox

6) start GPS using the echo command

look if something happens in the locat...

PS : I don't know if you should use the echo command after or before starting the GPS app... perhaps you could try both.
[G Tablet General] fosser2:
I will take a good look at the file in depth later today! can't wait to try it!

EDIT: Ok I took a good look at the file you gave me. I ran the program and it does start the "mock location" service but it still does not pull data from /dev/ttyHS3. Going into Google maps the message that says you need a GPS source does not appear anymore. It just says "waiting for location" I made sure the GPS was locked (via the indicator light) before doing anything. I did try doing echo before and after starting the GPS app. I have no idea what is wrong, but I can confirm that doing a hexdump does show NMEA data. Your program is doing the exact same thing that MrGuy's program did; fake a location but not grab data. I can also confirm that when enabling NMEA log the file is blank.
[G Tablet General] rajeevvp:
It might be a simple lack of permissions problem. Do this from a Terminal:

$ [B]su[/B]
# [B]echo "chown system.radio /dev/ttyHS3" >> /data/local/userinit.sh[/B]
# [B]echo "chmod 660 /dev/ttyHS3" >> /data/local/userinit.sh[/B]
# [B]chmod 755 /data/local/userinit.sh[/B]

This will create a /data/local/userinit.sh shell script which will give read-write permissions for /dev/ttyHS3 for user+group "system". Reboot the gTab afterwards because the script is only executed at system boot.

CyanogenMod, being a developer-friendly ROM, will run that script before it initializes the Android software. YMMV on other ROMs. You can do a lot of interesting things in it. I, for instance, run the telnetd daemon which lets me telnet directly into the gTablet from my PC.

You can also screw up the system quite badly if you're careless with that script--certain long-running programs have to be run slightly differently because the logwrapper program is used to capture the script's output. You can also create individual shell scripts and place them inside a /data/local/userinit.d/ directory, and CM will execute all of them (in the usual sort order).

If the gTab appears to "hang" at the ANDROID screen: don't panic! Just boot into ClockworkMod, mount /data read-write, and just delete the userinit.sh file or the offending scripts inside /data/local/userinit.d/.

herbert1: You don't have to run an echo command. Just open "/sys/devices/platform/gps_control/enable" as you would any normal file (it has read-write permissions for all users) and then write the single ASCII character (not binary!) '1' to enable the GPS or '0' to disable it as directed by Android. No data will be read from /dev/ttyHS3 after you write a '0'.

fosser2: I've got the GPS working via the "official" method also. I'll send you a zip file which you install using CWM tomorrow. I'll also include the fake GPS-device emulator that I've been using for my own testing--it should be useful for herbert1 as well. It creates a new /dev/ttyHS3 (after moving the old one out of the way) from which you can read NMEA strings as you would from a read GPS device. The program just needs a file containing real NMEA strings as input. It loops through that file outputting GPS data once every second.
[G Tablet General] fosser2:
rajeevvp,

I tried that command out and it is still a no go. It is doing the same thing. Basically satellite is locking fine, but program is not properly reading data from hardware.

EDIT: awesome. Can't wait to try the "official" method!
[G Tablet General] rajeevvp:
Things to check:

0. Reboot the system. The userinit.sh script is only run once: at system boot.

1. After booting, does /dev/ttyHS3 have the correct permissions?

$ ls -l /dev/ttyHS3
crw-rw-rw- 1 root root 251, 3 Jun 30 07:07 /dev/ttyHS3

Correct permissions look like the above.

2. Have you done an "echo -n 1 > /sys/devices/platform/gps_control/enable" before you run Maps, etc?

3. Does "cat /dev/ttyHS3" output readable NMEA strings?

4. Does the Android log (use the logcat command, or, the free alogcat app from Market) show any diagnostic or error messages from herbert1's BlueGPS program?

5. Is the GPS-device pathname correct in BlueGPS? Case also matters on Unix. You should've entered: /dev/ttyHS3.
[G Tablet General] fosser2:
thanks herbert1 for the modified version of BlueGPS. It is working perfectly on CM (newest nightly). I did try it on Honeycomb and I could not get it working. I will try it again later tonight with rajeevvp's permission fix. I did need to use the permission fix to get it running on 2.3.4. I can't wait to see what the future has in store for this project!

EDIT: For the heck of it I tried to use MrGuy's gps program for the Adam. After running rajeevvp's permission fix it worked flawlessly. At the moment I'm not sure what program would be better to use? They both do the exact same thing, except for herbert1's has some more complex options and debugging options.

EDIT2: Tutorial updated.

EDIT3: Ok, I retried this program on honeycomb and it is still not working.

It seems like it should be working properly but again the permissions are not properly set. Here is what I get when I do a permission verification check.

/ $ ls -l /dev/ttyHS3
crw------- 1 root root 251, 3 Jul 3 02:21 /dev/ttyHS3

GPS does produce valid NMEA data when doing a "cat /dev/ttyHS3" command.
[G Tablet General] rajeevvp:
You can use either program, but, consider using herbert1's modified BlueGPS app for these reasons:

1. Open source.

2. Hosted on SourceForge--which means the source is version controlled, and, inspectable by everyone.

3. Herbert1 has a bug-tracker, and, he fixes bugs that're reported.

This is why I stay away from other ROMs even though some of them are very nice--they're not very developer-friendly.

OK, as a temporary fix, do a "chmod 666 /dev/ttyHS3" right after you boot and before you run the BlueGPS / MrGuy's GPS app.

The permanent fix is to add a chmod command into one of the /init*rc files--which means modifying the boot image. I'll do that too in my "official GPS fix" zip file. For now, send me the output of this command:

$ su
# /system/xbin/ls -lR /system/etc | tee /mnt/sdcard/ls-lR.txt

I want to see if we can insert the chmod command into one of the shell scripts (if there are any) or one of the *.rc files.
[G Tablet General] rajeevvp:
Nuts! There're no scripting hooks there at all! Looks like we'll have to modify one of the /init*rc files on Honeycomb. Give me the output of:

$ su
# ls -l /

No need. I've already decided that I'll eventually have to modify the boot image on both Gingerbread and Honeycomb.
[G Tablet General] rajeevvp:
If that last ls -l output is from a Honeycomb ROM, then send me these files as an attachment: /init.rc, /init.nvidia.rc

Gingerbread ROMs I can handle and we know how to get the GPS working on them. It is HC that we need to fix now. Load up a HC ROM so I can look at those 2 rc files above.
[G Tablet General] fosser2:
The last ls -l is from the newest CM nightly build. Sorry about the confusion.

EDIT: loading honeycomb now.

EDIT 2: Ok honeycomb is loaded. Attached is the init.rc file, but I could not find the init.nvidia.rc file anywhere. I did a search via root explorer and it is nowhere to be found.

EDIT 3: Did you get the gingerbread "official" method working then? If so you should totally post those files.
[G Tablet General] rajeevvp:
Send whatever *.rc you can find in /.

Yeah, I'm in the process of figuring out how to modify the /init*.rc files through the installable zip file, but, the changes I make don't seem to stick for some reason. Plus, the appropriate changes need to made in different files on different ROMs, namely:

Your Honeycomb ROM: /init.rc

CM-7.0.3: /init.harmony.rc

CM-RC1: /init.nvidia.rc

It's a right old mess at the moment!
[G Tablet General] fosser2:
Here you go. There was 3 .rc files in /

EDIT: You are basically trying to recompile the boot.img file correct? Have you been able to get the file with the changed *.rc files to compile properly? Also if you give me the files I will try to add them and then use root explorer to edit the .rc files. Have you tried something like that?
[G Tablet General] rajeevvp:
Thanks. I just hope that the other ROMs are reasonably similar. I'll download a few of the most popular ones, unpack the boot image and have a quick look-see.

Gotta go--check this thread tomorrow morning.
[G Tablet General] herbert1:
Hi

I've made a few modifications:

- verify and change access rights on device file (ako /dev/ttyHS3)

- start/stop GPS device (i.e. "echo -n 1 > /sys/devices/platform/gps_control/enable")

Can you perform some testing in order to see what works or not ?

Herbert

PS: where do you want me to share the source code (GitHub/Google code/sourceforge) ?

I would also need new name and icons for the project. Any idea ?

Important remark : this version doesn't work !

Use 1st alpha version instead (http://xdaforums.com/showpost.php?p=15236978&postcount=337)
[G Tablet General] fosser2:
Herbert,

I took a quick look at the program already and the first thing that I noticed when I pressed Start/Stop GPS is that the echo command did not kick in properly. I have no idea why. It would "start" then say could not connect to GPS device. I also tried running the line "chmod 666 /dev/ttyHS3" before starting the program and GPS still did not activate. I'm not exactly sure whats going wrong... As for the source code, use sourceforge I guess (or wait and see what rajeevvp has to say).

EDIT: I just tried starting the GPS via the echo command manually then clicking the Start/Stop GPS check box. The internal GPS shut off. I can tell this via the indicator light. So it does look like your program is doing something :p (I am running BOS 6.0 at the moment)

EDIT2: As for the icon, I like the one that you have for bluetooth4droid but if you were to take the "B" for bluetooth out and put in a little chip that was completely white filled i think it would look neat. Just a thought

EDIT3: Here's a really quick attempt with my not so amazing photoshop skills :p

EDIT4: Ok to recap. Beta1 of your program did work properly. It did take some steps to get working.

SideLoad APK File

Type

chmod 666 /dev/ttyHS3

into terminal as a superuser. Do this directly after a reboot.

Type

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

into terminal window as superuser again.

Wait for a bit to ensure GPS has a lock

Run Beta1 of Herbert1's GPS program

Click Start

Google Maps should have proper location now showing up.

As for a name of the project, I have no idea. G-tablet Internal GPS Project or something. I couldn't think of anything clever.
[G Tablet General] herbert1:
Just a few questions:

1) Can you show me the access properties for the file /sys/devices/platform/gps_control/enable ? It's just to verify if everyone can write it or not...

ls -l /sys/devices/platform/gps_control/enable

2) To enable/stop the GPS which commands are working? The 1st one, the 2nd one or both?

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

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

3) In order to get it working have you first to start the gps (echo command) and then the app or can you also get it working if you start 1st the app and afterwards the gps (using the echo command)?

4) If you could also give me a copy of the logcat output, it would help me(really).
[G Tablet General] rajeevvp:
fosser2: can you send me a "cat /dev/ttyHS3 | tee /mnt/sdcard/nmea.txt" output?

I need two files: One containing the NMEA strings produced when the GPS is acquiring satellite lock (cold-start) and the other after its got full satellite lock. In both cases, Maps, or whatever, should finally be able to display your location.

I'll send ya a screenshot of my gTablet working with my fake GPS device using the official method after you do.
[G Tablet General] fosser2:
For sure, give me 5 min. I'll post it right here.

Here is the cold start. I turned off my tablet, turned it back on; then did the echo command. It locked very fast so there will be some normal data in there as well.

Here is also the locked satellite file. NMEA2.txt.
[G Tablet General] rajeevvp:
To enable GPS just open the file /sys/devices/platform/gps_control/enable and write an ASCII '1' character into it. To disable GPS open it again and write a single ASCII '0'.

Ideally, you should be writing a '1' when the calling app (Maps, Navigation, whatever) gets focus, and writing a '0' when the calling app gets backgrounded or exits. This is to save battery and this is also where I got stuck with my poor Java skills. I couldn't figure out how to get Android to tell me when the client app had backgrounded/foregrounded.

Android has (or, should have) full control over the GPS device--meaning its GPS subsystem (or your InternalGPS4Gtab) decides when to enable/disable the GPS. When a location fix is required, GPS is enabled by writing a '1' into the control file and then the NMEA strings are read from /dev/ttyHS3. When it is not--to save battery--a '0' is written into the control file which shuts off the GPS and then no data can be read from /dev/ttyHS3.
[G Tablet General] rajeevvp:
Alright--screenshot of GPS Status attached.

Will package things up now.

PS. fosser2, As the screenshot shows, at 19:35:03 UTC, GPS status displays 0 fixes and 12 satellites in view. Are you sure you got fixes?
[G Tablet General] fosser2:
Ya, I had at least 1 fix for sure. I guess when I try this program in just a sec we'll know for sure. The LED indicator light was blinking like it was fixed when I did the "locked" test. I can't wait to try this out! Pack it up quick :p
[G Tablet General] rajeevvp:
Google Navigation works--screenshot attached.
[G Tablet General] herbert1:
Thank you fosser2, it helped me a lot!

Yes, it's what I've tried to do in the 2nd alpha version. But as it didn't work, I needed to verify everything and obtain a little more informations...

Normally we shall be able to start and stop everything with the app, but not to stop/start the GPS when the client app (Maps, Navigation, whatever) gets backgrounded/foregrounded. The Google API simply don't give us enough informations for that!

I've understand that. The problem is: when you starts the GPS replacement app, it creates a mock location provider which can replace the internal GPS. In this case it disables the android management of the GPS.

Why I need to know for our app, is if I can enable the mock locations provider before I start the GPS or if I have to start the GPS first and only after that to replace the buggy GPS provider with the mock location provider. The 1st alternative would be easier for me.

According to fosser2 the second alternative is working (starting GPS device using echo command and then starting GPS replacement app - 1st alpha version). What I hope is that the inverse is also working: starting GPS replacement app (1st alpha version) and then starting GPS device (using echo command).
[G Tablet General] herbert1:
There is at least one fix in the first file

$GPGGA,192533.766,4416.1034,N,08825.3128,W,1,03,3.4,249.1,M,-34.5,M,,0000*6D
$GPRMC,192533.766,A,4416.1034,N,08825.3128,W,3.32,346.27,040711,,,A*7F

and many in the second one...
[G Tablet General] rajeevvp:
Andrew: Google Maps also works--I just had to go to Settings > Applications and clear its data. Screenshot attached.

Setting up the Mock location provider before enabling/disabling GPS should work--and that is also what's correct. Since we're effectively disabling Android's internal GPS with our own we should be in control--ie. Android should close the GPS serial port and not read anything from it. On Gingerbread and Honeycomb, since the internal serial-port GPS is not working anyway, the program that normally reads from /dev/ttyHS3, /system/bin/system_server, will not have that port open or be using it at all. We've already checked this--see some of the previous posts where we've done a "fuser /dev/ttyHS3" command and not seen anything having that port open on GB.

I'll send you my gps-fake program in half-an-hour or so. I'm just typing up the README.txt file for it.
[G Tablet General] fosser2:
I can't wait to try this out! And I'm glad that Maps is also working. I was kinda wondering why you thought I didn't have a fix. I'm glad that is sorted through now!

EDIT: ps the location is defonitly right that the screenshots are showing :p