[Tutorial] Fix Sensors, wifi, bluetooth... For Xiaomi Redmi Note 5 without mode edl

Search This thread

GLokin666

Senior Member
Sep 5, 2015
236
456
Spain
smgjWe
I was able to solve the problem I had with the sensors, the gyroscope sensor and the accelerometer did not work, I discovered that it was because the persist.img partition was damaged, thanks to this method that works for me, With this tutorial you can also repair wifi and bluetooth if in your case it does not work.

I also clarify that this method works if you are ARB3 or ARB4

Attention: You must have the Bootloader unlocked and have Twrp installed

Download the lastest stable fastboot rom and unpack it. Find persist.img from downloaded folder and move it to internal storage.

1) Start the twrp with Vol + and power button
2) Advanced -> Terminal.
3) Execute these lines.
a) simg2img /sdcard/persist.img /sdcard/persist_EXT4.img - Converts de image from sparse to raw.
b) dd if=/sdcard/persist_EXT4.img of=/dev/block/bootdevice/by-name/persist - Flashes the persist block with new persist image.
4) Reboot to system.

Credits - 4pda
I hope it worked for you :D:D
 
Last edited:

Desmanto

Senior Member
Apr 2, 2014
416
451
Xiaomi Mi 10T / 10T Pro
Thanks for the tutorial. Someone in kaskus is trying to fix the sensor not working problem. He has UBL and already anti 4, need to be careful. Can't flash the persist.img 9.5.19.0 directly via fastboot (blocked by the ARP), even though has flash the dummy.img already. So he boot into TWRP dan try the dd command to put in the persist.img from fastboot rom immediately to the partition. Result? Bootstuck. Still can access fastboot and still can boot to TWRP. He have tried several method, and probably the mi flash with authorized account is the last resort. Since he only break his persist.img partition, I recommend him to try your method and it works!!! I just know that all img from fastboot rom are sparse img files.

BTW, I need some confirmation. We can flash the TWRP directly from fastboot or install it via TWRP too (updating TWRP by phone). Does it mean that the fastboot binary is capable to flash raw ext4 image and sparse img file? Or it is the TWRP that is capable to flash sparse img file? The dd command only accept raw img, not sparse img. That's why need to convert it first.

By using this method, we can basically dd manually every partition from TWRP, thus bypassing the anti 4 fastboot blocked out command.
 

dgrayboy

Senior Member
Jan 28, 2015
74
5
I was able to solve the problem I had with the sensors, the gyroscope sensor and the accelerometer did not work, I discovered that it was because the persist.img partition was damaged, thanks to this method that works for me, With this tutorial you can also repair wifi and bluetooth if in your case it does not work.

I also clarify that this method works if you are ARB3 or ARB4

Attention: You must have the Bootloader unlocked and have Twrp installed

Download the lastest stable fastboot rom and unpack it. Find persist.img from downloaded folder and move it to internal storage.

1) Start the twrp with Vol + and power button
2) Advanced -> Terminal.
3) Execute these lines.
a) simg2img /sdcard/persist.img /sdcard/persist_EXT4.img - Converts de image from sparse to raw.
b) dd if=/sdcard/persist_EXT4.img of=/dev/block/bootdevice/by-name/persist - Flashes the persist block with new persist image.
4) Reboot to system.

Credits - 4pda
I hope it worked for you :D:D

When you say the sensors do not work, do you mean that they do not rotate at all? Or do they cause games in fullscreen landscape mode to randomly flip upside down?

I had this bug in both ResurrectionRemix and LineagesOS, the only workaround is to force the device to be in landscape mode by changing the rotation to auto-rotate and back to landscape via the QuickSettings header bar
 

GLokin666

Senior Member
Sep 5, 2015
236
456
Spain
When you say the sensors do not work, do you mean that they do not rotate at all? Or do they cause games in fullscreen landscape mode to randomly flip upside down?

I had this bug in both ResurrectionRemix and LineagesOS, the only workaround is to force the device to be in landscape mode by changing the rotation to auto-rotate and back to landscape via the QuickSettings header bar

the gyroscope sensor and the accelerometer did not work, but with this method it has been solved
 

dgrayboy

Senior Member
Jan 28, 2015
74
5
the gyroscope sensor and the accelerometer did not work, but with this method it has been solved

So previously, it totally would not rotate at all?

My issue is that the gyroscope and accelerometer works, but in landscape mode games, the screen would incorrectly flip upside down.

Minimizing the game and going to Accelerometer Calibration (https://play.google.com/store/apps/details?id=redpi.apps.accelerometercalibration) shows that the accelerometer is working fine, so not sure what could be causing the random upside down flips in landscape mode..
 

aank

Senior Member
Dec 3, 2007
68
15
Does this way can also fixing broke fingerprint sensor? I've faced those problem sometimes when flashing too many custom rom not miui based. Flashing fastboot rom fixed it anyway...
 

Akhmadmandala

Senior Member
Feb 27, 2017
70
6
I was able to solve the problem I had with the sensors, the gyroscope sensor and the accelerometer did not work, I discovered that it was because the persist.img partition was damaged, thanks to this method that works for me, With this tutorial you can also repair wifi and bluetooth if in your case it does not work.

I also clarify that this method works if you are ARB3 or ARB4

Attention: You must have the Bootloader unlocked and have Twrp installed

Download the lastest stable fastboot rom and unpack it. Find persist.img from downloaded folder and move it to internal storage.

1) Start the twrp with Vol + and power button
2) Advanced -> Terminal.
3) Execute these lines.
a) simg2img /sdcard/persist.img /sdcard/persist_EXT4.img - Converts de image from sparse to raw.
b) dd if=/sdcard/persist_EXT4.img of=/dev/block/bootdevice/by-name/persist - Flashes the persist block with new persist image.
4) Reboot to system.

Credits - 4pda
I hope it worked for you :D:D

can you make it more specific how to convert sparse to raw
 

Desmanto

Senior Member
Apr 2, 2014
416
451
Xiaomi Mi 10T / 10T Pro
So previously, it totally would not rotate at all?

My issue is that the gyroscope and accelerometer works, but in landscape mode games, the screen would incorrectly flip upside down.

Minimizing the game and going to Accelerometer Calibration (https://play.google.com/store/apps/details?id=redpi.apps.accelerometercalibration) shows that the accelerometer is working fine, so not sure what could be causing the random upside down flips in landscape mode..
This is for some users who have all sensors not working at all (get crossed at the sensor box). It is mostly come from the red box, chinese version. You are experiencing another random rotation issue, which happen in several users across multiple version including custom ROM. Some reported that they simply tap the phone and it suddenly flip upside down. I can't reproduce this, so it might be possible with the persist.img too.

can you make it more specific how to convert sparse to raw
simg2img /sdcard/persist.img /sdcard/persist_EXT4.img - Converts de image from sparse to raw.
You type this in TWRP terminal emulator, before dd-ing the image to the persist partition.
 

Akhmadmandala

Senior Member
Feb 27, 2017
70
6
This is for some users who have all sensors not working at all (get crossed at the sensor box). It is mostly come from the red box, chinese version. You are experiencing another random rotation issue, which happen in several users across multiple version including custom ROM. Some reported that they simply tap the phone and it suddenly flip upside down. I can't reproduce this, so it might be possible with the persist.img too.


simg2img /sdcard/persist.img /sdcard/persist_EXT4.img - Converts de image from sparse to raw.
You type this in TWRP terminal emulator, before dd-ing the image to the persist partition.

God thanks bro, i forgot to add space.
My phone got stuck but luckly i do solve it with your method.
Thanks man! You're awesome
 
  • Like
Reactions: GLokin666

madorax

Member
Sep 18, 2011
34
6
i have flip issue when gaming. all sensor is oke no problem. but currently in custom rom xtended with custom kernel. does this method still worked or do i need to flash back miui rom first?
 

ANR2K

Member
Jan 26, 2010
18
2
Additionally, this method will also fixed/permanently removes "Unofficial ROM" watermark issue on some CN device/ROM when migrating to Global ROM :)
 

abdogsm

New member
Jan 30, 2017
4
0
help me plz redmi note 5 pro

Hi please please help me miui note 5 pro some miui 10 beta wifi no longer working I tried with all the ways without you have returned miui 9 stable did not solve the problem I hope you help me please
((((( wifi mac address inconnu))))
 

sauliiin

Senior Member
Jan 12, 2011
953
391
Belo Horizonte
Hi please please help me miui note 5 pro some miui 10 beta wifi no longer working I tried with all the ways without you have returned miui 9 stable did not solve the problem I hope you help me please
((((( wifi mac address inconnu))))

OK! Does your phone see the wifi networks around? If so, worry not! That had happened before and was not a hardware problem.

Sometimes, some partitions that are not touched by simply flashing, reflashing or restoring from twrp can get corrupted.

I believe that flashing a full rom from mi tolls on PC can solve it.

Also, this method should also.

In another thread I posted a zip (flash from TWRP) that worked for me in the past.. It simple removes some folders with corrupt files that **** your sensors. After a reboot, they come back to life. Mind to try? Also, a feedback would be appreciated!

Here it goes: https://xdaforums.com/redmi-note-5-pro/how-to/masik-2-4-rom-t3828932/page31
 
Last edited:

samope

New member
May 2, 2018
2
0
smgjWe
I was able to solve the problem I had with the sensors, the gyroscope sensor and the accelerometer did not work, I discovered that it was because the persist.img partition was damaged, thanks to this method that works for me, With this tutorial you can also repair wifi and bluetooth if in your case it does not work.

I also clarify that this method works if you are ARB3 or ARB4

Attention: You must have the Bootloader unlocked and have Twrp installed

Download the lastest stable fastboot rom and unpack it. Find persist.img from downloaded folder and move it to internal storage.

1) Start the twrp with Vol + and power button
2) Advanced -> Terminal.
3) Execute these lines.
a) simg2img /sdcard/persist.img /sdcard/persist_EXT4.img - Converts de image from sparse to raw.
b) dd if=/sdcard/persist_EXT4.img of=/dev/block/bootdevice/by-name/persist - Flashes the persist block with new persist image.
4) Reboot to system.

Credits - 4pda
I hope it worked for you :D:D
i have a redmi note pro. bootloader LOCKED, and i installed twrp. i tried this methos and i got simg2img not found.. pls help
edit: it worked!! probably bcos my bootloader is locked i cant convert it to raw file with the terminal, so here is what i did
i downloaded the persist.img for my phone and downloaded image kitchen (playstore) and used image kitchen to convert it to raw file.. and rebooted my phone to recovery-terminal then used the code dd if=/sdcard... bla... bla... as listed up... and i rebooted and bam... it worked .. am happy... thanks u are the man
 
Last edited:

raptorddd

Senior Member
Jun 13, 2013
6,485
2,328
culiacan
OK! Does your phone see the wifi networks around? If so, worry not! That had happened before and was not a hardware problem.

Sometimes, some partitions that are not touched by simply flashing, reflashing or restoring from twrp can get corrupted.

I believe that flashing a full rom from mi tolls on PC can solve it.

Also, this method should also.

In another thread I posted a zip (flash from TWRP) that worked for me in the past.. It simple removes some folders with corrupt files that **** your sensors. After a reboot, they come back to life. Mind to try? Also, a feedback would be appreciated!

Here it goes: https://xdaforums.com/redmi-note-5-pro/how-to/masik-2-4-rom-t3828932/page31
i forgot to mention to you that the file you share its empty.:D if i remeber well it only has META-INF file.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 28
    smgjWe
    I was able to solve the problem I had with the sensors, the gyroscope sensor and the accelerometer did not work, I discovered that it was because the persist.img partition was damaged, thanks to this method that works for me, With this tutorial you can also repair wifi and bluetooth if in your case it does not work.

    I also clarify that this method works if you are ARB3 or ARB4

    Attention: You must have the Bootloader unlocked and have Twrp installed

    Download the lastest stable fastboot rom and unpack it. Find persist.img from downloaded folder and move it to internal storage.

    1) Start the twrp with Vol + and power button
    2) Advanced -> Terminal.
    3) Execute these lines.
    a) simg2img /sdcard/persist.img /sdcard/persist_EXT4.img - Converts de image from sparse to raw.
    b) dd if=/sdcard/persist_EXT4.img of=/dev/block/bootdevice/by-name/persist - Flashes the persist block with new persist image.
    4) Reboot to system.

    Credits - 4pda
    I hope it worked for you :D:D
    2
    Thanks for the tutorial. Someone in kaskus is trying to fix the sensor not working problem. He has UBL and already anti 4, need to be careful. Can't flash the persist.img 9.5.19.0 directly via fastboot (blocked by the ARP), even though has flash the dummy.img already. So he boot into TWRP dan try the dd command to put in the persist.img from fastboot rom immediately to the partition. Result? Bootstuck. Still can access fastboot and still can boot to TWRP. He have tried several method, and probably the mi flash with authorized account is the last resort. Since he only break his persist.img partition, I recommend him to try your method and it works!!! I just know that all img from fastboot rom are sparse img files.

    BTW, I need some confirmation. We can flash the TWRP directly from fastboot or install it via TWRP too (updating TWRP by phone). Does it mean that the fastboot binary is capable to flash raw ext4 image and sparse img file? Or it is the TWRP that is capable to flash sparse img file? The dd command only accept raw img, not sparse img. That's why need to convert it first.

    By using this method, we can basically dd manually every partition from TWRP, thus bypassing the anti 4 fastboot blocked out command.
    1
    This is for some users who have all sensors not working at all (get crossed at the sensor box). It is mostly come from the red box, chinese version. You are experiencing another random rotation issue, which happen in several users across multiple version including custom ROM. Some reported that they simply tap the phone and it suddenly flip upside down. I can't reproduce this, so it might be possible with the persist.img too.


    simg2img /sdcard/persist.img /sdcard/persist_EXT4.img - Converts de image from sparse to raw.
    You type this in TWRP terminal emulator, before dd-ing the image to the persist partition.

    God thanks bro, i forgot to add space.
    My phone got stuck but luckly i do solve it with your method.
    Thanks man! You're awesome
    1
    i forgot to mention to you that the file you share its empty.:D if i remeber well it only has META-INF file.

    Hi my friend! I believe thats how it is supposed to be! Because it just empty some folders that have corrupted files.
    1
    Works perfect in my Whyred, i fixed the bad working of the Proximity sensor with this.
    Thanks bro <3