PPP slow connection on FEZ Cobra


I have a PPP connection problem on FEZ Cobra.
The PPP connection on Cobra to the RAS server succeeds, but it takes 20 seconds.
The PPP connection on PC to the same RAS server takes less than 2 seconds, whith the same (Tetra)modem.
The modem is connected to COM3 of FEZ Cobra, no handshaking, with 115200 Bps, 8N1. Same parameters when connected from the PC.
See the PPP log on the attached picture.
There is a 10 second idle/timeout time, when switching from LCP to PAP, see PDUs 7 and 8.
There is a configuration option (Maximum Receive Unit = 1500) rejected by the FEZ Cobra, see PDUs 1 and 2. If needed I can provide the detailed analysis of the PPP PDUs.

What could be the cause of the 10 second timeout? Any suggestion?


How frequent do you notice this 10 delay?

Is it possible that you enable hardware handshaking? Or make sure that the hardware handshaking is disabled in the modem too.
I am afraid that for some reason FEZ Cobra is getting a delayed reply from the RAS server (probably in the modem). If you notice from the log, FEZ Cobra is sending LCP request twice! which means that FEZ Cobra waited for the Ack message and did not receive it in the internal timeout period so it sent it again.

The 10 seconds delay is always present.
I’ve tried the following modes:

  • No flow control (both FEZ COM2 and modem)
  • XOn/XOff flow control (both FEZ COM2 and modem)
  • Hw flow control enabled to FEZ COM2, with local loopback. The modem has only Rx/Tx/GND connections, so real handshaking is not possible.
    In all cases the delay is the same, there is no change…
    I do not think that is a communication/data loss problem, because the PPP requests and acks are issued and replied on both sides, and also after the PPP connection is estabilished, TCP/IP traffic is runing without data loss. There are no transmission errors either (by SerialErrorReceivedEventHandler)
    In the picture now are marked: blue background = Received by FEZ, white background: sent by FEZ.
    Thanks for your time…
    Regards, Balazs

In most of the modems, the hardware handshaking is enabled by default. There should be an AT command that disables hardware handshaking. Please make sure that it is disabled in the modem.


As I’ve mentioned in the previouse post, I’ve tested with handshake disabled in both FEZ and modem. The modem AT for this is command is AT&K0.
This is the modem I use: http://www.bos-funk-bayern.de/fileadmin/user_upload/TDR880i/TDR880i_instruction_manual.pdf

Regards, Balazs

I was asking you because we have not encounter such issue before so first assumption was it is it is something wrong between FEZ Cobra and the modem.

I don’t see any reason why FEZ Cobra would send the packet after 10 seconds. According to the internal code, it sends the PAP request as soon as LCP negotiation is done.

Maybe the only way to figure out if FEZ Cobra is getting those packets on-time by a special debugging firmware that reads the incoming packets. or using Serial port sniffer.
I will report this and schedule for a time to contact you with further debugging procedures. By that time, it would be great if you collect more information about this issue yourself. You know it will be impossible for us to try it here, we need the same modem, the same RAS, the same carrier and the same source code you are using.

By the way, why is the PAP packet empty? You don’t have specific username and password for authentication?


The provider we use, dos not require username and password for authentication. Also, any value works. I’ve also tried using dummy values, but does not change a thing.

Regards, Balazs


In a case without problems, usually how long it takes a PPP connection (to GSM/3G network) on FEZ?

Regards, Balazs


Coming back to Your comment about debuging the PPP.

I think best way to debug the PPP out would be to run on our environment a special version of it (with more traces), or the original source code of the PPP.
Since all the prerequisits for PPP are done (modem configured, connected to RAS, etc,) the only method to debug here is the PPP.Connect() itself.

The serial sniffing I do it from the wire (the TTL level IOs).
I’ve also tried on COM3 and COM2, it behaves the same.
The variation of the speed 9600, 57600, 115200 Bits/s, does not affects either.

What other informations would you need?

I am waiting for further instructions on how to debug this out…

Regards, Balazs

[quote]In a case without problems, usually how long it takes a PPP connection (to GSM/3G network) on FEZ?

It takes about 5 to 10 sec.


Is there a “next step” related to this problem?

It would be nice to know if we can fix this problem. Otherwise we need to look for alternative solution/hardware, since the long delay in the PPP connect is unacceptable for our project.


Please contact GHI directly.

Hello,I have the same problem: after modem initialization PPP.Connect() takes about 20 seconds to exit.
My modem is a Teltonika USB G10:

http://avl1.teltonika.lt/downloads/Modems/UM1000/Documentation/Modem USB G10 AT Commands.pdf

Trying to step into the PPP.Connect() funtion gives the following output:

