Sierra 3G card PIN authentication failure

http://forum.mikrotik.com/t/rb411u-mc8795v-and-mc8790-sim-pin-error/40855/5

I didn’t get PIN authentication to work yet using different modems from Sierra Wireless (“MC8780”, “MC8790”, “MC8785”,etc).
Here’s the full sequence of PIN authentication as it is shown on Mikrotik’s terminal log.

01:01:43 system,info device changed by system 
01:01:43 async,ppp,info umts: initializing... 
01:01:43 async,ppp,info umts: reseting link... 
01:01:45 async,debug usb3:4: sent ATH 
01:01:45 async,debug usb3:4: rcvd OK 
01:01:45 async,ppp,info umts: initializing modem... 
01:01:45 async,debug usb3:4: sent AT+CGDCONT=1,"IP","movistar.es","0.0.0.0",0,0 
01:01:45 async,debug usb3:4: rcvd OK 
01:01:45 async,debug usb3:4: sent AT+CGDCONT=1,"IP","movistar.es" 
01:01:45 async,debug usb3:4: rcvd OK 
01:01:45 async,ppp,info umts: dialing out... 
01:01:45 async,debug usb3:4: sent AT+CPIN? 
01:01:45 async,debug usb3:4: rcvd OK 
01:01:45 async,debug usb3:4: sent ATDT*99***1# 
01:01:45 async,debug usb3:4: rcvd ERROR 
01:01:45 async,debug usb3:4: resetting modem

It seems to work but, after “sent AT+CPIN?” line, “OK” is received although PIN apparently has not been validated since PIN is not sent to device yet.
As it is shown in lines below, the same sequence is different when using other 3G card (Novatel Wireless EU870D), and it works since PIN is sent for validation (“sent AT+CPIN=4507”).

01:03:20 async,ppp,info umts: initializing modem... 
01:03:20 async,debug usb4:3: sent AT+CGDCONT=1,"IP","movistar.es","0.0.0.0",0,0 
01:03:20 async,debug usb4:3: rcvd OK 
01:03:20 async,debug usb4:3: sent AT+CGDCONT=1,"IP","movistar.es" 
01:03:20 async,debug usb4:3: rcvd OK 
01:03:20 async,ppp,info umts: dialing out... 
01:03:20 async,debug usb4:3: sent AT+CPIN? 
01:03:20 async,debug usb4:3: rcvd  
01:03:20 async,debug usb4:3: rcvd +CPIN: SIM PIN 
01:03:20 async,debug usb4:3: sent AT+CPIN=4507 
01:03:21 async,debug usb4:3: rcvd OK 
01:03:21 async,debug usb4:3: sent ATDT*99***1# 
01:03:21 async,debug usb4:3: rcvd CONNECT HSDPA 3.6

I’m using ROS 5.5 version.
I hope this help anybody help me work it out.

After more testing in detail, I’ve noticed that connection process fails using models from Sierra Wireless, Novatel Wireless and Ericsson when PIN validation takes place. It fails not only with models from Sierra Wireless, as I said on previous post. Sorry for the possible confussion.

See below for standard PIN validating process. Nothe that Channel Data = 4 and Info Channel = 3.

1. 01:00:41 async,ppp,info umts: initializing modem... 
 2. 01:00:41 async,debug usb5:4: sent AT+CGDCONT=1,"IP","movistar.es","0.0.0.0",0,0 
 3. 01:00:41 async,debug usb5:4: rcvd OK 
 4. 01:00:41 async,debug usb5:4: sent AT+CGDCONT=1,"IP","movistar.es" 
 5. 01:00:41 async,debug usb5:4: rcvd OK 
 6. 01:00:41 async,ppp,info umts: dialing out... 
 7. 01:00:41 async,debug usb5:4: sent AT+CPIN? 
 8. 01:00:41 async,debug usb5:4: rcvd OK 
 9. 01:00:41 async,debug usb5:4: sent ATDT*99***1# 
10. 01:00:41 async,debug usb5:4: rcvd ERROR 
11. 01:00:41 async,debug usb5:4: resetting modem

If I set both Data Chanel and Info Channel to same channel number, and try to connect it successes. But by doing that I won’t get any modem info (via AT commands) because Info Channel is in use as a result of the connection sequence. See below.

1. 01:01:17 async,ppp,info umts: initializing modem... 
 2. 01:01:17 async,debug usb5:3: sent AT+CGDCONT=1,"IP","movistar.es","0.0.0.0",0,0 
 3. 01:01:17 async,debug usb5:3: rcvd OK 
 4. 01:01:17 async,debug usb5:3: sent AT+CGDCONT=1,"IP","movistar.es" 
 5. 01:01:17 async,debug usb5:3: rcvd OK 
 6. 01:01:17 async,ppp,info umts: dialing out... 
 7. 01:01:17 async,debug usb5:3: sent AT+CPIN? 
 8. 01:01:17 async,debug usb5:3: rcvd  
 9. 01:01:17 async,debug usb5:3: rcvd +CPIN: SIM PIN 
10. 01:01:17 async,debug usb5:3: sent AT+CPIN=4507 
11. 01:01:17 async,debug usb5:3: rcvd OK 
12. 01:01:17 async,debug usb5:3: sent ATDT*99***1# 
13. 01:01:17 async,debug usb5:3: rcvd CONNECT

Notice lines #7-#11, on line #8 an empty space or carriage return seems to be received. Carrying out the same connection sequence, using the terminal and the command “system serial-terminal”, we notice that this different behaviour really exists. See below.

> system serial-terminal usb5 channel=4	 (Data Channel)
at+cpin?
+CPIN: SIM PIN
OK

> system serial-terminal usb5 channel=3	(Info Channel)

at+cpin?
+CPIN: SIM PIN

OK

Finally, I guess the solution for this issue would be starting connection sequence using Data Channel and switch to Info Channel for those commands related to PIN validation (..), so that modem will successfuly establish connection and Info Channel will remain accessible for retrieving info.

Another approach would be using 2 different processes/threads for establishing the connection, because PIN validation subsequence MUST BE performed using Info Channel (otherwise it won’t work).

I would request Development Team to, please, check the coding related to that process for possible wrong handling of received data (via AT commands) or producing the behaviour difference I’ve reported. PIN validation is critical as well as required in my working environment, and it’s not possible to work without this feature.

Thanks in advance.