FORUMS

New Xposed for Lollipop 5.0 Update Fixes Major Bugs

Senior Recognized Developer rovo89 has patched Xposed for Lollipop 5.0 to … more

Download Sony’s new AOSP-like concept for Xperia Z3

Over in our forums, Recognized Contributor Jozinek has posted a very … more

OnePlus 2 vs Moto X Style: Which is The Better Flagship?

Two big industry names have announced their newest flagship phones within the … more

Making Your Own Xposed Modules Is Easier Than You Think

Close to the heart of XDA is the Xposed Framework by Rovo89. Most of … more

[CM7][OMFGB]Software GPS Fix | V1.5.1 - 9/25/11 | Keep the (GPS) lights on!

550 posts
Thanks Meter: 428
 
By strictlyrude27, Senior Member on 3rd August 2011, 01:37 AM
Post Reply Subscribe to Thread Email Thread
Hi all -

I wrote a script and created a CWM update-flashable to perform a one-line install of the CM7 GPS Fix, documented here by jwleonhart. There were some complaints about jwleonhart's install instructions; it's a bit cumbersome and not trouble-free, especially for noobs. Please read the original thread for detailed instructions on what my script does; the script exactly does jwleonhart's instructions.

NOTE: EVERY VERSION OF THIS FIX MAKES SUBTLE BUT IMPORTANT CHANGES THAT MAY IMPROVE OR DEPRESS YOUR GPS FUNCTIONALITY. UNTIL A TRUE GPS DRIVER DROPS FOR THE VIBRANT (which at this point seems very unlikely) ALL WE CAN DO IS HACK AND TWEAK. NEWER VERSIONS MAY WORK BETTER OR WORSE THAN OLDER ONES! PLEASE POST WITH YOUR EXPERIENCE USING THE VARIOUS VERSIONS OF THE FIX, AND PLEASE BE CONSTRUCTIVE/HELPFUL WITH YOUR FINDINGS!

There are three separate ways to install: CWM, CWM with no gpsd, and via shell script.

CWM Installation
The easiest way to install the GPSFix files is to download and flash Vibrant_CM7_GPSFix_V1.4-CWM-signed.zip. All files will be copied over and read/execute permissions will be properly set.

NOTE: Flashable does NOT contain AngryGPS. There are some people who have better results without it, so I'll let you install that one on your own. You can find the APK at jwleonhart's CM7 Install Guide.

OPTIONAL: There's a no-gpsd version of the CWM flashable as well - if you want to use the gpsd from your current nightly, or mix and match. The GPS driver might get better in time, and who knows if down the line the gpsd bundled with the latest nightly is better than this one, pulled from Trigger Redux#13 (CM7 Nightly#54).