Step into: Stepping over non-user code 'GHIElectronics.NETMF.Net.PPP.Connect’
Step into: Stepping over non-user code 'GHIElectronics.NETMF.Net.PPP.Connect’
Step into: Stepping over non-user code 'GHIElectronics.NETMF.Net.PPP.Connect’
Step into: Stepping over non-user code 'GHIElectronics.NETMF.Net.PPP.Connect’
Step into: Stepping over non-user code 'Microsoft.SPOT.Net.NetworkInformation.NetworkChange.NetworkAvailabilityChanged.add’
Step into: Stepping over non-user code 'Microsoft.SPOT.Net.NetworkInformation.NetworkChange.NetworkAvailabilityChanged.add’
Step into: Stepping over non-user code 'GHIElectronics.NETMF.Net.PPP.Connect’
Step into: Stepping over non-user code 'GHIElectronics.NETMF.Net.PPP.Connect’
Step into: Stepping over non-user code 'System.Threading.WaitHandle.WaitOne’
Step into: Stepping over non-user code 'System.Threading.WaitHandle.WaitOne’
Step into: Stepping over non-user code 'GHIElectronics.NETMF.Net.PPP.Connect’
Step into: Stepping over non-user code ‘GHIElectronics.NETMF.Net.PPP.Connect’

Same behaviour occourred to Szekely Balazs: different settings of modem/port,same result.
This modem under Windows connects in about 5 seconds(10 seconds to show google on firefox browser).

How does this modem work with EMX? does it enumerate as a USB CDC device? My point is that the delay in your case might be related to USB communication.

it is detected as USBH_DeviceType.Serial_FTDI (USB to serial device).
Note: after 20 seconds the PPP works and my app is able to transfer data on the internet.All works properly,the only problem is the 20 seconds delay on PPP connection.

We have the same issue with a direct serial connection to a Telit GC864 via com2. PPP.Connect takes a long time to return. I would agree with 20 seconds.

Im read thread and find similar problem.
My Cobra with FW need exactly 30 seconds to estabilish connection. In my project I using Motorola G24 modem, on start INIt all settings, unlock SIM(If is PIN locked) and start connecting.

Connecting method look like this:

                    Log.WriteDebugLog("Network.Modem.Connect() - Dial-in using AT commands");
                    modem.Write(new byte[] { 0x7E, 0xFF, 0x7D, 0x23, 0xC0, 0x21, 0x7D, 0x25, 0x7D, 0x2A, 0x7D, 0x20, 0x7D, 0x30, 0x2B, 0xD3, 0x45, 0xAF, 0x7D, 0x20, 0x3C, 0xCD, 0x74, 0x7D, 0x20, 0x7D, 0x20, 0x7D, 0x20, 0x7D, 0x20, 0x2A, 0x9D, 0x7E }, 0, 34);// Terminate request          

                    //Setup GPRS PDP Context
                    bool returnPDP = Write(modem, "AT+CGDCONT=1,\"IP\",\"" + APN + "\"", "OK");

                    modem.Write(Encoding.UTF8.GetBytes("ATD*99***1#\r"), 0, 12);
                    if (!PPP.IsEnabled)
                        Log.WriteDebugLog("Network.Modem.Connect() - Enabling PPP");
                        Log.WriteDebugLog("Network.Modem.Connect() - Enabling PPP Completed");

                     if (!PPP.IsLinkConnected)
                         Log.WriteDebugLog("Network.Modem.Connect() - PPP Link is not connected");
                         PPP.ConnectionStatus status = PPP.Connect(Username, Password);
                         if (status == PPP.ConnectionStatus.Connected)
                             Log.WriteDebugLog("Network.Modem.Connect() - PPP Connected");
                             Network.netif = NetworkInterface.GetAllNetworkInterfaces();
                             Debug.Print("PPP Network settings:");
                             Debug.Print("IP Address: " + netif[0].IPAddress);
                             Debug.Print("Subnet Mask: " + netif[0].SubnetMask);
                             Debug.Print("Default Getway: " + netif[0].GatewayAddress);
                             Debug.Print("DNS Server: " + netif[0].DnsAddresses[0]);
                             network_is_read = true;
                         else if (status == PPP.ConnectionStatus.Authentication_Faild)
                             Log.WriteDebugLog("Network.Modem.Connect() - PPP Authentication Failed");
                         else if (status == PPP.ConnectionStatus.Connection_Faild)
                             Log.WriteDebugLog("Network.Modem.Connect() - PPP Connection Failed");

My network provider need APN, Username and Password to estabilish connection. Settings are public avalible so I use:

modem is connected to COM2 with baudrate 115200, 8N1, Handshake=RequestToSend.

Log file from Cobra:

01/03/2009 20:42:47: Network.Modem.UnlockSIM() - SIM Ready
01/03/2009 20:42:47: Network.Modem.Connect() - Dial-in using AT commands
01/03/2009 20:42:47: Network.Modem.Connect() - Enabling PPP
01/03/2009 20:42:48: Network.Modem.Connect() - Enabling PPP Completed
01/03/2009 20:42:48: Network.Modem.Connect() - PPP Link is not connected
01/03/2009 20:43:18: Network - PPP connection was established!
01/03/2009 20:43:18: Network.Modem.Connect() - PPP Connected
PPP Network settings:
IP Address:
Subnet Mask:
Default Getway:
DNS Server:

Any sugestion or fix?

Bump. Will we some day get fix for this bug?