GPS Tether via USB with simultaneously tethering Internet via Ad-hoc WiFi

587 posts
Thanks Meter: 76
By cj chitwood, Senior Member on 26th January 2011, 05:09 AM
Post Reply Email Thread
I have searched several times, usually while on the road, so only now and then, but all total I must have searched for weeks worth of days trying to find an answer.

I found one.

What I wanted to do was take my T-Mobile G1's GPS receiver AND its Internet connection and forward both of these on to my laptop running Windows XP. I really would prefer a Linux solution, and I found one, but while in Linux my needs change slightly enough that the solution I found wasn't worth trying at that time. So I used Windows. As will most other people reading this, so.... >shrug<

I know it's not a very popular topic (not that it's non-popular; it's just that most people don't care enough to worry about it). However, that said, I know some poor pleb is out there trying to do exactly the same thing I found out how to do with exactly the same hardware and software, so I wanted to post how I did it.

MODS: I've not found anything detailing specifically this method on XDA and I did search before, but Google and I have been having communication problems in our relationship so I haven't been as proficient with results as usual. Therefore, if this has already been posted by someone else somewhere else, please forgive me, and feel free to pop a link in here, or merge, or whatever is appropriate. -- Thanks.



Rooted phone. which will require...
A computer with a USB port AND a WiFi device of some kind.

Install on the computer:
* the Android SDK
* com0com
* com2tcp - Which MIGHT be included in com0com, I don't remember.
* Something to use it with (Google Earth, for instance)

And on the phone, install the following:
* Android-Wifi-Tether (WiFi Tether for Root Users)
* ShareGPS <-- Just a link to a page with a QR code. The dev's page says to get it from Android Market.

That's a lot of stuff, but if you NEED this, it's worth it.

First and foremost, get ADB working. Beyond the scope of this post, go to Google for more info on doing this. Make sure, though, that your phone's debugging is enabled (Menu > Settings > Applications > Development).

Once ADB works, install the software above in the appropriate places. For com2tcp, put its executable file somewhere in the system path. I used c:\windows\system32 for it (and for ADB, come to think of it) but many people might balk at this, as though it's some holy ground on which lowly mortal files shalt not tread. Whatever. Find a hole it'll fit in and make sure it's in your system path.

After installing ALL of the above software, do this, in this order:

1) Connect the phone to the laptop via USB.

2) Open com0com from your start menu.
3) Either remember these names for the com ports (at the top of the com0com window) OR name them more memorably. I'll use COM1 and COM2, but ONLY BECAUSE MY LAPTOP DOESN'T ALREADY HAVE THESE TWO PORTS. You can call them PORT1 and PORT2 if you want, or CHUNKY1 and CHEWY234 but I used COM1 and COM2. So, the rest of these instructions will be the way I did it -- you'll have to adjust them accordingly, and if you're not smart enough to figure out how to do so or what I mean by that, then I can't help you. After naming them, hit APPLY.
3b) On your first time running com0com, it'll want you to install new devices, twice. LET IT. Just let it do the automatic thing and you'll be fine.
4) Open the command prompt (Windowkey-R, "cmd", ENTER) (or Start, Programs, Accessories, Command Prompt).
5) In the command prompt, type in:
     adb forward tcp:50000 tcp:50000
and hit enter. This creates the forwarding of the phone's internal communications to the USB (I think). Assuming there are no errors (if there are, you either did something wrong or you did something wrong (like getting ADB working)) then type in the following
     com2tcp --telnet \\.\COM1 50000
and hit enter. This uses the above-created forward of comms and attaches it to the virtual COM port made with com0com in step 3. This time, assuming there are no errors, you should see some diagnostic output.

6) Open ShareGPS.
6b) In ShareGPS, Menu > Settings, select Use USB and deselect Use Bluetooth. The Format is irrelevant to what we're doing, and Create NMEA is not needed for the HTC Dream hardware as the output already is in NMEA format AFAICT. Back out of the settings screen.

7) Tether your Internet connection. OPTIONAL: If your laptop already has Internet access somehow else, you can ignore this step.

8) Open and connect your mapping application on the laptop. YMMV, depends on your software, I can't help you here. In Google Earth, go to Tools, GPS, and click the REALTIME tab. Select NMEA, not Garmin. Select other options as appropriate (like auto follow). Hit start. You should, if it works, see diagnostic output in your command prompt window as well as a connection message on the phone in ShareGPS. In Google Earth, YMMV, but I at first saw no icon, and second I saw a little blue dot. Problem is, in GE, it quickly disconnects and reconnects. You might have better luck with GooPs Free.

