Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP strictlyrude27

3rd August 2011, 02:37 AM   |  #1  
OP Senior Member
Flag Seattle, WA
Thanks Meter: 412
 
546 posts
Join Date:Joined: Jan 2010
Donate to Me
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 03:58 AM.
The Following 81 Users Say Thank You to strictlyrude27 For This Useful Post: [ View ]
3rd August 2011, 06:12 AM   |  #2  
gamikzone's Avatar
Senior Member
Flag Somewhere In Ohio
Thanks Meter: 81
 
1,094 posts
Join Date:Joined: Jun 2008
More
im about to try this
3rd August 2011, 07:28 AM   |  #3  
OP Senior Member
Flag Seattle, WA
Thanks Meter: 412
 
546 posts
Join Date:Joined: Jan 2010
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
Last edited by strictlyrude27; 3rd August 2011 at 07:42 AM.
The Following 7 Users Say Thank You to strictlyrude27 For This Useful Post: [ View ]
3rd August 2011, 07:29 AM   |  #4  
Junior Member
Thanks Meter: 0
 
6 posts
Join Date:Joined: Oct 2010
do they work with MIUI ?
3rd August 2011, 07:32 AM   |  #5  
OP Senior Member
Flag Seattle, WA
Thanks Meter: 412
 
546 posts
Join Date:Joined: Jan 2010
Donate to Me
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, 07:39 AM   |  #6  
Senior Member
Flag Brisbane
Thanks Meter: 10
 
126 posts
Join Date:Joined: Oct 2010
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, 07:41 AM   |  #7  
ferhanmm's Avatar
Senior Member
Thanks Meter: 114
 
663 posts
Join Date:Joined: Oct 2010
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, 07:42 AM   |  #8  
OP Senior Member
Flag Seattle, WA
Thanks Meter: 412
 
546 posts
Join Date:Joined: Jan 2010
Donate to Me
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 07:46 AM.
3rd August 2011, 07:47 AM   |  #9  
ferhanmm's Avatar
Senior Member
Thanks Meter: 114
 
663 posts
Join Date:Joined: Oct 2010
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, 08:31 AM   |  #10  
OP Senior Member
Flag Seattle, WA
Thanks Meter: 412
 
546 posts
Join Date:Joined: Jan 2010
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: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes