* Alcatel Onetouch X515 support
@ 2012-11-08 10:12 Cedric Jehasse
2012-11-08 14:16 ` Denis Kenzior
0 siblings, 1 reply; 8+ messages in thread
From: Cedric Jehasse @ 2012-11-08 10:12 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 846 bytes --]
Hi,
I'm looking to extend the alcatel plugin to be able to setup a pdp context
with an Alcatel dongle.
The first issue i ran into is right after entering the pin, "AT+CPIN?" is
returning a CME Error: SIM busy. And the PinRequired property is not
updated.
I have taken logs with the software from Alcatel, and in those logs i see
"AT+CNUM" and "AT+CSCA?" also return the same error.
I think we can get these errors while the sim is initializing.
It looks like AT+CPIN? should be polled on this device. I wanted to do this
from the alcatel plugin, but I don't know how to update the sim state from
there to change Pinrequired.
It would be done automatically if i would call __ofono_sim_recheck_pin from
the plugin, but i'm not sure if it can be called from a plugin.
Do you have any advice for me on this?
Thanks,
Cedric
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 1019 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Alcatel Onetouch X515 support
2012-11-08 10:12 Alcatel Onetouch X515 support Cedric Jehasse
@ 2012-11-08 14:16 ` Denis Kenzior
2012-11-08 15:02 ` Cedric Jehasse
0 siblings, 1 reply; 8+ messages in thread
From: Denis Kenzior @ 2012-11-08 14:16 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1045 bytes --]
Hi Cedric,
On 11/08/2012 04:12 AM, Cedric Jehasse wrote:
> Hi,
>
> I'm looking to extend the alcatel plugin to be able to setup a pdp
> context with an Alcatel dongle.
>
> The first issue i ran into is right after entering the pin, "AT+CPIN?"
> is returning a CME Error: SIM busy. And the PinRequired property is not
> updated.
> I have taken logs with the software from Alcatel, and in those logs i
> see "AT+CNUM" and "AT+CSCA?" also return the same error.
> I think we can get these errors while the sim is initializing.
>
> It looks like AT+CPIN? should be polled on this device. I wanted to do
> this from the alcatel plugin, but I don't know how to update the sim
> state from there to change Pinrequired.
> It would be done automatically if i would call __ofono_sim_recheck_pin
> from the plugin, but i'm not sure if it can be called from a plugin.
>
> Do you have any advice for me on this?
>
Check how other plugins do this, in particular pay attention to
at_util_sim_state_query usage.
Regards,
-Denis
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Alcatel Onetouch X515 support
2012-11-08 14:16 ` Denis Kenzior
@ 2012-11-08 15:02 ` Cedric Jehasse
2012-11-08 15:10 ` Denis Kenzior
0 siblings, 1 reply; 8+ messages in thread
From: Cedric Jehasse @ 2012-11-08 15:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1478 bytes --]
Hi Denis,
I've just seen the same issue on a huawei E369. So i'm not so sure fixing
it in the plugin is the best way.
What i've done now is reschedule calling __ofono_sim_recheck after 5
seconds if sim_pin_query_cb get's a CME Error 14.
Is it ok to do it like this?
diff --git a/src/sim.c b/src/sim.c
index 8059d2b..46b0880 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -2689,6 +2689,13 @@ ofono_bool_t ofono_sim_remove_spn_watch(struct
ofono_sim *sim, unsigned int *id)
return ret;
}
+static gboolean sim_busy_poll(gpointer data)
+{
+ struct ofono_sim *sim = data;
+ __ofono_sim_recheck_pin(sim);
+ return FALSE;
+}
+
static void sim_pin_query_cb(const struct ofono_error *error,
enum ofono_sim_password_type pin_type,
void *data)
@@ -2698,8 +2705,12 @@ static void sim_pin_query_cb(const struct
ofono_error *error,
const char *path = __ofono_atom_get_path(sim->atom);
const char *pin_name;
+
if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
- ofono_error("Querying PIN authentication state failed");
+ if (error->type == OFONO_ERROR_TYPE_CME && error->error ==
14)
+ g_timeout_add_seconds(5, sim_busy_poll, sim);
+ else
+ ofono_error("Querying PIN authentication state
failed");
return;
}
Thanks,
Cedric
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 1947 bytes --]
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: Alcatel Onetouch X515 support
2012-11-08 15:02 ` Cedric Jehasse
@ 2012-11-08 15:10 ` Denis Kenzior
2012-11-08 15:29 ` Cedric Jehasse
0 siblings, 1 reply; 8+ messages in thread
From: Denis Kenzior @ 2012-11-08 15:10 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 482 bytes --]
Hi Cedric,
On 11/08/2012 09:02 AM, Cedric Jehasse wrote:
> Hi Denis,
>
> I've just seen the same issue on a huawei E369. So i'm not so sure
> fixing it in the plugin is the best way.
> What i've done now is reschedule calling __ofono_sim_recheck after 5
> seconds if sim_pin_query_cb get's a CME Error 14.
> Is it ok to do it like this?
The design philosophy is to not perform any polling in the core. The
modem driver has to take care of this.
Regards,
-Denis
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Alcatel Onetouch X515 support
2012-11-08 15:10 ` Denis Kenzior
@ 2012-11-08 15:29 ` Cedric Jehasse
2012-11-08 15:43 ` Denis Kenzior
0 siblings, 1 reply; 8+ messages in thread
From: Cedric Jehasse @ 2012-11-08 15:29 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 328 bytes --]
>
> The design philosophy is to not perform any polling in the core. The
> modem driver has to take care of this.
>
Ok. So in case of the atmodem driver, would it be correct to move this
retrying of AT+CPIN? to at_cpin_cb and only call the cb from the core once
the reply is not CME Error SIM Busy?
Thanks,
Cedric
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 706 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Alcatel Onetouch X515 support
2012-11-08 15:29 ` Cedric Jehasse
@ 2012-11-08 15:43 ` Denis Kenzior
2012-11-08 16:43 ` Cedric Jehasse
0 siblings, 1 reply; 8+ messages in thread
From: Denis Kenzior @ 2012-11-08 15:43 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 690 bytes --]
Hi Cedric,
On 11/08/2012 09:29 AM, Cedric Jehasse wrote:
> The design philosophy is to not perform any polling in the core.
> The modem driver has to take care of this.
>
> Ok. So in case of the atmodem driver, would it be correct to move this
> retrying of AT+CPIN? to at_cpin_cb and only call the cb from the core
> once the reply is not CME Error SIM Busy?
The SIM busy stuff is tricky. oFono reads lots of files from the SIM
before even checking CPIN. So you need to check the CPIN SIM busy
condition before signaling that the SIM is inserted. As I said, check
how other Qualcomm based devices are doing this. E.g. Huawei, ZTE, etc.
Regards,
-Denis
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Alcatel Onetouch X515 support
2012-11-08 15:43 ` Denis Kenzior
@ 2012-11-08 16:43 ` Cedric Jehasse
2012-11-08 17:29 ` Denis Kenzior
0 siblings, 1 reply; 8+ messages in thread
From: Cedric Jehasse @ 2012-11-08 16:43 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 3370 bytes --]
Hi Denis,
> The SIM busy stuff is tricky. oFono reads lots of files from the SIM
> before even checking CPIN. So you need to check the CPIN SIM busy
> condition before signaling that the SIM is inserted. As I said, check how
> other Qualcomm based devices are doing this. E.g. Huawei, ZTE, etc.
>
I've checked this, and i think we're talking about different things. From
what i understand you're talking about the sim being busy at early sim
initialization (after enabling the modem it must wait for the sim to be
ready before notifying the core a sim is inserted).
I'm talking about the sim being busy right after entering the pin. The sim
is initialized, and "AT+CPIN?" returns " +CPIN: SIM PIN". Then i enter the
pin with AT+CPIN="xxxx". Right after this the pin is checked with
"AT+CPIN?" and now it returns "+CME ERROR: 14".
In at_pin_send_cb i see that for ZTE the state is polled with
at_util_sim_state_query_new, i think this also must be done for Alcatel.
And for huawei this should probably look at ^SIMST.
I've added a log showing the issue (reproduced with a huawei dongle)
ofonod[3481]: src/modem.c:modem_change_state() old state: 0, new state: 1
ofonod[3481]: plugins/huawei.c:huawei_pre_sim() 0x8bf3b00
ofonod[3481]: PCUI: > AT^USSDMODE?\r
ofonod[3481]: src/sim.c:ofono_sim_add_state_watch() 0x8bf8f20
ofonod[3481]: src/sim.c:ofono_sim_add_state_watch() 0x8bf8f20
ofonod[3481]: PCUI: < \r\n^USSDMODE: 1\r\n\r\nOK\r\n
ofonod[3481]: PCUI: > AT^DIALMODE?\r
ofonod[3481]: PCUI: < \r\n^DIALMODE:0,2\r\n\r\nOK\r\n
ofonod[3481]: Modem support (CDC support: NDIS port)
ofonod[3481]: PCUI: > AT+GCAP\r
ofonod[3481]: PCUI: < \r\n+CME ERROR: 100\r\n
ofonod[3481]: PCUI: > AT+CRSM=192,12258,0,0,255\r
ofonod[3481]: PCUI: < \r\n+CME ERROR: 11\r\n
ofonod[3481]: PCUI: > AT+CGMI\r
ofonod[3481]: PCUI: < \r\nHuawei Technologies Co., Ltd.\r\n\r\nOK\r\n
ofonod[3481]: PCUI: > AT+CRSM=192,28421,0,0,255\r
ofonod[3481]: PCUI: < \r\n+CME ERROR: 11\r\n
ofonod[3481]: PCUI: > AT+CGMM\r
ofonod[3481]: PCUI: < \r\nE369\r\n\r\nOK\r\n
ofonod[3481]: PCUI: > AT+CRSM=192,12037,0,0,255\r
ofonod[3481]: PCUI: < \r\n+CME ERROR: 11\r\n
ofonod[3481]: PCUI: > AT+CGMR\r
ofonod[3481]: PCUI: < \r\n41.102.18.00.00\r\n\r\nOK\r\n
ofonod[3481]: PCUI: > AT+CPIN?\r
ofonod[3481]: PCUI: < \r\n+CPIN: SIM PIN\r\n\r\nOK\r\n
ofonod[3481]: drivers/atmodem/sim.c:at_cpin_cb() crsm_pin_cb: SIM PIN
ofonod[3481]: drivers/atmodem/sim.c:at_pin_retries_query()
ofonod[3481]: PCUI: > AT+CGSN\r
ofonod[3481]: PCUI: < \r\n868414001268790\r\n\r\nOK\r\n
ofonod[3481]: PCUI: > AT^CPIN?\r
ofonod[3481]: PCUI: < \r\n^SRVST: 0\r\n
ofonod[3481]: PCUI: < \r\n^CPIN: SIM PIN,3,10,3,10,2\r\n\r\nOK\r\n
ofonod[3481]: drivers/atmodem/sim.c:huawei_cpin_cb() retry counter id=9,
val=10
ofonod[3481]: drivers/atmodem/sim.c:huawei_cpin_cb() retry counter id=1,
val=3
ofonod[3481]: drivers/atmodem/sim.c:huawei_cpin_cb() retry counter id=11,
val=10
ofonod[3481]: drivers/atmodem/sim.c:huawei_cpin_cb() retry counter id=4,
val=2
ofonod[3481]: PCUI: > AT+CPIN="1111"\r
ofonod[3481]: PCUI: < \r\nOK\r\n
ofonod[3481]: PCUI: > AT+CPIN?\r
ofonod[3481]: PCUI: < \r\n+CME ERROR: 14\r\n
ofonod[3481]: Querying PIN authentication state failed
ofonod[3481]: PCUI: < \r\n^SIMST: 1,0\r\n
ofonod[3481]: plugins/huawei.c:simst_notify() 0 -> 1
Regards,
Cedric
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 4572 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Alcatel Onetouch X515 support
2012-11-08 16:43 ` Cedric Jehasse
@ 2012-11-08 17:29 ` Denis Kenzior
0 siblings, 0 replies; 8+ messages in thread
From: Denis Kenzior @ 2012-11-08 17:29 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1609 bytes --]
Hi Cedric,
On 11/08/2012 10:43 AM, Cedric Jehasse wrote:
> Hi Denis,
>
> The SIM busy stuff is tricky. oFono reads lots of files from the
> SIM before even checking CPIN. So you need to check the CPIN SIM
> busy condition before signaling that the SIM is inserted. As I
> said, check how other Qualcomm based devices are doing this. E.g.
> Huawei, ZTE, etc.
>
>
> I've checked this, and i think we're talking about different things.
> From what i understand you're talking about the sim being busy at early
> sim initialization (after enabling the modem it must wait for the sim to
> be ready before notifying the core a sim is inserted).
> I'm talking about the sim being busy right after entering the pin. The
> sim is initialized, and "AT+CPIN?" returns " +CPIN: SIM PIN". Then i
> enter the pin with AT+CPIN="xxxx". Right after this the pin is checked
> with "AT+CPIN?" and now it returns "+CME ERROR: 14".
Ah, I see now. Yes you are correct.
>
> In at_pin_send_cb i see that for ZTE the state is polled with
> at_util_sim_state_query_new, i think this also must be done for
> Alcatel. And for huawei this should probably look at ^SIMST.
Yes, the intent is for the gory details to be taken care of by the sim
atom driver. Most 'real' phone modems provide an unsolicited
notification for this. If the hardware does not provide such a
notification then you have to poll. If you can make Huawei work with
^SIMST, that would be great as well. It should work similarly to the
IFX XSIM or the MBM EPEV notification.
Regards,
-Denis
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-11-08 17:29 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-08 10:12 Alcatel Onetouch X515 support Cedric Jehasse
2012-11-08 14:16 ` Denis Kenzior
2012-11-08 15:02 ` Cedric Jehasse
2012-11-08 15:10 ` Denis Kenzior
2012-11-08 15:29 ` Cedric Jehasse
2012-11-08 15:43 ` Denis Kenzior
2012-11-08 16:43 ` Cedric Jehasse
2012-11-08 17:29 ` Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.