PPP connection problem Help needed

Hi,
I am just about to finish commercial project which is a scada gateway. Afteer finalizing this issue we will be ready for a 500 products to be sold for beginnig. So I have to solve this problem. I am developing with spider but the final product will be with emx module. ver 4.1
I am trying to make a PPP connection with both telit GSM module and Thuraya satallite module. There is no problem with telit. But I couldnt make a ppp connection with thuraya.
I did the same project with pic and I was able to establish PPP connection with TNS010i chip ( http://www.tcpipchip.com/product.html ) which has a tcp stack pap authentication. When I heard about emx module and tcp stack libraries, I thought to re write the project with c# and not using extra tns010i chip just to make a ppp connectiion.
I have used both the exaple in 4.1 sdk and my code aswell. Tried all the baudrates, handshake choices…etc.
Attaching both code and output.


namespace ppp
{
    public class Program
    {
        public static OutputPort THURAYA_ON;
        public static OutputPort THURAYA_RESET;

        public static OutputPort telit_RESET;        
        public static OutputPort telit_on_of;  
     
     
        static SerialPort THURAYA_UART = new SerialPort("COM2", 19200, Parity.None, 8, StopBits.One);
        static void UART_YAZ(SerialPort UART, string KOMUT, bool SATIRSONU_EKLE)
        {
           
           
            Thread.Sleep(100);
            if (SATIRSONU_EKLE)
                KOMUT = KOMUT + "\r";
            byte[] buffer1 = Encoding.UTF8.GetBytes(KOMUT);

            UART.Write(buffer1, 0, buffer1.Length);
            Thread.Sleep(100);
        }
        static void THURAYA_UART_DataReceived(object sender, SerialDataReceivedEventArgs e)
        {
          
            byte[] buffer = new byte[THURAYA_UART.BytesToRead];
            THURAYA_UART.Read(buffer, 0, buffer.Length);
            THURAYA_UART.DiscardInBuffer();
          THURAYA_UART.Flush();
            string output_imu = bytesToString(buffer);
            Debug.Print( output_imu);
        

           
        }
        static void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
        {

            if (e.IsAvailable)
            {
                if (PPP.IsLinkConnected)
                {
                    Debug.Print("PPP ok!");
                }
            }
            else
            {
                if (!PPP.IsLinkConnected)
                {
                    Debug.Print("PPP connection was dropped or disconnected!");
                  
                }
            }
        }

        static void modem_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
        {
            Debug.Print("error!!");
            // Serial communication is loosing data
        }

        public static string bytesToString(byte[] bytes)
        {
            string s = "";
            for (int i = 0; i < bytes.Length; ++i)
                s += (char)bytes[i];
            return s;
        }

        public static void Main()
        {
            NetworkChange.NetworkAvailabilityChanged += new NetworkAvailabilityChangedEventHandler(NetworkChange_NetworkAvailabilityChanged);
            THURAYA_UART.Handshake = Handshake.None ;

            THURAYA_UART.ErrorReceived += new SerialErrorReceivedEventHandler(modem_ErrorReceived);
            NetworkInterface[] netif = NetworkInterface.GetAllNetworkInterfaces();
    
            THURAYA_UART.Open();
            
           THURAYA_UART.DataReceived += new SerialDataReceivedEventHandler(THURAYA_UART_DataReceived);
    
   

     THURAYA_ON = new OutputPort((Cpu.Pin)EMX.Pin.IO67, true  );
          Thread.Sleep(3000);
       

     THURAYA_ON.Write(false);

            
                     
                         Thread.Sleep(2000);    
            
               UART_YAZ(THURAYA_UART, "AT", true);
               Thread.Sleep(100);
               UART_YAZ(THURAYA_UART, " AT&K=0", true);
               Thread.Sleep(100);
                         UART_YAZ(THURAYA_UART, "AT+CMEE=2", true);
                         Thread.Sleep(100);
                     UART_YAZ(THURAYA_UART, "AT+CREG?", true);
                     Thread.Sleep(100);
                     UART_YAZ(THURAYA_UART, "AT+csq", true);
                     Thread.Sleep(100);
                         UART_YAZ(THURAYA_UART, "AT+GPSFIXREQ", true);

                         UART_YAZ(THURAYA_UART, "AT+FLO=2", true);
                 
                     UART_YAZ(THURAYA_UART, "ATH", true);
                     UART_YAZ(THURAYA_UART, "ATE", true);
                   
                     UART_YAZ(THURAYA_UART, "AT+csq", true);

                     UART_YAZ(THURAYA_UART, "AT+CGDCONT=1,\"IP\",\"get\"", true);
            
            UART_YAZ(THURAYA_UART, "AT+CGACT=1,1", true);
          
                       PPP.Enable(THURAYA_UART);
                       UART_YAZ(THURAYA_UART, "ATD*99***1#\r", true);
                       Debug.Print("Connecting PPP");
                       PPP.Connect("", "");

                      
            ATcommander at = new ATcommander(THURAYA_UART);
                
          
                       while (true)
                       {
                           switch (PPP.Connect("", ""))
                           {
                               case PPP.ConnectionStatus.Authentication_Faild:
                                   Debug.Print("Authentication_Faild");
                                   break;
                               case PPP.ConnectionStatus.Connection_Faild:
                                   Debug.Print("Connection_Faild");
                                   break;
                               case PPP.ConnectionStatus.Connected:
                                   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]);
                                   break;
                               case PPP.ConnectionStatus.Disconnected:
                                   Debug.Print("Disconnected");
                                   break;

                          
                       }


output:
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\GHI Electronics\GHI NETMF v4.1 SDK\Assemblies\le\GHIElectronics.NETMF.Native.dll’
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\GHI Electronics\GHI NETMF v4.1 SDK\Assemblies\le\GHIElectronics.NETMF.Hardware.dll’
The thread ‘’ (0x2) has exited with code 0 (0x0).

OK

OK

OK

+CSQ:
37, 99

OK

+GPSFI
XREQ: 0

OK

OK

OK

OK

+CSQ:
37, 99

OK

OK

Connecting PPP
PPP connection was dropped or disconnected!

ERROR

CONNECT
~ÿ}!}!}!} }8}!}$}&@ }%}&y¶ñ’}“}&} } } } }'}”}(}“}^b~~ÿ}!}!}”} }8}!}$}&@ }%}&üÂóI}“}&} } } } }'}”}(}“Å}%~
~ÿ}!}”
}!} }}"
}&ÿÿÿÿ¨ü~
~ÿ}!}"
}!} }
}"
}&ÿÿÿÿ¨ü~
~ÿ}!}!
}#} }8}!
}$}&@ }%}
&©CÈh}“}&} } } }
}'}”}(}“™S~
~ÿ}!}”
}!} }}"
}&ÿÿÿÿ¨ü
~~ÿ}!}!}$} }8}
!}$}&@ }%}&7ˆT>}"
}&} } } } }‘}“}(
}”}+<~
~ÿ}!}!
}%} }8}!
}$}&@ }%}
&o3÷}"}&} } } }
}’}“}(}”§~
~ÿ}!}"
}!} }
}"
}&ÿÿÿÿ¨ü~
~ÿ}!}!
}&} }8}!
}$}&@ }%}
&}2x]Þ}“}&} } }
} }'}”}(}"Êw~
~ÿ}!}!
}'} }8}!
}$}&@ }%}
&} } } }

