PPP connection fails
Posted: Thu May 20, 2010 7:05 am
I just came across this code snippet when searchng for PPP. It is also similar to what is in my examples.
http://forum.embeddedethernet.com/viewt ... =ppp#p1077
I am using someting similar and having issues getting the modem to connect. The SIM has been tested and is working and can make GPRS connections in a phone.
The DialPPP call seems to take forever to timeout. I am using a SIM300 modem and I can see the status LED flashing during the negotiation phase and then it stops and the function just hangs until it returns with PPP_FAIL after about 1-2 minutes.
This is the code I am using.
PPP_BAUDRATE_TO_USE = 115200;
PPP_SW_RX_FLOW = FALSE;
PPP_SW_TX_FLOW = FALSE;
MODEM_AUTOBAUD = "AT\r";
MODEM_RESET = "ATZ\r";
MODEM_ANSWER = "ATA\r";
MODEM_HANGSTRING = "ATH0\r";
// MODEM_INITSTRING = "AT&K0&C0&D0\r"; // Set below before dialing
MODEM_ENDCMDMODE = "ATO0\r";
MODEM_POSTDIAL = "\r";
MODEM_ATTNSTRING = "+++";
strcpy(DIAL_STRING, "ATD*99***1#"); // GPRS dialup
/* A reasonable set of PPP limits and negotiation settings */
pppo.Restart_Interval = 3; /* The restart interval for PPP Negotiations */
pppo.Max_Terminate = 2;
pppo.Max_Configure = 10;
pppo.Max_Failure = 10;
//pppo.TX_DESIRED_ACCM = 0xFFFFFFFF;
//pppo.RX_DESIRED_ACCM = 0xFFFFFFFF;
//pppo.TX_DESIRED_ACCM = 0x000A0000;
//pppo.RX_DESIRED_ACCM = 0x000A0000;
pppo.TX_DESIRED_ACCM = 0x00000000;
pppo.RX_DESIRED_ACCM = 0x00000000;
pppo.Chat_Login_disable = TRUE;
pppo.CHAPenable = FALSE;
pppo.SetThisInterfaceAddress = 0; /* We expect the other side to provide an address so we set ours to 0 */
pppo.SetThatInterfaceAddress = 0;
pppo.authenticate_func = NULL; /* We don't require the ISP to provide us with Username/password, we dialed him */
sprintf(InitString, "AT+CGDCONT=1,\"IP\",\"%s\",\"0.0.0.0\"\r", ConfigData.GPRS_APN);
MODEM_INITSTRING = InitString;
pppo.pUserName = ConfigData.GPRS_Username;
pppo.pPassword = ConfigData.GPRS_Password;
rv = DialPPP(SERIALPORT_TO_USE, &pppo, DIAL_STRING);
All the password and init strings are correct prior to the DialPPP call.
Dave...
http://forum.embeddedethernet.com/viewt ... =ppp#p1077
I am using someting similar and having issues getting the modem to connect. The SIM has been tested and is working and can make GPRS connections in a phone.
The DialPPP call seems to take forever to timeout. I am using a SIM300 modem and I can see the status LED flashing during the negotiation phase and then it stops and the function just hangs until it returns with PPP_FAIL after about 1-2 minutes.
This is the code I am using.
PPP_BAUDRATE_TO_USE = 115200;
PPP_SW_RX_FLOW = FALSE;
PPP_SW_TX_FLOW = FALSE;
MODEM_AUTOBAUD = "AT\r";
MODEM_RESET = "ATZ\r";
MODEM_ANSWER = "ATA\r";
MODEM_HANGSTRING = "ATH0\r";
// MODEM_INITSTRING = "AT&K0&C0&D0\r"; // Set below before dialing
MODEM_ENDCMDMODE = "ATO0\r";
MODEM_POSTDIAL = "\r";
MODEM_ATTNSTRING = "+++";
strcpy(DIAL_STRING, "ATD*99***1#"); // GPRS dialup
/* A reasonable set of PPP limits and negotiation settings */
pppo.Restart_Interval = 3; /* The restart interval for PPP Negotiations */
pppo.Max_Terminate = 2;
pppo.Max_Configure = 10;
pppo.Max_Failure = 10;
//pppo.TX_DESIRED_ACCM = 0xFFFFFFFF;
//pppo.RX_DESIRED_ACCM = 0xFFFFFFFF;
//pppo.TX_DESIRED_ACCM = 0x000A0000;
//pppo.RX_DESIRED_ACCM = 0x000A0000;
pppo.TX_DESIRED_ACCM = 0x00000000;
pppo.RX_DESIRED_ACCM = 0x00000000;
pppo.Chat_Login_disable = TRUE;
pppo.CHAPenable = FALSE;
pppo.SetThisInterfaceAddress = 0; /* We expect the other side to provide an address so we set ours to 0 */
pppo.SetThatInterfaceAddress = 0;
pppo.authenticate_func = NULL; /* We don't require the ISP to provide us with Username/password, we dialed him */
sprintf(InitString, "AT+CGDCONT=1,\"IP\",\"%s\",\"0.0.0.0\"\r", ConfigData.GPRS_APN);
MODEM_INITSTRING = InitString;
pppo.pUserName = ConfigData.GPRS_Username;
pppo.pPassword = ConfigData.GPRS_Password;
rv = DialPPP(SERIALPORT_TO_USE, &pppo, DIAL_STRING);
All the password and init strings are correct prior to the DialPPP call.
Dave...