Hello everyone
I am trying to unlock a SIM card on the C027_U20.
My code is the following:
#include "mbed.h"
//------------------------------------------------------------------------------------
/* This example was tested on C027-U20 and C027-G35 with the on board modem.
Additionally it was tested with a shield where the SARA-G350/U260/U270 RX/TX/PWRON
is connected to D0/D1/D4 and the GPS SCL/SDA is connected D15/D15. In this
configuration the following platforms were tested (it is likely that others
will work as well)
- U-BLOX: C027-G35, C027-U20, C027-C20 (for shield set define C027_FORCE_SHIELD)
- NXP: LPC1549v2, LPC4088qsb
- Freescale: FRDM-KL05Z, FRDM-KL25Z, FRDM-KL46Z, FRDM-K64F
- STM: NUCLEO-F401RE, NUCLEO-F030R8
mount resistors SB13/14 1k, SB62/63 0R
*/
#include "GPS.h"
#include "MDM.h"
//------------------------------------------------------------------------------------
// You need to configure these cellular modem / SIM parameters.
// These parameters are ignored for LISA-C200 variants and can be left NULL.
//------------------------------------------------------------------------------------
//! Set your secret SIM pin here (e.g. "1234"). Check your SIM manual.
#define SIMPIN "4986"
/*! The APN of your network operator SIM, sometimes it is "internet" check your
contract with the network operator. You can also try to look-up your settings in
google: https://www.google.de/search?q=APN+list */
#define APN "internet.eplus.de"
//! Set the user name for your APN, or NULL if not needed
#define USERNAME "blau"
//! Set the password for your APN, or NULL if not needed
#define PASSWORD "blau"
//------------------------------------------------------------------------------------
int main(void)
{
printf("start\n");
MDMParser::DevStatus devStatus = {};
bool ok;
MDMSerial mdm;
mdm.setDebug(3);
ok = mdm.init(SIMPIN, &devStatus, P2_6);
mdm.dumpDevStatus(&devStatus);
printf("ok?: %i\n", ok);
}
If I read the debug output I get the following:
start
[32mModem::wakeup
[39m 0.275 AT send 4 "AT\r\n"
1.578 AT send 4 "AT\r\n"
2.882 AT send 4 "AT\r\n"
4.184 AT send 4 "AT\r\n"
4.227 AT read [33mUNK[39m 3 "AT\r"
4.270 AT read [32mOK [39m 6 "\r\nOK\r\n"
[32mModem::init
[39m 4.343 AT send 7 "AT E0\r\n"
4.386 AT read [33mUNK[39m 6 "AT E0\r"
4.436 AT read [32mOK [39m 6 "\r\nOK\r\n"
4.493 AT send 11 "AT+CMEE=2\r\n"
4.536 AT read [32mOK [39m 6 "\r\nOK\r\n"
4.593 AT send 15 "AT+IPR=115200\r\n"
4.653 AT read [32mOK [39m 6 "\r\nOK\r\n"
4.742 AT send 5 "ATI\r\n"
4.795 AT read [33mUNK[39m 20 "\r\nLISA-U200-02S-00\r\n"
4.871 AT read [32mOK [39m 6 "\r\nOK\r\n"
4.920 AT send 16 "AT+UGPIOC=20,2\r\n"
4.980 AT read [32mOK [39m 6 "\r\nOK\r\n"
5.030 AT send 10 "AT+CPIN?\r\n"
5.073 AT read [36m + [39m 18 "\r\n+CPIN: SIM PIN\r\n"
5.140 AT read [32mOK [39m 6 "\r\nOK\r\n"
5.180 AT send 14 "AT+CPIN=4986\r\n"
5.240 AT read [31mERR[39m 36 "\r\n+CME ERROR: Incorrect parameters\r\n"
Modem::devStatus
Power Save: Disabled
ok?: 0
[32mModem::powerOff
[39m 5.396 AT send 12 "AT+CPWROFF\r\n"
5.696 AT read [32mOK [39m 6 "\r\nOK\r\n"
So for me this looks like I can not unlock the SIM card, but the PIN is correct and the SIM card works perfect in a normal smartphone.
Any ideas what I'm doing wrong?
Hello everyone
I am trying to unlock a SIM card on the C027_U20.
My code is the following:
If I read the debug output I get the following:
So for me this looks like I can not unlock the SIM card, but the PIN is correct and the SIM card works perfect in a normal smartphone.
Any ideas what I'm doing wrong?