Ҽ^~
~ÿ}!}”
}!} }}"
}&ÿÿÿÿ¨ü~
~ÿ}!}!
}(} }8}!
}$}&@ }%}
&s‹@ á}“}&} } } }
}'}”}(}“™ù~
~ÿ}!
PPP connection was dropped or disconnected!
Connection_Faild
}”}!} }
}"}&ÿÿÿÿ

}!} }$ðâ
~
~ÿ}!}"
}!} }}"
}&ÿÿÿÿ¨ü~
~ÿ}!}"
}!} }
}"
}&ÿÿÿÿ¨ü~
~ÿ}!}!
})} }8}!
}$}&@ }%}
&} } } }
}'}"}(}
“Ïs~
~ÿ}!}!
}} }8}!
}$}&@ }%}
}&} } }
} }'}"}(
}“l~
~ÿ}!}”
}!} }
}”
}&ÿÿÿÿ¨ü~

NO CAR
RIER

+SGPSA: 0, 0


Using code tags will make your post more readable. This can be done in two ways:[ol]
Click the “101010” icon and paste your code between the

 tags or...
Select the code within your post and click the "101010" icon.[/ol]
(Generated by QuickReply)

… and the easiest way to fix the code is to click the pencil icon on your post to edit it, highlight the code, then click the 101010 button near the top of the message text and resubmit.