If you use GooPs Free, it might not pop up in front. Look down in your system tray, and you'll find the GooPs icon. Right-click it, and select "Open GooPs". you'll be presented a small window. Click options. For the COM port, use one of the two that you made with com0com (if one doesn't work, try the other). Default rate worked for me, Hardware flow control. Autoconnect, Autoscan are set for me. The rest of the options should be pretty self-explanatory. If not, I can't help you (it's midnight here and I'm oh so tired right now) (but I REALLY wanted to get this posted to help anyone else). IF everything works, you'll have an obnoxiously large 3D arrowhead right where you are in Google Earth. If not, you'll have to troubleshoot the errors.


Feel free to ask questions in reply, as I'll of course subscribe to this thread, but understand that I can't answer all questions as I barely understand enough to get this working myself.

ALSO, KNOW THIS: YOUR PHONE WILL BECOME LESS STABLE. I noticed a significant increase of unprompted reboots of my phone after futzing with these programs. Sometimes it lasted a few minutes, but usually it goes for hours. Further, they don't seem to be an issue until I start GPS tethering, so maybe it's not so bad.

You CANNOT use GPS Tether and USB Internet Tether at the same time. If you need to tether your phone's Internet, install WiFi Tether for Root Users (link above) and set it up accordingly. You should be able to launch WiFi tether at any time, but I would recommend doing it before forwarding the ADB GPS ports.

I do sincerely hope this helps someone, and if not, hopefully it will save time and not waste it.

Best Regards to All

Edits below:


The Following 3 Users Say Thank You to cj chitwood For This Useful Post: [ View ] Gift cj chitwood Ad-Free
2nd May 2011, 10:05 AM |#2  
Junior Member
Flag Chennai
Thanks Meter: 0
How to in Linux
I am using an Ubuntu desktop...and might am interested in knowing hw to do it in Linux?
3rd May 2011, 12:25 AM |#3  
OP Senior Member
Flag Cowford, FL - Blackview BV9500 Pro
Thanks Meter: 76
I wish I could help with that. While I use Linux too (Ubuntu, I think, on my laptop and Sabayon on my desktop), and used to use it as my primary OS, I do not know enough about it to do this. For starters, I've never gotten a decent working load of Google Earth on my laptop in Linux. When I was researching this, I found that 99% of what I found was based in Windows, and I was short on time so trying things in Linux was an unaffordable luxury. Everything takes me forever in Linux because I have to learn it first, and then start screwing with it.

For starters, though, you have to get ADB working, and then port forwarding the GPS to the phone's USB (done through ADB). From that point, I think Linux might *just* be able to handle getting the data visible to apps like Google Earth natively. I would start my search with "usb-to-telnet forwarding". Or "accessing USB with telnet", since really once you do the ADB forward, the phone is sending data direct to the USB port.

Edit: Of course, you'll also still need ShareGPS on the phone... I think...

I really don't know enough though to be able to provide the help I'm thinking you need/want, but hopefully this can at least get you started on the right track. If you figure it out, please post back to this thread...


CJ Chitwood
26th May 2011, 07:12 PM |#4  
Thanks Meter: 1
Linux Solutions???
I am going to dive into getting this working with Ubuntu on my EeePC. Right off the bat I'm thinking why not send the GPS to the netbook over bluetooth and use use the USB tether for the internet access? I'll see what my untrained brain can come up with.
Thanks for the post on this issue, I've been looking into this for 2 years.
26th May 2011, 08:44 PM |#5  
OP Senior Member
Flag Cowford, FL - Blackview BV9500 Pro
Thanks Meter: 76
Right, that should work if your Asus can receive GPS over bluetooth, and the USB tether for internet would save you a little on battery as you could kill the WiFi on both devices. My only problem was that my laptop did not have a bluetooth transceiver on it, so I was stuck doing it the bobo way. Story of my life, really

Glad it helped!
5th August 2011, 01:49 AM |#6  
Senior Member
Flag Rotterdam
Thanks Meter: 30
Thank you for this guide, I used some other applications though.

For my HD2 (running on Android 2.3.5) I used BlueNMEA, you can get it from the Android Market

I connected my phone with my laptop (running Win. 7), installed SDK and used ADB).

With ADB I used the commands from the BlueNMEA guide:
Using BlueNMEA over USB

Needs the Android SDK.

Connect your phone to a computer with the USB data cable.  On the
computer, type "adb forward tcp:4352 tcp:4352".  Now you can get NMEA
data by connecting to TCP 4352 on your computer.
For virtual ports I used HW VSP, quite simple to setup, I used COM9, typed as address and the port 4352. It creates a service so this is a 1 time job.

At first I used GPSGate, but this didn't work with BlueNMEA.
GPSGate works with ShareGPS, same principle I guess.

For testing my GPS on my laptop I use OpenCPN, it shows my location perfectly.
The phone is also very stable, no problems at all.

The internet part doesn't concern me, because I have internet at my laptop :).

I've been searching for a method to use my Android as a GPS mouse and I found this, thought I'd share my findings with you.
The fastest way to do this is via Bluetooth I think, but my laptop has no Bluetooth, ordered one @ Ebay for 5$, hope this saves me all the hassle.

The only thing I'm wondering, since I'm not familiar with Android SDK, is the ADB forwarding still alive after a reboot?

BTW, for people still searching for a Linux guide:
The Following 2 Users Say Thank You to Fietspomp For This Useful Post: [ View ] Gift Fietspomp Ad-Free
5th August 2011, 03:40 AM |#7  
OP Senior Member
Flag Cowford, FL - Blackview BV9500 Pro
Thanks Meter: 76
Thank you very much for that! Nicely informative.

AFAIK, the adb forward is gone after a phone reboot. However, I've never actually tested it. I've also not looked for a way to undo it...
The Following User Says Thank You to cj chitwood For This Useful Post: [ View ] Gift cj chitwood Ad-Free
5th August 2011, 09:36 AM |#8  
Senior Member
Flag Rotterdam
Thanks Meter: 30
Originally Posted by cj chitwood

Thank you very much for that! Nicely informative.

AFAIK, the adb forward is gone after a phone reboot. However, I've never actually tested it. I've also not looked for a way to undo it...

I've fooled around a bit with the phone, every time I disconnect/connect I have to forward the port using ADB, ow well, I'll use Bluetooth as soon as I have my dongle.

The best part is this works, so I'm sure it will also work with Bluetooth.
I know for Windows Mobile it is possible to tether GPS through activesync,
which I used for my HD2 when it was stock Windows Mobile.

I use this when I'm at sea, I'm a sailor so it's nice to track my course.
Post Reply Subscribe to Thread

google earth, gps, gps tether, gps usb, usb

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes