Proximity sensor issue and solution.

Search This thread

JaGuR

Senior Member
Jul 27, 2009
175
3
I am using terminal emulator and it keeps telling my file is not there ?

Any help appreciated

edit: nvm, was typing proximity_sensors instead of proximity_sensor.

Also, big thanks, when switching from 5.0 problem began, so something must have got corrupted, this was not the dust in the ear piece problem as I pulled it out twice before and cleaned for no fix.
 
Last edited:

JaGuR

Senior Member
Jul 27, 2009
175
3
Since fixing my proximity sensor my GPS has stopped working all together, anybody else have this problem. ?
 

garebello

Member
Feb 26, 2011
31
4
curitiba
Here is my experience with proximity sensor, and finally got it working back with manual recalibration. So sharing here with you if any one having same issue.

Symptoms : Weired behavior of proximity sensor, I had issue like screen was not turning On after call ends. Air call accept not working

Test : Dial *#0*#
Now this will open up menu, select sensor from there and putting hand near proximity sensor screen should turn green and vibrate. I have had that, but when moving hand away from proximity sensor it was not turning back to normal stat. So once proximity sensor gets activated, it was remaining On always.

Suggestion from net : There wa plenty of cases I have seen having same issue on note3. there was different suggestion like turning auto brightness off / removing Ext SD card was worked for other but not worked on my case. Also someone asked to blow compressed air in earpiece to clean sensor, that helped but just for few minutes only.

