Establishing a ppp connection fails after a connection loss

10 thoughts on “Establishing a ppp connection fails after a connection loss

  1. Hi!

     

    I try to simulate a connection loss by disconnecting the antenna after a valid ppp connection has been set up.

    After reconnecting the antenna, activating a context again and trying to set up a ppp connection, the modem always sends

    +CGEV: ME DEACT IP, , 1

    and the ppp connection fails.

    Why
    do I get this URC? Am I doing something wrong? It seems as if  IP
    Control Protocol is failing and the modem cannot receive IP
    configuration from the network. IP phase is deactivated by the modem.

    I have attached a full debug output.

    The basic steps I take to set up a ppp connection after network registration:

     

    > AT+CGATT=1

    < OK

     

    > AT+CGDCONT=1,"IP","gprswap"

    < OK

     

    > AT+CGDATA="PPP",1

    < CONNECT

     

    I
    also use AT&C0 to disable data carrier detect. When the DCD is
    disabled the modem does not hangup anymore after the data connection.

     

     

    Thanks in advance!

     

    Regards,

    Christopher

    1. Maybe I’m wrong: I cannot see AT+CGATT=1 after the registration completes? The last one is when CGREG: 2.

      1. In the failing case I see the AT+CGATT=1:

         

        Aug 22 08:26:24 mx31tt01 daemon.info ofonod[491]: Aux: > AT+CGATT=1r

        Aug 22 08:26:24 mx31tt01 daemon.info ofonod[491]: Modem: < rn+CIEV: rssi,3rn
        Aug 22 08:26:26 mx31tt01 daemon.info ofonod[491]: Aux: < rnOKrn
        Aug 22 08:26:26 mx31tt01 daemon.debug ofonod[491]: src/gprs.c:gprs_attach_callback() /telit_0 error = 0
        Aug 22 08:26:26 mx31tt01 daemon.info ofonod[491]: Aux: > AT+CGREG?r
        Aug 22 08:26:26 mx31tt01 daemon.info ofonod[491]: Modem: < rn+CGREG: 2rn
        Aug 22 08:26:26 mx31tt01 daemon.info ofonod[491]: Aux: < rn+CIEV: rssi,3rnrn+CGREG: 2rn
        Aug 22 08:26:26 mx31tt01 daemon.debug ofonod[491]: drivers/atmodem/network-registration.c:ciev_notify() Strength: 60
        Aug 22 08:26:26 mx31tt01 daemon.debug ofonod[491]: src/network.c:ofono_netreg_strength_notify() strength 60
        Aug 22 08:26:26 mx31tt01 daemon.info ofonod[491]: Modem: < rn+CGREG: 1,"271B","3068"rn
        Aug 22 08:26:26 mx31tt01 daemon.info ofonod[491]: Aux: < rn+CGREG: 1,"271B","3068"rnrn+CGREG: 2,1,"271B","3068"rnrnOKrn

         

         

        The debug output in this case looks the same as in the working case.

        1. Dear Christopher,

           

          you disconnect the antenna for 60 seconds.

          The GPRS connection should be recovered automatically after that time, without the need to restart a new connection (new PDP context activation, new PPP etc).

          The fact that network registration is lost, it doesn’t imply the PDP deactivation.

           

          Basically what are you doing, is to open a new connection while the previous PDP session is still active (you still have an IP address)

           

          In fact  CGEV: ME DEACT IP, , 1 message means that PDP context has been deactivated.

        2. Hi Cristopher,

           

          when you disconnect the antenna and reconnect it after 60 seconds, the PDP context is usually still active therefore the module still has an IP address.

          Loosing the GSM/GPRS network for a while doesn’t imply the deactivation of the previous IP address.

           

          What you are doing, it is to open a new connection and request an new IP address when the previous one is still valid.

           

          In fact the  +CGEV: ME DEACT IP, , 1 message means that PDP is deactivated, so it was active when you started the new PPP session

          1. Hi Andrea,

             

            thank you for your reply!

             

            I thought  "AT+CGATT=0"  should deactivate all contexts.

             

            If I try to deactivate the context with  AT+CGACT=0,cid  (in my case cid == 1),

            then I get   +CME ERROR: 0.

             

            Am I not supposed to deactivate the contex with +CGACT after sending ‘AT+CGATT=0’ ?

            How do I deactivate the context then?

             

            Modem: UC864G

            Firmware: 08.01.108-B006

  2. Hi Andrea,

     

    thank you for your reply!

     

    I thought  ‘AT+CGATT=0’ should deactivate all active contexts.

     

    If I try to deactivate the context with  +CGACT, I always get the response ‘+CME ERROR: 0’.

     

    Am I not supposed to send +CGACT after ‘AT+CGATT=0’ ?

    How do I deactivate the context then?

     

    Modem: UC864G

    Firmware: 08.01.108-B006

    I just saw that ‘AT+CGATT=0’ returns +CME ERROR: 30.

    1. When you reconnect the antenna, the module should automatically get registered again to the GSM/GPRS network, and PPP connection should be still active.

      Usually you don’t need to restart a new PPP session, unless you lost the registration for a long time.

       

      Wait that the module is registered again AT+CGREG? and verify that PDP is still active AT+CGACT? then you can continue you PPP session.

      1. Ok, thanks! I understand that but it should still be possible to manually deactivate the context by any means, but +CGATT and +CGACT do not work in this case and I don’t see any other possibility to do that.