[SOLVED] callibrate GSensor in Android and save the data - HD2 Android Q&A, Help & Troubleshooting and Genera

Tired of holding the phone straight and realize that your car is actually going left???
this is the solution: disable gsensor completely, then calibrate it, then re activate.
this is how its done:
download Gscript lite and create a new script:
mv /system/bin/akmd /system/bin/akmdw
killall akmd
name it as GSen off.
now activate your script when your phone is on the ground.
go and calibrate gsensor.
go back to GScript and type this as new script:
mv /system/bin/akmdw /system/bin/akmd
/system/bin/akmd
now activate and gsensor is calibrated.
(yes, you need to write /system/bin/akmd twice. once for the rename command and once for the run command)
enjoy driving as long as you dont get a touchscreen freeze.

Related

Accelereometer Issue After Updating to 5.0.6 from 5.0.5.3

My landscape orientation is slightly off, how to I reset the accelerometer, or clear the cache like some have suggested?
I thought my battery was running hot too so I ran Raging Thunder to see how much the graphics would raise the temperature. As I started driving I realized the car has a serious over-steer to the right. I have to have turn to the left just for it to drive straight.
Edit: I've tried the instructions here and it didn't work at : (http) ostebaronen.dk/fixing-accelerometer-on-htc-magic/
I'll just wipe and hope that fixes everything. :-/
Edit 2 (04/20/10): Solution found, see post #7 in this thread.
Edit 3 (04/20/10): Nevermind it did not work. I though it did failed to realize that my bubble level app was still calibrated to correct the misalignment. :/
do a full wipe then re flash the cyanogen rom again
Sent from my Nexus One using the XDA mobile application powered by Tapatalk
I wiped, tested- no change in orientation unalignment
reloaded teh 5.0.53 rom, tested- no change in orientation unalignment
wiped again
wiped rotation
wipe cache, tested- no change in orientation unalignment
wiped
restored nandroid, tested- no change in orientation unalignment
guess i'm out of luck perhaps it could be a hardware issue...
After research and using sensor testers from the marketplace, I believe the file I need to delete/reset is AK8973. In ADB SHELL, once I run the command "mount -o rw /dev/block/mtdblock5 /data" then I can go into "cd /data/misc." If I list the directory I see a file called ak8973prms.txt .
Based on the sensor testers, it always lists the values under ak8973 so I see the relation.
What is my next step? Do I delete the .txt? Can I at least make a backup first. It'd be nice to see what the contents of the file are. I tried the pull command and I can not seem to get a copy of it to my computer for the life of me. I've never used linux before but I learn quick I just don't know where to resource now.
Edit 2:08: I figured out how to the view the file with the more command. Here are the internals. I'm curious if this is the source of the missalignment but I'm not sure how to fix. My issue is that the AK8973 Orentation sensor Y axis (pitch) is negatively off by about 4 degrees. I'm not sure if this txt file is a recent snapshot or a guide to help calibrate.
adb shell
/ # cd data/misc
cd data/misc
/data/misc # ls
/data/misc # more AK8973Prms.txt
more AK8973Prms.txt
[AK8973]
HDOE_STATUS=1
HDOE_SUCTEMP=113
HDAC.x=1
HDAC.y=128
HDAC.z=7
HOFFSET.x=335
HOFFSET.y=-687
HOFFSET.z=-210
ASENSE.x=256
ASENSE.y=256
ASENSE.z=256
AOFFSET.x=0
AOFFSET.y=0
AOFFSET.z=0
/data/misc #
I was having this problem along with some others so I went back to 5053
I went back to other roms, including stock and the problem continues for me.
Ok so i finally found the fix, it was by overriding the AK8973Prms.txt with a blank file. I rooted a week ago and I'm so excited to have found this solution. Having a problem has forced me to learn some linux commands.
There may be a better way to do this, if so chime in but here are my caveman instructions.
Reboot your phone in Recovery mode (home+end/power > bootloader > recovery)
Connect via usb
Windows Start > Click Run > type CMD and press enter
Access your SDK tool folder with command: cd [file path]
adb shell
mount -o rw /dev/block/mtdblock5 /data
exit
[Make a blank file AK8973Prms.txt with notepad in your windows sdk\tools directory]
(in CMD window type, remember to change the the C:\ file path in the command to yours)
adb push C:\Users\name\Desktop\android-sdk-windows\tools\AK8973Prms.txt /data/misc/AK8973Prms.txt
exit
Reboot and wola!
i have managed to calibrate my nexus one g-sensor system wide using your method as a guide, thanks alot

