PPP receive 16 bytes every second after connection

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

PPP receive 16 bytes every second after connection

2,127 Views
jake111
Contributor I

I create a PPP connection over serial,but after connection,the serial will receive 16 bytes data every second as the picture below .Is it a normal phenomenon?Can I send something to cancel this?

无标题.png

0 Kudos
Reply
5 Replies

2,072 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @jake111,

Could you please help us with more details about your application? What SDK are you using? Are you using RTOS? Which one are you using?

Which device or board are you using? Is it a custom or an NXP board?

Regards, Raul.

0 Kudos
Reply

2,053 Views
jake111
Contributor I

I've encountered another issue:

①I have set a Timer by calling xTinerCreate to judge if PPP is connected within 15 seconds.If not,I will call ppp_link_terminated to terminate the connection.

But after that the fsm_timeout is not canceled which may call pppos_write eventually to continue to request the connection.

②if a PPP connection is established,now I want to disconnect it,I call ppp_link_terminated.But a few seconds later,a hardfault occurs when executing pppos->output_cb in pppos_output_last.

I don't know what's the correct disconnection scheme.I think if a connection is closed,all relevant timers should be canceled.

0 Kudos
Reply

2,068 Views
jake111
Contributor I

Chip:MK64FN1M0VMD12(not an NXP Borad,it is made by myself)

SDK :SDK_2_11_0_FRDM-K64F_FULL(LwIP2.2.0)

OS:FreeRTOS

The board has a SIM card slot connecting to a 4G module using AT command to oprerate..This is the flow in my program as below:

1.reset 4G module

2.enable CMUX function using AT command "AT+CMUX=0,0,5,1024",after this,all command should follow gsm0710 protocol.

3.Initialize two virtual com channel,one for ppp frames,one for AT command.

4.call tcpip_init(NULL, NULL);

5.send a list of AT command to the ppp channel to initialize and  enable ppp.Especially AT+CGDATA="PPP",1 should be sent.

6.call pppapi_pppos_create,pppapi_set_default and pppapi_connect

7.Now the PPP data will send to UART then dispatch to PPP virtual com.Then call pppos_input_tcpip to send the data to the LwIP kernel.

The 16 bytes is received by PPP virtual com after PPP is connected.

 

0 Kudos
Reply

2,040 Views
jake111
Contributor I

the 16 bytes frame will go to the function "lcp_extcode" case `ECHOREQ` and the 16 bytes frame will echo back to the peer.

 

I find two links about it:

https://www.eit.lth.se/ppplab/PPPdocs/PPPLCPoverview.htm 

https://www.freesoft.org/CIE/RFC/1661/28.htm 

It seems the peer device send the ECHO-REQUEST every second to check the connection.Does it mean the ralative setting to cancel this is in 4G module side?

0 Kudos
Reply

2,000 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @jake111,

Could you please try with ppp_close() or pppapi_close() to terminate your connection?

RaulRomero_0-1671230787253.png

Also, please check it out the lwIP: PPP information, there you may find content of how to do a PPP connection. It may come in handy.

 

Related with the frame behavior you got the PPP LCP code as 09, that means someone is doing an Echo-Request that provides a loopback mechanism to check what are the other side doing at the moment.

Please check the file lwip->src->netif->ppp->lcp.c and the LCP-related command-line options. There could be something useful for your issue.

RaulRomero_1-1671230787258.png

[Function static option_t lcp_option_list[]]

Best regards, Raul.

0 Kudos
Reply