Solution that was worked for me.
First thing this setting files remains in EFS folder, so if you have EFS backup, you can try restoring it. In my case I had old EFS backup (MJ1) and have ROM MK2, and later I realized, there is some file difference in both version. (samsung have again screwed EFS, Thanks :( )
So finally I need to manually recalibrate proximity sensor and that worked fine and since couple of hrs using it without issue.

Requirements :
-Adb access and rooted device.

You should have rooted device, also make sure USB debugging is ON
Connect device to PC and run adb shell
Type following command

Code:
cd /sys/devices/virtual/sensors/proximity_sensor/
then
Code:
cat state #blank value
You will get some value(blank value), note that value. In my case it was 85.

Now enter this command to get actual configuration value
Code:
cat prox_cal
you will get some value, note that value too. In my case it was 46,166,126

Now make total of blank value and actual value(first part) , e.g. in my case it was 85+46 (red above) = 131

Now you need to find HEX value for 131. Get from here OR Here
So in my case it was (HEX value for 131) 83

Now you need to write this value in prox_cal file in EFS folder. For this you need,

Type this with adb
Code:
su
Grant supersu permission from device if ask.
then
Code:
echo -en $'\x83' > /efs/prox_cal
here 83 is my value, you have to replace with your.
then
Code:
sync

Now last step you needs to change permission. here is three steps for that.

Code:
 chown system:system /efs/prox_cal
 chmod 644 /efs/prox_cal
 sync
Reboot device and check proximity sensor is working fine.
GoodLuck !
Referred too many threads on XDa and google, main credit goes to @greaty for clear instruction.
I changed my kernel and again the proximity sensor gone crazy, and again the solution works. Thanks again man!
 

deshwani

Senior Member
Dec 21, 2013
180
7
its just amazing... i had same problem and terminal emulator did the trick... thank you so much
 

hapa8o8

Senior Member
Aug 14, 2010
266
43
Honolulu, Hawaii
Amazing!!! We need this sticky ASAP as it is the only solution that has worked for me successfully. Will be doing this after every flash and if the phone (end call) fails. Thank you
 

Aarush69

Member
Mar 29, 2016
38
6
27
Indore
www.facebook.com
The system cannot find the path specified msg when i enter the command echo 0 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal

---------- Post added at 04:51 PM ---------- Previous post was at 04:35 PM ----------

826613756,826613876,826613836 value when i type cat prox_cal can you tell me which value is i choose for calculate ?
 
Last edited:

cavjr08

Senior Member
Sep 22, 2012
230
55
Manila
OnePlus 6
You're an angel dr. ketan! Thank you very much. Fixed my proximity sensor using your TUT. I really Am very thankful.

---------- Post added at 12:46 PM ---------- Previous post was at 12:37 PM ----------

The system cannot find the path specified msg when i enter the command echo 0 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal

---------- Post added at 04:51 PM ---------- Previous post was at 04:35 PM ----------

826613756,826613876,826613836 value when i type cat prox_cal can you tell me which value is i choose for calculate ?

Try using the minimum value shown in the sensor test when your sensor isn't convered, mine is (221, 223, 2**), I used the 221 as my hex and guess what my proximity sensor is now 100% working. I do have figures of (1004, 1004, 1004) everytime the sensor is convered. Hope this'll help you dude. Good luck.

PS: I did not use the Hex Converter for I do get the same result. Just use the minimum value.
 

Aarush69

Member
Mar 29, 2016
38
6
27
Indore
www.facebook.com
You're an angel dr. ketan! Thank you very much. Fixed my proximity sensor using your TUT. I really Am very thankful.

---------- Post added at 12:46 PM ---------- Previous post was at 12:37 PM ----------



Try using the minimum value shown in the sensor test when your sensor isn't convered, mine is (221, 223, 2**), I used the 221 as my hex and guess what my proximity sensor is now 100% working. I do have figures of (1004, 1004, 1004) everytime the sensor is convered. Hope this'll help you dude. Good luck.

PS: I did not use the Hex Converter for I do get the same result. Just use the minimum value.
My sensor is not covered my proximity gyroscope light sensor and all other sensor value goes 0 when i checked using *#0*# after root my whole sensors stop working and giving me error process system isn't responding.
 

cavjr08

Senior Member
Sep 22, 2012
230
55
Manila
OnePlus 6
My sensor is not covered my proximity gyroscope light sensor and all other sensor value goes 0 when i checked using *#0*# after root my whole sensors stop working and giving me error process system isn't responding.

Oh, I guess dr.ketan will be able to help you with that. What I did is a trial and error with dr.ketan's method. Hope you'll fixed yours as well. Good luck.
 

Conito11

Senior Member
Feb 22, 2013
1,066
221
So, after flashing a lollipop ROM on my N9005, my proximity sensor stopped working.

Strangely enough, even with root access, terminal commands are forbidden to me.

But ES File Explorer wasn't...

So I opened the files on sys/devices as OP told, noted and add the numbers, did the HEX thing, created a new file on efs folder, edited it with my HEX number and set permissions using the same app, on properties options...

Bottom line... Thanks OP for this fix (proximity sensor fails can be very annoying), and it can be done without adb terminal, just using a root explorer (in my case ES Explorer).

Thanks you so much

I can not get the first value and when I look at sys folder my first value was 0 so I supposed that the first one could be any value so I decided to use the same value given in op :83. Then I create a new file on efs folder called prox_cal with proper permissions and just with the hex value on it. Rebooted the phone and tested on sensor box for Android and now the sensor works.
Thanks you so much
 

fyec

Member
May 9, 2012
6
0
Here is my experience with proximity sensor, and finally got it working back with manual recalibration. So sharing here with you if any one having same issue.

Symptoms : Weired behavior of proximity sensor, I had issue like screen was not turning On after call ends. Air call accept not working

Test : Dial *#0*#
Now this will open up menu, select sensor from there and putting hand near proximity sensor screen should turn green and vibrate. I have had that, but when moving hand away from proximity sensor it was not turning back to normal stat. So once proximity sensor gets activated, it was remaining On always.

Suggestion from net : There wa plenty of cases I have seen having same issue on note3. there was different suggestion like turning auto brightness off / removing Ext SD card was worked for other but not worked on my case. Also someone asked to blow compressed air in earpiece to clean sensor, that helped but just for few minutes only.

Solution that was worked for me.
First thing this setting files remains in EFS folder, so if you have EFS backup, you can try restoring it. In my case I had old EFS backup (MJ1) and have ROM MK2, and later I realized, there is some file difference in both version. (samsung have again screwed EFS, Thanks :( )
So finally I need to manually recalibrate proximity sensor and that worked fine and since couple of hrs using it without issue.

Requirements :
-Adb access and rooted device.

You should have rooted device, also make sure USB debugging is ON
Connect device to PC and run adb shell
Type following command

Code:
cd /sys/devices/virtual/sensors/proximity_sensor/
then
Code:
cat state #blank value
You will get some value(blank value), note that value. In my case it was 85.

Now enter this command to get actual configuration value
Code:
cat prox_cal
you will get some value, note that value too. In my case it was 46,166,126

Now make total of blank value and actual value(first part) , e.g. in my case it was 85+46 (red above) = 131

Now you need to find HEX value for 131. Get from here OR Here
So in my case it was (HEX value for 131) 83

Now you need to write this value in prox_cal file in EFS folder. For this you need,

Type this with adb
Code:
su
Grant supersu permission from device if ask.
then
Code:
echo -en $'\x83' > /efs/prox_cal
here 83 is my value, you have to replace with your.
then
Code:
sync

Now last step you needs to change permission. here is three steps for that.

Code:
 chown system:system /efs/prox_cal
chmod 644 /efs/prox_cal
sync
Reboot device and check proximity sensor is working fine.
GoodLuck !
Referred too many threads on XDa and google, main credit goes to @greaty for clear instruction.
Thanks a lot. It worked.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 36
    Here is my experience with proximity sensor, and finally got it working back with manual recalibration. So sharing here with you if any one having same issue.

    Symptoms : Weired behavior of proximity sensor, I had issue like screen was not turning On after call ends. Air call accept not working

    Test : Dial *#0*#
    Now this will open up menu, select sensor from there and putting hand near proximity sensor screen should turn green and vibrate. I have had that, but when moving hand away from proximity sensor it was not turning back to normal stat. So once proximity sensor gets activated, it was remaining On always.

    Suggestion from net : There wa plenty of cases I have seen having same issue on note3. there was different suggestion like turning auto brightness off / removing Ext SD card was worked for other but not worked on my case. Also someone asked to blow compressed air in earpiece to clean sensor, that helped but just for few minutes only.

    Solution that was worked for me.
    First thing this setting files remains in EFS folder, so if you have EFS backup, you can try restoring it. In my case I had old EFS backup (MJ1) and have ROM MK2, and later I realized, there is some file difference in both version. (samsung have again screwed EFS, Thanks :( )
    So finally I need to manually recalibrate proximity sensor and that worked fine and since couple of hrs using it without issue.

    Requirements :
    -Adb access and rooted device.

    You should have rooted device, also make sure USB debugging is ON
    Connect device to PC and run adb shell
    Type following command

    Code:
    cd /sys/devices/virtual/sensors/proximity_sensor/
    then
    Code:
    cat state #blank value
    You will get some value(blank value), note that value. In my case it was 85.

    Now enter this command to get actual configuration value
    Code:
    cat prox_cal
    you will get some value, note that value too. In my case it was 46,166,126

    Now make total of blank value and actual value(first part) , e.g. in my case it was 85+46 (red above) = 131

    Now you need to find HEX value for 131. Get from here OR Here
    So in my case it was (HEX value for 131) 83

    Now you need to write this value in prox_cal file in EFS folder. For this you need,

    Type this with adb
    Code:
    su
    Grant supersu permission from device if ask.
    then
    Code:
    echo -en $'\x83' > /efs/prox_cal
    here 83 is my value, you have to replace with your.
    then
    Code:
    sync

    Now last step you needs to change permission. here is three steps for that.

    Code:
     chown system:system /efs/prox_cal
     chmod 644 /efs/prox_cal
     sync
    Reboot device and check proximity sensor is working fine.
    GoodLuck !
    Referred too many threads on XDa and google, main credit goes to @greaty for clear instruction.
    7
    i had the same problem and solved it typing in a terminal emulator

    HTML:
    $ su
    $ echo 0 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal
    $ echo 1 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal
    $ chown system:system /efs/prox_cal
    $ chmod 644 /efs/prox_cal
    $ sync
    3
    Sorry intended to post on Note3 general forum.
    Mod please move this thread.
    2
    yeah ut can be any so better first use that value and see if that works or not. If doesn't work then let me know.
    you have to use this
    echo -en $'\xC' > /efs/prox_cal
    as per instruction and don't forget to do it with Supreuser (root access)
    2
    Was able to fix a non-functional proximity sensor pretty painlessly with the Proximity Sensor Reset/Repair app from the Play store.

    https://play.google.com/store/apps/details?id=com.mobiledirection.proximitysensorreset

    N900W8 running LineageOS 14.1