/system/etc/init.d folder, why scripts don't start at boot?

hi all!
i have put a script "99complete"
(
Code:
#!/system/bin/sh
sync;
setprop cm.filesystem.ready 1;
sleep 500
echo 25 > /sys/devices/platform/i2c-adapter/i2c-0/0-005c/sensitivity
echo 25 > /sys/devices/platform/i2c-adapter/i2c-0/0-005c/noise
)
in /system/etc/init.d
but when i boot my phone the script doesn't start...
i have Vachounay 1.0.1 Rom and Acer Liquid S100
any suggestion?
Probably the script isn't executable. Do "chmod +x" on file
-------------------------------------
Sent via the XDA Tapatalk App
I nave already tryed it...
Did you use linux to make the scripts? Scripts don't work if made with windows (unless you use notepad++)
does sleep 500 mean 500/60 ~=8+minutes??? I wonder why u wud wait 8 minutes for executing your script...Give it a try with say sleep 250 ..Wonder if that might be it..rest appears okay to me
Suxsem said:
hi all!
i have put a script "99complete"
(
Code:
#!/system/bin/sh
sync;
setprop cm.filesystem.ready 1;
sleep 500
echo 25 > /sys/devices/platform/i2c-adapter/i2c-0/0-005c/sensitivity
echo 25 > /sys/devices/platform/i2c-adapter/i2c-0/0-005c/noise
)
in /system/etc/init.d
but when i boot my phone the script doesn't start...
i have Vachounay 1.0.1 Rom and Acer Liquid S100
any suggestion?
Click to expand...
Click to collapse
If you edit the script on Windows then use notepad++ and make sure you select "Unix format" under Edit -> EOL Conversion. Also, leave an empty line at the end of the file.
It could also be that whatever ROM you are using does not support init.d scripts.
Check out ScriptManager. It's a little easier way to run stuff at boot, etc..
I found it when I couldn't get my tun.ko module inserted at boot..
https://market.android.com/details?id=os.tools.scriptmanager

help making a script visionary.sh

