PPPNetIf::disconnect() enhancement?

02 Jun 2011

Hi,

I use NetServicesSource with Huawei 3G UMTS stick. Disconnecting does not work correctly. I found that over 1 second is required between "+++" and AT commands. I modified PPPnetLf::disconnect() as below and confirmed that it works well.

  //  m_pIf->printf("+++\r\n");  <- deleted
  //  wait(.5);                  <- deleted
    m_pIf->write("+++", false);  <- added
    wait(1.5);                   <- added
    m_pIf->flushBuffer();
 
    GPRSErr gprsErr;  
    gprsErr = m_pIf->disconnect();

Does anyone confirm it?

Regards,

05 Jul 2011

Hallo ... I am using a HUAWEI160G. I changed the lines but I couldn't alos disconnect. I there some more ideas? Robert

06 Jul 2011

Hello Robert.

You will use "ATH" command To disconnect.

please try GPRSmodem.cpp line:233(function "setGPRSDown()") change

  len = ATIf::printf("AT+CGATT=0"); //Detach
//  if(!len)
//    return GPRS_MODEM; //Nothing was actually sent  
  wait(1);
  len = ATIf::printf("ATH");             // <-- Disconnect 3G line
  len = ATIf::printf("AT+CFUN=1,1");     // <-- Reset 3G dongle(maybe)
  return GPRS_OK;
06 Jul 2011

Hello yasumasa thank for your ideas and the expand AT-commands. In other manual i read that bevor and fater the +++ coamdn needed any time (1sec min. to 10 secs).

In my application the embeded schoud send data to an server via http client. In a function I make a stick.setup, stick.connection, http.get and stick.disconnection. In a higher function I call this function periodically (2 min periode).

I thnk there is a bug in pppClose, do you have an idea?

best regards