Script Installation
The script is available for users who want to customize their own GPS fix. It requires an extra reboot (since you can't just run the script after installing a new nightly), but you can easily add/remove files to the script to suit your own needs. Personally, I use the script to test new versions before they go into the CWM flashable.

Attached is the zip file with all the files and the shell script you need. Just extract the folder to your SD card; then in a terminal (ADB or terminal emulator with root), run these commands:

Code:
su # if you're not already dropped into superuser status
cd /sdcard/GPSFix
bash GPSFix.sh
It will automatically copy all the files (gpsd, secgps.conf, gps.conf, 90getgps_lto) to the right places, then set permissions those files, then reboot. AngryGPSmod.apk is in there but is not installed; I suggest try the GPS fix without AngryGPS first, then install it after if you don't get good results.

Script Contents

For those interested, here's the contents of the script..
Code:
#!/system/xbin/bash

FIXFILES="/system/etc/gps.conf
/etc/init.d/90getgps_lto
/system/vendor/bin/gpsd"

REMOVEONLY="/data/gps/lto.dat
/data/gps/lto2.dat
/data/gps/svstatus.txt
/data/gps/ltoStatus.txt
/data/gps/secgps.conf
/system/bin/agpsd"

mount -o rw,remount /system

echo "==================================================="
echo "======Vibrant CM7 GPS Fix One-Command Install======"
echo "=================by strictlyrude27================="
echo ""

# Delete previous fix files
echo "Deleting previous fix files..."
for file in $FIXFILES $REMOVEONLY
do
    if [ -f $file ]; then
        rm $file
    fi
done

# Copy new files and set permissions
echo "Copying new files over..."
for file in $FIXFILES
do
    fname=$(basename $file)
    cp $fname $file
    chmod 0755 $file

    if [ $file == "/system/vendor/bin/gpsd" ]; then
        chgrp shell $file
    fi
done

echo "Rebooting device.. Enjoy GPS!"
echo "Install AngryGPSmod.apk manually if you want to."
echo ""
reboot
Credits
jwleonhart - writing up the CM7 install guide
roffee - finding the original GPS Fix for CM7
jad3675 - providing original Long Term Orbital download script

PLEASE go to their threads and hit their Thanks button. They did all the heavy lifting, I just packaged up their findings and work into a simple-to-use flashable.

"If I have seen far, it is because I have stood on the shoulders of giants."
--Isaac Newton

Changelog:
Code:
V1.5.1
    -- renamed init-script to overwrite CM7's implementation of V3 of this fix
    -- now offering "newgpsd" variant - contains gpsd from latest CM7 nightly
            -- standard zip: faster locks, but more prone to randomly quitting working
            -- newgpsd variant: slower locks, but more resilient GPS indicator  still needs testing
V1.5 
    -- cleaned up script 
    -- now keeping LTO data named lto2.dat (used to rename to lto.dat)
    -- lowering threshold for lto2 refresh to 3 days
V1.4 (all variants)
    -- replaced lto.dat with lto2.dat - preliminary testing indicates survival after reboot and better TTFF
    -- now using us.pool.ntp.org for the time server - if you're not in the US, please adjust your gps.conf accordingly
    -- gps.conf tweaks - trading accuracy for TTFF for now..
V1.3.1 (all variants)
    --set permissions on downloaded lto.dat to 755 (was 644) - i couldn't get
      any birds in view before, now i can lock. give this a try if 1.3 doesn't work.
V1.3 (all variants)
    --removed agpsd
    --added 90getgps_lto - will fetch latest long term orbit data on boot
    --hopefully these changes help get REPEAT locks faster - please let us know!
V1.2CWM-nogpsd
    --same as V1.2CWM, but with no gpsd. This way you can use gpsd from
    the latest CM7 nightlies, or whatever nightly gpsd worked best for you. 
    I will start collecting gpsd files and posting them for your convenience soon!
V1.2CWM
    --created CWM flashable for your convenience! performs the EXACT SAME
    as the script, so if you've already run V1.2, no need to flash V1.2CWM.
    But, it could be useful if you tend to flash nightlies all the time.
V1.2
    --changed all file permissions to 0755 - not sure how reading .conf files 
    worked if there wasn't any read permission. gets me a faster lock after
    applying the script.
V1.1
    --fixed typo - "chmod shell" should have been "chgrp"
    --removed \t, \n - was not being interpreted by shell correctly
V1 
    --initial release
If I helped you with your CM7 experience, please hit the Thanks Button
Last edited by strictlyrude27; 26th September 2011 at 02:58 AM.
The Following 81 Users Say Thank You to strictlyrude27 For This Useful Post: [ View ]
 
 
3rd August 2011, 05:12 AM |#2  
gamikzone's Avatar
Senior Member
Flag Somewhere In Ohio
Thanks Meter: 82
 
More
im about to try this
3rd August 2011, 06:28 AM |#3  
OP Senior Member
Flag Seattle, WA
Thanks Meter: 428
 
Donate to Me
More
Dear all -

Script was updated to V1.2. I noticed that no read permissions were set to the .conf files; my thinking is there's no way Android could read those config files without read permissions, so they weren't even doing anything.

That said, the latest script now gives permission 0755 (rwxr-xr-x) to all files. After running the script now, I get a lock after first reboot in about 25 seconds.

You can download V1.2 and start from scratch, or just copy/paste the latest script contents into your GPSFix.sh. Or, run the following commands at a terminal (ADB or terminal emulator with root):

Code:
su
mount -o rw,remount /system
chmod 0755 /data/gps/secgps.conf
chmod 0755 /system/etc/gps.conf
chmod 0755 /system/bin/agpsd
mount -o ro,remount /system
reboot
Also, I noticed 31 downloads (and there were 20-some in the original post) but only a total of 3 Thanks.. I'm kind of addicted to the Thanks button and don't ask for donations otherwise, please push it if I help make a better CM7 experience for you
Last edited by strictlyrude27; 3rd August 2011 at 06:42 AM.
The Following 7 Users Say Thank You to strictlyrude27 For This Useful Post: [ View ]
3rd August 2011, 06:29 AM |#4  
Junior Member
Thanks Meter: 0
 
More
do they work with MIUI ?
3rd August 2011, 06:32 AM |#5  
OP Senior Member
Flag Seattle, WA
Thanks Meter: 428
 
Donate to Me
More
Quote:
Originally Posted by chuotcontodung

do they work with MIUI ?

Should work with any CM7-based ROM; I hope someone else can confirm, though; I only run vanilla CM7 and occasionally Trigger Redux.
3rd August 2011, 06:39 AM |#6  
Senior Member
Flag Brisbane
Thanks Meter: 10
 
More
Any chance to make it CWM-based ?
It'd be so much nicer to drop the zip into a SD root and just run it after every nighty installation.
3rd August 2011, 06:41 AM |#7  
ferhanmm's Avatar
Senior Member
Thanks Meter: 114
 
More
Quote:
Originally Posted by strictlyrude27

Dear all -

Script was updated to V1.2. I noticed that no read permissions were set to the .conf files; my thinking is there's no way Android could read those config files without read permissions, so they weren't even doing anything.

That said, the latest script now gives permission 0755 (rwxr-xr-x) to all files. After running the script now, I get a lock after first reboot in about 25 seconds.

You can download V1.2 and start from scratch, or just copy/paste the latest script contents into your GPSFix.sh. Or, run the following commands at a terminal (ADB or terminal emulator with root):

Code:
mount -o rw,remount /system
chmod 0755 /data/gps/secgps.conf
chmod 0755 /system/etc/gps.conf
chmod 0755 /system/bin/agpsd
mount -o ro,remount /system
reboot
Also, I noticed 31 downloads (and there were 20-some in the original post) but only a total of 3 Thanks.. I'm kind of addicted to the Thanks button and don't ask for donations otherwise, please push it if I help make a better CM7 experience for you


You need to add "su" to the first line of your installation instructions
The Following User Says Thank You to ferhanmm For This Useful Post: [ View ]
3rd August 2011, 06:42 AM |#8  
OP Senior Member
Flag Seattle, WA
Thanks Meter: 428
 
Donate to Me
More
Quote:
Originally Posted by ferhanmm

You need to add "su" to the first line of your installation instructions

I assumed you would be entering the terminal with root. I'll update that in the OP though, thanks.

Quote:
Originally Posted by svladimir

Any chance to make it CWM-based ?
It'd be so much nicer to drop the zip into a SD root and just run it after every nighty installation.

I don't know how to make an update.zip, but perhaps this will be a good time to learn! I'm way better at shell scripting which is why I went this route. I'll see what I can do, hopefully I can have a CWM flashable soon.. if anyone else can help me I would much appreciate it.

That said, note that you can still open an adb shell in recovery mode, so you could run the script after you flash the nightly. I haven't tried that, but I will soon.
Last edited by strictlyrude27; 3rd August 2011 at 06:46 AM.
3rd August 2011, 06:47 AM |#9  
ferhanmm's Avatar
Senior Member
Thanks Meter: 114
 
More
Quote:
Originally Posted by strictlyrude27

I assumed you would be entering the terminal with root. I'll update that in the OP though, thanks.

Lol yea but I guarantee you that if you didn't add it more than 20 people would ask
3rd August 2011, 07:31 AM |#10  
OP Senior Member
Flag Seattle, WA
Thanks Meter: 428
 
Donate to Me
More
It turns out making an update.zip isn't so hard after all testing it now, if it works out I'll upload to OP. I'll keep the original scripts and stuff for posterity's sake.
The Following 3 Users Say Thank You to strictlyrude27 For This Useful Post: [ View ]
3rd August 2011, 08:25 AM |#11  
serendipityguy's Avatar
Senior Member
Flag Pasadena, CA
Thanks Meter: 483
 
More
Thumbs up Great efforts, wow
This is just great piece of development, a sure and simple cure for the GPS and the CM 7+ roms.

Now that you have created this script, one so simple, there will be leages of Vibrant Users who will be able to take advantage of your generousity and put this puppy to work.

Kudos and once again, great work.... W.0.W.

I can confirm, with the AngryGPS I was able to lock in with fast lock in up to Accuracy of 20 feet, picked up 8 of the 12 satellites in view.

Thank you very, very much....
Last edited by serendipityguy; 3rd August 2011 at 08:50 AM.
The Following User Says Thank You to serendipityguy For This Useful Post: [ View ]

Read More
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes