Project

General

Profile

Actions

Issue #1800

closed

Issue #1980: Meta bug for the SIM cards not being recognized

Bad SIM detection on Samsung Galaxy S2 I9100

Added by Julien Hanse almost 7 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
High
Category:
SIM card not recognized
Target version:
Start date:
05/18/2017
Due date:
% Done:

0%

Estimated time:
Resolution:
fixed
Device:
Galaxy S 2 (I9100)
Grant:
Type of work:

Description

Hello,
On this device, Replicant 6.0 is unusable with a PIN code enabled on my SIM card. The pin code screen doesn't stop blinking, so that I can't enter the code.
When I unlock the SIM card, it's not recognized.
Same problem with another SIM card.
Both SIM cards works perfectly on Samsung Rom.

Some help would be greatly appreciated :)
Thank you,

Julien


Files

kernel_message_buffer (994 KB) kernel_message_buffer Julien Hanse, 05/25/2017 07:30 PM
radio_log (346 KB) radio_log Julien Hanse, 05/26/2017 05:38 AM

Related issues

Related to Replicant - Issue #1783: SIM card not recognized (regression, was working with Replicant 4.2)FeedbackWolfgang Wiedmeyer04/05/2017

Actions
Actions #1

Updated by Wolfgang Wiedmeyer almost 7 years ago

Did you use Replicant 4.2 before and did it work with that version?
As a first step, logs from the radio buffer are needed, as explained in GettingLogs.

Actions #2

Updated by Julien Hanse almost 7 years ago

Thank you for your answer. As I didn't use Replicant 4.2 I can't say if it would work with it.
Here is the kernel message buffer. I can't grab the radio log yet (ADB says "Unable to open log device 'd'") I will add it asap.

Edit: Here it is

Actions #3

Updated by Julien Hanse almost 7 years ago

Actions #4

Updated by Wolfgang Wiedmeyer almost 7 years ago

  • Assignee set to Wolfgang Wiedmeyer

During modem boot, nv_data is loaded fine:

01-01 12:37:57.528 1952 2227 D use-Rlog/RLOG-RIL-IPC: Checked nv_data path
01-01 12:37:57.528 1952 2227 D use-Rlog/RLOG-RIL-IPC: Checked nv_data md5 path
01-01 12:37:57.560 1952 2227 D use-Rlog/RLOG-RIL-IPC: Calculated nv_data md5: 14cd8646838246f2a3b7c58524a0c138
01-01 12:37:57.560 1952 2227 D use-Rlog/RLOG-RIL-IPC: Read nv_data md5: 14cd8646838246f2a3b7c58524a0c138
01-01 12:37:57.560 1952 2227 D use-Rlog/RLOG-RIL-IPC: Checked nv_data backup path
01-01 12:37:57.575 1952 2227 D use-Rlog/RLOG-RIL-IPC: Loaded nv_data
01-01 12:37:57.944 1952 2227 D use-Rlog/RLOG-RIL-IPC: Sent XMM626 HSIC nv_data

But later, writing to it fails:

01-01 12:38:00.009 1952 2228 D use-Rlog/RLOG-RIL-IPC: Checked nv_data path
01-01 12:38:00.009 1952 2228 D use-Rlog/RLOG-RIL-IPC: Writing nv_data failed
01-01 12:38:00.009 1952 2228 D use-Rlog/RLOG-RIL-RFS: Writing 4 nv_data byte(s) at offset 0x1a0009 failed

The modem is then restarted.

Could you check if the permissions are correct?
You can do this by running:

adb root
adb shell ls -al /efs

The output should look like this:

drwxrwxr-x root     root              2000-01-01 01:04 .files
-rwxrwxrwx radio    radio     1048576 2010-12-31 16:00 .nv_core.bak
-rwxrwxrwx radio    radio          32 2010-12-31 16:00 .nv_core.bak.md5
-rwx------ radio    radio     2097152 2010-12-31 16:00 .nv_data.bak
-rwxrwxrwx radio    radio          32 2010-12-31 16:00 .nv_data.bak.md5
-rwxrwxrwx radio    radio           1 2010-12-31 16:00 .nv_state
drwxrwxrwx radio    system            2013-03-12 18:09 FactoryApp
drwxrwxr-x radio    system            2000-01-01 01:22 bluetooth
-rwxrwxrwx system   system          6 2000-01-01 01:01 calibration_data
drwxrwxrwx radio    system            2000-01-01 01:22 imei
drwxrwxrwx root     root              2013-06-23 15:23 lost+found
-rwxrwxrwx root     root        16384 2016-09-25 01:43 metadata
-rwxrwxrwx radio    radio        1981 2010-12-31 16:00 nv.log
-rwx------ radio    radio     2097152 2017-05-26 12:23 nv_data.bin
-rw------- radio    radio          32 2017-05-26 12:23 nv_data.bin.md5
-rwxrwxrwx radio    radio         880 2010-12-31 16:02 redata.bin
-rwxrwxrwx radio    radio           1 2013-03-09 19:29 upgaddr
drwxrwxr-x radio    system            2012-10-23 21:17 wifi

The file nv_data.bin needs to have the permissions and ownership as above.

Actions #5

Updated by Julien Hanse almost 7 years ago

