ppp with gprs modem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ppp with gprs modem

4,136 Views
selcukm
Contributor II

Hi,

I'm running MQX v4.1.1 on TWR-K64F120M + TWR-SER. When I try to connect to internet with a gsm modem (i.e. Cinterion BGS2T) through shell commands, I get an error. Command flow is as below:

===================

shell> gsm init

shell> gsm connect

shell> ppp connect ittyf:

PPP: Initialized on 'ittyf:'.

PPP: Attempting to establish connection. Please wait...

..........

PPP: Failed to connect to remote peer.

PPP: Connection released.

PPP: The connection attemp failed because the modem (or other connecting device) on the remote computer is out of order.

PPP: Connection released.

===================

gsm init: sends command "at+cgdcont=1,\"IP\",\"internet\",0.0.0.0\r" to modem

gsm connect: sends command "atdt*99#\r" to modem and initiates an internet call. After this command I get an "CONNECT" word. Then MQX starts to send some PPP handshake. ISP sends some but I got the error after waiting a few seconds.

Modem is connected to TWR-SER board RS232 port ( ittyf: ).

I read this topic: PPP over serial. But I guess it's about an old version of MQX. For example: I couldn't find the functions _io_ras_install("ras:") or _io_dun_install("dun:") in my code to make some fixes.

Have a nice day.

Labels (1)
8 Replies

1,871 Views
selcukm
Contributor II

Hi,

In "ppp.c" file there is the below line to create PPPrx task :

error = RTCS_task_create("PPP rx", _PPPTASK_priority, _PPPTASK_stacksize + 1000, PPP_rx_task, ppp_ptr);

Default value of _PPPTASK_stacksize variable is 0. So stack size for PPPtx and PPPrx tasks is about 1000 bytes (992 actually). In my project, Rx task is using about 1200 bytes of stack. Is this a problem with your boards? Leaving it as 1000 sounds risky.

Kind Regards,

Selcuk

0 Kudos

1,871 Views
praveens
Contributor I

Hi

We tried the above all procedure for PPP connection.

without Below mentioned Changes.

//RTCS_gate_add(ppp_conn->PPP_GATE_ADDR, INADDR_ANY, INADDR_ANY);

with this line:

RTCS_gate_add(IPCP_get_peer_addr(params.if_handle), INADDR_ANY, INADDR_ANY) ;

Components Used

1. MQX4.1.1 RTOS+MCF52259.

2. SIMCOM Modem(SIM800 R13.08)

This is working Fine for SIMCOM modem to MQX4.1.1. for initial Connection till "IP ADDRESS" receiving.

  • The received IP Addresses were 74.125.200.102
  • But the server IP was 0.0.0.0

We were able to PING Google.com.

But Unable to PING the CLIENT IP ADRESS of MQX received after PPP connection.

************************************************************************************************************************************************

We replaced below line:

//RTCS_gate_add(ppp_conn->PPP_GATE_ADDR, INADDR_ANY, INADDR_ANY);

with this line:

RTCS_gate_add(IPCP_get_peer_addr(params.if_handle), INADDR_ANY, INADDR_ANY) ;

And also with these Changes

In sh_ppp_task() function, I commented out Windows handshake call.

//sh_ppp_handshake(ppp_conn.device_name, ppp_conn.listen_flag, 10);

In sh_ppp_start() function, I replaced "_PPP_ACCM = 0;" with "_PPP_ACCM = 0x000A0000 ;".

This is working Fine for SIMCOM modem to MQX4.1.1. for initial Connection till "IP ADDRESS" receiving.

We were UNABLE  to PING google.com

**********************************************************************************************************************************************


Could us Please tell us the link to download MQX4.2.

As we seen in one of the above POSTs......

Please Reply us with the solution for the above mentioned problem.

Thank you

0 Kudos

1,871 Views
praveens
Contributor I

Hi

We tried the above all procedure for PPP connection.

without Below mentioned Changes.

//RTCS_gate_add(ppp_conn->PPP_GATE_ADDR, INADDR_ANY, INADDR_ANY);

with this line:

RTCS_gate_add(IPCP_get_peer_addr(params.if_handle), INADDR_ANY, INADDR_ANY) ;

Components Used

1. MQX4.1.1 RTOS+MCF52259.

2. SIMCOM Modem(SIM800 R13.08)

This is working Fine for SIMCOM modem to MQX4.1.1. for initial Connection till "IP ADDRESS" receiving.

  • The received IP Addresses were 74.125.200.102
  • But the server IP was 0.0.0.0