just saying, that level of “garbage” would seem to me to be UART BAUD rate related. Even though your module seems to be talking, I get the feeling it has a strange behaviour on BAUD rates.

any ideas? I tried all the baudrates.

Maybe you need hardware handshaking.

But the earlier project with TNS010i chip , I didnt use any handshaking. wired only tx,rx and ground.

Bay denizalp - I have bought EMX SoM, but I have some deployment problems with this module. My problem is in using the GHIElectronics.NETMF.Hardware libraries.
Could you help me?
Sevket GUNDUZ -Istanbul TURKEY.

@ sevki66 - Welcome to the forum!

It is better to start a new thread since this one is relatively old.
What kind of problem do you have?

Here is the detailed problem:

model of module is: EMX10-SM-128 form GHI electronics.

Description of the Problem is this:

  • I have installed MS.NET MicroFramework 4.1
  • I have also installed GHI NETMF v4.1 SDK on Win7 home basic
  • I have written my first program by using the assemblies
    “Microsoft.SPOT.Hardware”, “Microsoft.SPOT.Native”, “mscorlib” that are added in References.
  • I debuged (pressed F5) and deployed to EMX module.
  • My first application has been worked on module. Up to these step every thig is O.K.

But, The problem starts here:

  • In order to learn the PWM application I have added “GHIElectronics.NETMF.Hardware” assembly to the References

  • Then I have pressed F5 in emulator mod of deployment, but the message appered as
    " Error:assembly file ‘’ does not exist! load failed" .

  • when I have pressed F5 in USB mode of deployment,in other words when I want to deploy my appliction
    to the module, I am receieving the message like this “There are deployment errors Continue?”

    In the OUTPUT screen, the message shown is tis:
    “Deployment error: failed to (re)connect debugger engine to debugging target.
    The debugging target and the debugger engine failed to initialize because of unspecified device errors.
    The debugger engine thread has terminated unexpectedly with error ‘Debugger engine could not attach to debugging target.’”.

  • When I presses “yes” the error shown in error list is “An error has occured:please check your
    hardware”.

The message in “build output” is: "


Build succeeded.

Time Elapsed 00:00:00.47
------ Deploy started: Project: MFConsoleApplication3, Configuration: Release Any CPU ------
------ Deploy started: Project: MFConsoleApplication3, Configuration: Release Any CPU ------
An error has occurred: please check your hardware.
Nesne başvurusu bir nesnenin örneğine ayarlanmadı.
Source: Microsoft.SPOT.Debugger.CorDebug
Stack :
path(konum): Microsoft.SPOT.Debugger.VsProjectFlavorCfg.Deploy() c:\depot\current\CLIENT_V4_1\Framework\CorDebug\VsProjectFlavorCfg.cs içinde: satır 893
konum: Microsoft.SPOT.Debugger.VsProjectFlavorCfg.<Microsoft.VisualStudio.Shell.Interop.IVsDeployableProjectCfg.StartDeploy>b__0() c:\depot\current\CLIENT_V4_1\Framework\CorDebug\VsProjectFlavorCfg.cs içinde: satır 634
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
"

The message in “debug output” is :
"Cannot find any entrypoint! "

  • Build process is successful but deployment is not. WHY?

What can I do? I want to use the assemblies given in the GHI NETMF 4.1 SDK.

I have checked the tinyBooter and tinyCLR firmware versions. Those are 4.1.6 and 4.1.8 respectively. There is no problem.

your problem is not related to this thread. Please create a new thread just for your issue. (As an aside, there is an issue with the netmf/VS combination on PCs with Turkish language set - search for Turkish and you’ll likely find that as the first step you’ll need to correct)

Ok I think it must be related to Turkish locale.
Check this thread:

http://www.tinyclr.com/forum/topic?id=1832

Thank you very much!
The problem has just been solved as soon as possible. Solution was at the changing date format to English type.

You are welcome!