There are some differencies, mostly execution rights as you will see below:

Output of

#adb shell ls -al /efs

drwxrwxr-x root     root              2000-01-01 01:05 .files
-rw-r--r-- root     root      1048576 2000-01-01 01:20 .nv_core.bak
-rw-r--r-- root     root           32 2000-01-01 01:20 .nv_core.bak.md5
-rwx------ radio    radio     2097152 2000-01-01 01:20 .nv_data.bak
-rw-r--r-- root     root           32 2000-01-01 01:20 .nv_data.bak.md5
-rw-r--r-- root     root            1 2010-12-31 16:00 .nv_state
drwxrwxr-x radio    system            2013-02-12 07:08 FactoryApp
drwxrwxr-x radio    system            2000-01-01 01:09 bluetooth
-rw-r--r-- root     root            9 2000-01-02 05:50 cryptprop_applied_result
-rw-r--r-- root     root            1 2000-01-01 01:16 cryptprop_essiv
-rw-r--r-- root     root            5 2000-01-01 01:03 cryptprop_onetimeboot
-rw-r--r-- root     root            3 2000-01-01 01:00 cryptprop_persist.sys.language
-rw-r--r-- root     root            1 2000-01-02 05:49 cryptprop_rebootMode
-rw-r--r-- root     root            3 2000-01-01 01:03 cryptprop_securewipedata
drwxr-xr-x root     root              2000-01-02 05:50 dmp
drwxrwxr-x radio    system            2000-01-01 01:09 imei
drwxr-xr-x root     root              2013-03-03 02:49 lost+found
-rw-r--r-- root     root         2172 2000-01-01 01:20 nv.log
-rw-r--r-- root     root      2097152 2017-05-16 21:50 nv_data.bin
-rw-r--r-- root     root           32 2017-05-16 21:50 nv_data.bin.md5
-rw-r--r-- root     root          880 2010-12-31 16:02 redata.bin
-rw-r--r-- root     root            1 2013-02-12 07:00 upgaddr
drwxrwxr-x radio    system            2000-01-01 01:13 wifi

Actions #6

Updated by Wolfgang Wiedmeyer almost 7 years ago

I'm wondering why these ownership and permission changes happen. Maybe because of data corruption, e.g. after completely discharging the phone. There are already similar issues about this: forum, #1161 and possibly #1467.

You can restore ownership by running these commands:

adb root
adb shell chown radio:radio /efs/nv_data.bin
adb shell chown radio:radio /efs/nv_data.bin.md5
adb shell chown radio:radio /efs/nv.log
adb shell chown radio:radio /efs/.nv_data.bak.md5
adb shell chown radio:radio /efs/.nv_core.bak.md5
adb shell chown radio:radio /efs/.nv_core.bak
adb shell chown radio:radio /efs/.nv_state

After rebooting the phone, it then hopefully works.

Actions #7

Updated by Julien Hanse almost 7 years ago

Thank you Wolfgang, it's allright now. I am grateful for your help.

Actions #8

Updated by Wolfgang Wiedmeyer almost 7 years ago

  • Status changed from New to Closed
  • Resolution set to fixed

Glad to hear that it works now. I'm closing this then.

Actions #9

Updated by Carlos Rivera about 6 years ago

Wolfgang Wiedmeyer wrote:

Glad to hear that it works now. I'm closing this then.

Hi, thank you people, this issue and the replies were very useful to me, I had the same problem with a new Galaxy SII phone. As soon as I got the phone from aliexpress.com I installed Replicant (I didn't even boot the stock firmware, I should have checked first) and the SIM card wasn't detected, similarly the pin keypad kept blinking. I thought the radio was bad. I changed the ownership of the files and it worked. I know the issue is closed, but I wonder what could have caused the wrong ownership of the files, perhaps it could be prevented from happening again to someone else? I wish I could help this is a great project.

Actions #10

Updated by Denis 'GNUtoo' Carikli over 5 years ago

  • Category changed from Telephony and mobile data to SIM card not recognized
Actions #11

Updated by Viki C. about 5 years ago

Hi, thank you people, this issue and the replies were very useful to me, I had the same problem with a new Galaxy SII phone. As soon as I got the phone from aliexpress.com I installed Replicant (I didn't even boot the stock firmware, I should have checked first) and the SIM card wasn't detected, similarly the pin keypad kept blinking. I thought the radio was bad. I changed the ownership of the files and it worked. I know the issue is closed, but I wonder what could have caused the wrong ownership of the files, perhaps it could be prevented from happening again to someone else? I wish I could help this is a great project.

Almost the same as Carlos Rivera. I bought a S3 phone in Aliexpress and tried to install Replicant 6.0. No SIM detected at all.
I flashed different stock ROMs (thinking the issue could be the Modem partition) and all the stock ROMs worked fine. However when I installed Replicant 6 the smartphone didn't work. Neither with Replicant 4, Lineage 14, eelo and some old ROMs from Cyanogenmod.

Finally I found this thread and I changed the files ownership. Now everything works perfectly.

Hope my experience could help other users and Replicant developers.

Actions #12

Updated by Kurtis Hanna over 4 years ago

  • Parent task set to #1980
Actions

Also available in: Atom PDF