5,605,187 Members 37,999 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
strictlyrude27
Old
(Last edited by strictlyrude27; 26th September 2011 at 02:58 AM.)
#1  
Senior Member - OP
Thanks Meter 395
Posts: 540
Join Date: Jan 2010
Location: Seattle, WA

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

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
The Following 81 Users Say Thank You to strictlyrude27 For This Useful Post: [ Click to Expand ]
 
gamikzone
Old
#2  
gamikzone's Avatar
Senior Member
Thanks Meter 80
Posts: 1,093
Join Date: Jun 2008
Location: Somewhere In Ohio
im about to try this
 
strictlyrude27
Old
(Last edited by strictlyrude27; 3rd August 2011 at 06:42 AM.)
#3  
Senior Member - OP
Thanks Meter 395
Posts: 540
Join Date: Jan 2010
Location: Seattle, WA

 
DONATE TO ME
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
The Following 7 Users Say Thank You to strictlyrude27 For This Useful Post: [ Click to Expand ]
 
chuotcontodung
Old
#4  
Junior Member
Thanks Meter 0
Posts: 6
Join Date: Oct 2010
do they work with MIUI ?
 
strictlyrude27
Old
#5  
Senior Member - OP
Thanks Meter 395
Posts: 540
Join Date: Jan 2010
Location: Seattle, WA

 
DONATE TO ME
Quote:
Originally Posted by chuotcontodung View Post
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.
 
svladimir
Old
#6  
Senior Member
Thanks Meter 10
Posts: 119
Join Date: Oct 2010
Location: 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
Old
#7  
ferhanmm's Avatar
Senior Member
Thanks Meter 112
Posts: 663
Join Date: Oct 2010
Quote:
Originally Posted by strictlyrude27 View Post
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
Nexus 5 / Nexus 4 / Samsung Vibrant
The Following User Says Thank You to ferhanmm For This Useful Post: [ Click to Expand ]
 
strictlyrude27
Old
(Last edited by strictlyrude27; 3rd August 2011 at 06:46 AM.)
#8  
Senior Member - OP
Thanks Meter 395
Posts: 540
Join Date: Jan 2010
Location: Seattle, WA

 
DONATE TO ME
Quote:
Originally Posted by ferhanmm View Post
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 View Post
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.
 
ferhanmm
Old
#9  
ferhanmm's Avatar
Senior Member
Thanks Meter 112
Posts: 663
Join Date: Oct 2010
Quote:
Originally Posted by strictlyrude27 View Post
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
Nexus 5 / Nexus 4 / Samsung Vibrant
 
strictlyrude27
Old
#10  
Senior Member - OP
Thanks Meter 395
Posts: 540
Join Date: Jan 2010
Location: Seattle, WA

 
DONATE TO ME
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: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes