|
From: | David Empson |
Subject: | Re: [lwip-users] PPP down not detected |
Date: | Wed, 20 Jun 2012 16:03:54 +1200 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 |
On 2012-06-20 08:15, Sylvain Rochet wrote:
Hi, On Tue, Jun 19, 2012 at 10:11:36PM +0300, Mehmet Ali Ekici wrote:Hi All, I have seen a problem at PPP stack. I saw that GPRS modem sends "NO CARRIER" but PPP stackt doesn't recognize it and doensn't shut the connection down. Is it the PPP stack has to detect it or driver ?The PPP stack only support the PPP protocol (+ serial and Ethernet lower layer), not the modem chat script, the "NO CARRIER" is sent before entering into PPP mode, so the driver should catch it and don't start the PPP stack.
I think Mehmet is talking about the case where the modem connection is lost unexpectedly after the PPP connection has been established.
In that case, I'd expect the serial driver to be relying on a physical Carrier Detect (CD or DCD) signal from the modem via the serial port, and using a drop in DCD to notify higher layers. Attempting to detect a string like NO CARRIER in the data stream is not a good approach, because that string could appear in normal data.
You might need to modify your initialization string to enable DCD output from the modem, e.g. AT&C1 is the command normally used with PSTN modems.
If you don't have an input on your serial port which can act as DCD (or it isn't able to be connected to the modem), you may have to get PPP to detect the loss of the peer by sending regular LCP ECHO messages with a reply timeout and retries. I don't know offhand if this is a standard feature of LWIP's PPP stack. This method is likely to be considerably slower to react to a connection loss than a hard-wired DCD signal.
[Prev in Thread] | Current Thread | [Next in Thread] |