• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

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

Search This thread

strictlyrude27

Senior Member
Jan 12, 2010
551
451
Seattle, WA
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 [color="red"] still needs testing[/color]
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 :D :D :D
 

Attachments

  • Vibrant_CM7_GPSFix_V1.5.1-CWM-newgpsd-signed.zip
    445.3 KB · Views: 16,646
  • Vibrant_CM7_GPSFix_V1.5.1-CWM-nogpsd-signed.zip
    126.9 KB · Views: 2,718
  • Vibrant_CM7_GPSFix_V1.5.1-CWM-signed.zip
    466.4 KB · Views: 5,853
  • Vibrant_CM7_GPSFix_V1.5.1-Script.zip
    418 KB · Views: 73,309
Last edited:

strictlyrude27

Senior Member
Jan 12, 2010
551
451
Seattle, WA
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 :eek::eek::eek:
 
Last edited:

svladimir

Senior Member
Oct 22, 2010
132
9
Brisbane
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.
 

ferhanmm

Senior Member
Oct 10, 2010
663
115
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 :eek::eek::eek:


You need to add "su" to the first line of your installation instructions
 
  • Like
Reactions: strictlyrude27

strictlyrude27

Senior Member
Jan 12, 2010
551
451
Seattle, WA
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.

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:

serendipityguy

Senior Member
Oct 9, 2010
1,219
500
Sunny, CA
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. :rolleyes:

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:
  • Like
Reactions: elsocplayer

strictlyrude27

Senior Member
Jan 12, 2010
551
451
Seattle, WA
Dear all -

V1.2CWM released! As requested, a CWM flashable zip has been created. It does literally the exact same thing as V1.2 (copies over the GPS files to the right locations, sets 0755 permissions on all files). You don't need to flash if you've already installed V1.2, but I would keep the zip on hand for when you decide to flash a new nightly.

As always, the Thanks button lets me know I'm loved :cool::cool::cool:

I plan on starting a gpsd database, seems that while all gpsd's are created equal, some are more equal than others :p so you can mix and match the gpsd from a previous nightly, rather than referring to the supermassive black hole that is the official CM7 Nightly thread.

And finally, I must point out that I did NOT create these fixes. All the credit and praise belongs to jwleonhart and roffee. I just packaged up their work into an easy-to-install package, those guys did the real work! Please find their threads in the Credits section of my OP and hit the Thanks button!
 
Last edited:

beren28

Senior Member
Jul 26, 2010
403
151
^ try getting astro, go to preferences and allow internet downloads.

Also, chrome to phone is amazing :)

I already did the astro thing.
Turned it on and off several times.

And I used chrome to phone to send the link, with the same result.

I swtiched over to Opera, and that eventually agreed to download it.
 

strictlyrude27

Senior Member
Jan 12, 2010
551
451
Seattle, WA
OP updated. I now offer a no-gpsd version of the CWM flashable, in case you want to keep your gpsd or mix and match with other nightlys. I'll put up a link to a Dropbox to store GPS drivers from every nightly.

Ironically, the fix used to work for me 100% of the time, but not anymore. I'm going to start experimenting with new gpsd's from CM7 nightlies; please also let me know of your own results!

EDIT: I wasn't getting locks, or was getting and losing locks with my fix. Tried #72 gpsd and the nogpsd flash.. 0/8 birds after 5 minutes. Reflashed my own fix. TTFF [time to first fix] 17 seconds, 7/10 satellites, 150 ft accuracy. After 1 minute, 20 foot accuracy. Rebooted. 0/10 after 5 minutes.

I wish I understood you, GPS. I wish I understood you.
 
Last edited:

S1Cool

Member
Sep 29, 2008
26
1
very nice.. i tried right now..
before this, its takes serveral minutes to get a lock.
after this patch.
first 30 secs, In View 12 satts.
1 min, get in USE 4 satts, 25 meters accuracy.
2 min, get 6 satts, 7 meters accuracy.

Very fast!

Thanks!:D
 

Dattack

Senior Member
Dec 14, 2010
600
42
This works but great the first day but
GPS seems to not even lock in the next day.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 82
    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 [color="red"] still needs testing[/color]
    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 :D :D :D
    7
    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 :eek::eek::eek:
    6
    Dear all -

    V1.2CWM released! As requested, a CWM flashable zip has been created. It does literally the exact same thing as V1.2 (copies over the GPS files to the right locations, sets 0755 permissions on all files). You don't need to flash if you've already installed V1.2, but I would keep the zip on hand for when you decide to flash a new nightly.

    As always, the Thanks button lets me know I'm loved :cool::cool::cool:

    I plan on starting a gpsd database, seems that while all gpsd's are created equal, some are more equal than others :p so you can mix and match the gpsd from a previous nightly, rather than referring to the supermassive black hole that is the official CM7 Nightly thread.

    And finally, I must point out that I did NOT create these fixes. All the credit and praise belongs to jwleonhart and roffee. I just packaged up their work into an easy-to-install package, those guys did the real work! Please find their threads in the Credits section of my OP and hit the Thanks button!
    3
    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.
    2
    I'll try no agpsd and see how that goes.

    I don't have the file you reference. What is it, and could you please PM me with a link to download?

    Sent from my SGH-T959 using XDA App

    LTO.dat is Long Term Orbit Data. As far as I can tell, the CM7 on the vibrant doesn't do AGPS.

    http://www.broadcom.com/collateral/tb/LTO-TB100-R.pdf

    I've attached a shell script that will download the lto data.

    I had merged this into gerrit for CM7 (Nightly 62), but I don't think it got merged properly.

    John