We were able to PING Google.com.

But Unable to PING the CLIENT IP ADRESS of MQX received after PPP connection.

************************************************************************************************************************************************

We replaced below line:

//RTCS_gate_add(ppp_conn->PPP_GATE_ADDR, INADDR_ANY, INADDR_ANY);

with this line:

RTCS_gate_add(IPCP_get_peer_addr(params.if_handle), INADDR_ANY, INADDR_ANY) ;

And also with these Changes

In sh_ppp_task() function, I commented out Windows handshake call.

//sh_ppp_handshake(ppp_conn.device_name, ppp_conn.listen_flag, 10);

In sh_ppp_start() function, I replaced "_PPP_ACCM = 0;" with "_PPP_ACCM = 0x000A0000 ;".

This is working Fine for SIMCOM modem to MQX4.1.1. for initial Connection till "IP ADDRESS" receiving.

We were UNABLE  to PING google.com

**********************************************************************************************************************************************


Could us Please tell us the link to download MQX4.2.

As we seen in one of the above POSTs......

Please Reply us with the solution for the above mentioned problem.

Thank you

0 Kudos

1,871 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi,

MQX4.2 is not available yet.

You can download all MQX versions form www.freescale.com/mqx

The direct link is

https://freescale.flexnetoperations.com/control/frse/product?child_plneID=683961&cert_num=183693851&...

Best regards,

Carlos Musich

Technical Support Engineer

0 Kudos

1,871 Views
selcukm
Contributor II

Now it's working. Here is a summary of modifications I've made.

In sh_ppp_task() function, I commented out Windows handshake call.

//sh_ppp_handshake(ppp_conn.device_name, ppp_conn.listen_flag, 10);

In sh_ppp_start() function, I replaced "_PPP_ACCM = 0;" with "_PPP_ACCM = 0x000A0000 ;".

And replaced below line:

//RTCS_gate_add(ppp_conn->PPP_GATE_ADDR, INADDR_ANY, INADDR_ANY);

with this line:

RTCS_gate_add(IPCP_get_peer_addr(params.if_handle), INADDR_ANY, INADDR_ANY) ;

0 Kudos

1,871 Views
selcukm
Contributor II

Hi ,

I've noticed an interesting point. I saved the conversation between MQX and ISP, imported to Wireshark to inspect thoroughly. ACK's sent from ISP contain only ACCM flag and have an option size of 6 bytes. In "lcp.c" file, MQX reads "lcp_ptr->RECV_NEG" struct and thinks that NEG_ACCM, NEG_PFC and NEG_ACFC flags are set. So It looks for 10-byte option size. I don't know why PFC and ACFC flags are set in lcp_ptr->RECV_NEG struct although they don't exist in received ACK frame.

This file is the saved conversation between MQX and ISP. You can import it to Wireshark as hexdump by selecting PPP as protocol.

https://community.freescale.com/docs/DOC-103959

Kind Regards.

0 Kudos

1,871 Views
karelm_
Contributor IV

Hi,

please check setting of Async-Control-Character-Map (global variable _PPP_ACCM). Your connection provider might require value 0x0 or 0xA. Also be aware that our PPP shell command does MS Windows specific handshake (the infamous CLIENCLIENT and CLIENTSERVER strings) unless you modified it. This handshake MUST NOT be done if you are not connecting to MS Windows machine The only way to determine exactly what is going on is to record all PPP packets and analyze them either by software or by hand. There will be a new GPRS modem example which demonstrates using PPP in cooperation with modem in MQX 4.2.0 release.

Best regards,

Karel

1,871 Views
selcukm
Contributor II

Thanks for the reply.

I commented out Windows handshake function in sh_ppp.c:

//sh_ppp_handshake(ppp_conn.device_name, ppp_conn.listen_flag, 10)

_PPP_ACCM was 0x0. I tried with 0xA and also with 0x000A000. But no success.

Current flow is like below:

...

ISP sends conf req. (requests for chap)

MQX sends NACK

ISP sends conf req. (requests for pap)

MQX sends ACK

MQX FSM is now PPP_STATE_ACK_SENT

ISP sends ACK

After receiving this ACK, in function "PPPFSM_recvconfack()" MQX detects a BAD ACK.

ISP sends ACK again

MQX says BAD ACK again.

...

In the received ACK message, the ACCM, PFC and ACFC flags are set. This makes a total of 10 bytes of data according to MQX. But ACK from ISP has only 6 bytes. This is the cause of BAD ACK. If I use the modem with a computer, I can connect to the ISP.

0 Kudos