hello i am new to making scripts and i need help as in how to create a script that just enabled the overclocking to 1ghz.
and to place it in data/local
thanks
can anyone help me please??
please anyone help.. i have been looking everywhere
my visionary.sh does not seem to pick up either (also to oc to 1Gz)....Just as easy, I set the quick-access buttons to launch gscript (free version on market) buttons as follows......1) no reboot script 2) a 1.2 Gz script 3) a 1.0 Gz script.....The scripts were from the .zip files on page 3 (i think) of the main OC forum...After I boot, I simply hit the 1.2 Gz button, and it is good to go......something like this will have to do until a perm root is found....Since I found correct settings for SetCPU (2.0.3) my oc has been very stable...
make sure both visionary.sh and vision_oc.ko are in /data/local
Also make sure you have the right vision_oc.ko (if you updated with OTA, there's a new vision_oc.ko)
Here is my visionary.sh
su
insmod /data/local/vision_oc.ko pll2_l_val=74
mount -o remount,rw /dev/block/mmcblk0p25 /system
setprop qemu.sf.lcd_density 200
busybox killall system_server
Click to expand...
Click to collapse
If you don't like having your screen .... smaller, then remove the last 3 lines
if you have the android sdk, and usb driver installed, you can use ADB to "push" the newly created visionary.sh file mentioned in the previous posts to you data/local folder.
first, write the overclock script in a text editor (use wordpad if you're using windows), and save as text (msdos format seems to work the best), call it visionary (it'll probably auto-rename as visionary.txt).
put this folder in your android sdk \ tools folder.
open up command prompt, by clicking start, run, "cmd" and enter.
type cd \android\tools (or whereever your android sdk folder is)
optional: type dir, and see what the file is called (probably visionary.txt)
type: adb push visionary.txt /data/local/visionary.sh
and you're done.
alternative method is to get Root Explorer or some root file manager on to your phone, use a text editor or gscript to make the script, and then manually putting it in /data/local/ using Root Explorer.
philosophics said:
make sure both visionary.sh and vision_oc.ko are in /data/local
Also make sure you have the right vision_oc.ko (if you updated with OTA, there's a new vision_oc.ko)
Here is my visionary.sh
If you don't like having your screen .... smaller, then remove the last 3 lines
Click to expand...
Click to collapse
will this script run on boot as to my phone will boot at said speed and pixel density?
or what do i have to do?
You are correct. It will run with visionary, oc and change density then it hot reboots. Works great even with visionary running at boot. You'll see your phone basically boot up twice in less then 3 mins but don't be alarmed.
I would power phone on and then go heat up some food. Come back and it should be good to go.
Enjoy!
Sent from my T-Mobile G2 using XDA App
philosophics said:
You are correct. It will run with visionary, oc and change density then it hot reboots. Works great even with visionary running at boot. You'll see your phone basically boot up twice in less then 3 mins but don't be alarmed.
I would power phone on and then go heat up some food. Come back and it should be good to go.
Enjoy!
Sent from my T-Mobile G2 using XDA App
Click to expand...
Click to collapse
thanks a lot man. i basically got it to work but the first time i did it the clock speed went back to normal idk y. and some apps are not suited for the greater resoulution lol
The sh file either freezes my phone or doesn't root. Anyone else?
Sent from my T-Mobile G2 using XDA App

[TWEAK] Disable Wifi on screen off

[REF] Disable Wifi On Screen Off
RyanZA said:
Some people have picked up an annoying bug - I'm not sure where it comes from, some believe it is the voodoo kernel, I think it is probably JPC firmware or similar.
The bug: When you have wifi on and you turn the screen off, wifi does not turn off like it should.
The reality: The wifi turn-off time has been reset to the android default 15 minutes. You can change this setting if you want. (I like 10 seconds myself.)
You will need:
1. ADB root shell access.
2. SQLite3 Explorer - http://www.singular.gr/sqlite/
or SQLiteBrowser - http://sqlitebrowser.sourceforge.net/
What to do:
1. shell command: busybox cp /dbdata/databases/com.android.providers.settings/settings.db /sdcard/settings.db
2. adb command: adb pull /sdcard/settings.db
3. Open settings.db in SQLExplorer
4. Right click on gservices or secure folders**, choose 'Show Data'
5. Click on the green plus icon "Insert Record"
6. Double click on name column, insert "wifi_idle_ms" - Double click on value column and insert "10000" for 10 seconds for wifi to turn off. 30000 for 30 seconds, etc.
7. Click on the green tick.
8. Right click on the folder again, choose show data, scroll to the bottom and ensure that your change has been made.
9. File -> Close Database
10. adb command: adb push settings.db /sdcard/settings.db
11. shell command: busybox mv /dbdata/databases/com.android.providers.settings/settings.db /dbdata/databases/com.android.providers.settings/settings.db.bak
12. shell command: busybox cp /sdcard/settings.db /dbdata/databases/com.android.providers.settings/settings.db
13. shell command: chown system.system /dbdata/databases/com.android.providers.settings/settings.db
** I'm not sure if the correct folder is gservices, or secure. I believe secure is the correct one though. I just added it to both.
This is too hard:
If there are 10 or more people who have this bug but can't do the required fix, I'll make a small utility to do it for you. Let me know.
Click to expand...
Click to collapse
scratch my above post, this tool will give you full wifi control
[APP][2.1+][20 May - 2.1RC1] Better Wifi on/off

Guide: Fix for high battery drain and CPU usage

How to fix always maxed CPU usage and its result, high battery drain.
Whats the reason?
This is due to some "program" that tries to log something, unfortunately, this process takes up all CPU capacities.
I have encountered this issue (after Nandroid Restore) and I thought it might by worth mentioning. It not only happens after Nandroid Restores, as my friend reported.
What you need to fix this:
You will need a rooted device, and a file explorer (root explorer)
Optional: Any terminal emulator, and busybox (just for diagnostics)
How to fix it:
Just start the explorer, and navigate to
Code:
/system/bin
and there search
Code:
logd
. Rename this to
Code:
logd.bak
and Restart
Optional diagnostics (or if method above doesnt change anything: Start your Terminal Emulatorand type this:
Code:
su
then
Code:
busybox top
This will give you all inforamtions about the running processes. If you see another process (very unlikely) that takes up much CPU capacity, and you dont need for ANYTHING (like that logd thingy) you can do same thing as above (just track its path)
Hope I helped you. Thanks

Categories

Resources