le_sim_GetIMSI doesn't seem to work


#1

le_sim_GetIMSI doesn’t return the IMSI from the SIM, and logs says it can’t retrieve it. Command line “cm info” doesn’t show it either. This is on a WP7601, R7 Verizon software, Legato 17.11.


#2

With the latest legato version, can able to retrieve ‘IMSI’ Value.
root@swi-mdm9x28:~# cm sim info
Type: EXTERNAL_SLOT_1
ICCID: 8991440459006589640
Home Network Operator: IDEA
EID:
IMSI: 404445900658964
Phone Number:
root@swi-mdm9x28:~# legato version
18.02.0.rc1_83ceda15f0be33aa3f626dc9ebb8be5e_modified

Need to upgrade legato version. If still faces the issue please provide logs.


#3

Hi @Manikanta,
I’m assuming that the c/c++ the call le_GetIMSI will then work, since cm is an application?

Thanks,
Steve


#4

Hi @EvetsMostel,
Yes, le_sim_GetIMSI() will work when called from c file. But to access any API through c file, it should be created as an application. To access le_sim_GetIMSI() API, le_sim.api file should be binded using the .adef file. As below

bindings:
{
<executable>.<component>.le_sim -> modemService.le_sim
}

Taken @ref: http://legato.io/legato-docs/latest/defFilesAdef.html
To develop Apps, @ref: http://legato.io/legato-docs/latest/basicApps.html

Thanks


#5

Hi @Manikanta
Of course, not sure how you’d do it any other way. lol

Evets


#6

Hi @EvetsMostel, do you have any logs?

Also is the SIM ‘ready’?


#7

Hi @CoRfr,
It seems to be inconsistent, but I think it’s related to when you have a static IPV4 SIM. I will try to post logs later. I make the connection to the network, so the SIM must be “ready”. cm says:
SIM card is inserted and locked (LE_SIM_INSERTED).


#8

Hi @EvetsMostel

SIM card is inserted and locked (LE_SIM_INSERTED)

This means the SIM is locked and need pin code to unlock before WP can read/access the SIM.

You may try below to apply pin code and see does it able to read the IMSI.

cm sim enterpin <pin>
cm sim info

Alternatively, you may use below to unlock it permanently

cm sim unlock <pin>

Thx


#9

Hi @lotam,
I don’t believe that this SIM is locked, as it was pulled out of a MC7455 which CAN read the IMSI. Also, I’ve never locked it, unless the Carrier did. It’s my personal SIM.


#10

Can you share response for

cm sim info


#11

@lotam,
I won’t give the particulars since this is a public forum, but it gives the ICCID, Home Network Operator and the phone number. The IMSI and EID are both Blank.

Manikanta from above, says that it needs to be the latest version of Legato. I’m running 17.11 because that’s what R7 is for the wp76xx.


#12

This is odd, my understanding is that the IMSI is only available when the SIM card is in a READY state.
That’s what the code does, cf le_sim.c, GetSimCardInformation.
If it’s only in a INSERTED state, the Legato code doesn’t provide an IMSI.

Could you use the AT port to see if you can read the IMSI through that?

# microcom /dev/ttyAT
AT+CIMI

If it does return the IMSI while Legato doesn’t, then that would be an issue.


#13

Hi @CoRfr,
Yes, it most certainly does. As I’ve said, I’ve used this sim on a MC7455 (my personal) and the software I use to control it works, and uses the IMSI to determine what the sim carrier is. It won’t work without it.
This is a WP7601 though, again running version 7.11 of Legato.

Evets


#14

I do not have a device available at the moment, but could you rebuild Legato with the following patch to see if the IMSI is shown:

Something like:

cd legato
git fetch https://github.com/CoRfr/legato-af/ testimsi
git checkout FETCH_HEAD
make wp76xx

#15

Could you also post some logs from logread with debug level on (log level DEBUG)?
The issue is hard to understand given that it seems that the SIM state is in ready state despite appearing as in inserted state.


#16

Hi @CoRfr,
Sorry, I’ve been trying to get a release out. Still don’t have your info yet, but I did want you to know that for the WP7601, R8, Legato 18.1.0, it still does not output the IMSI. Even the built in cm won’t output it. I will try to get something later today if I can finish up this issue I’m working on.


#17

@CoRfr,
Sorry, was doing a release and didn’t get back to this.
So, do I need a particular version of Legato to test this on? Or is this fetch going to give me the entire build?

Evets


#18

When I try the git command, it says:
fatal: Not a git repository (or any of the parent directories): .git