Hi guys,

I'm really sorry but after 10 days spent with lwip stack, it's time to ask
help.
I'm working with a custom board based on stm32f103 and on ublox Leon-G100.

My first attempt was to connect the board trough the serial with pc and use
pppd to connect. the test was successfully passed, I got with a speed test
(console version) 8-14KBytes/s. The firmware was a simple pass-trough
between two uarts. pc<->board<->gprs

After that I started to work with lwip to test with a small stack directly
on board. I read that article http://lwip.wikia.com/wiki/PPP and honestly
after 5-6 hours of work I got the first result, the board was successfully
connected to the apn, I got the ip,gateway and mask but after that, no more
progress come :P

Basically I initialize the modem and put it in data mode, then I call pd =
pppOverSerialOpen(PPP_SERIAL_PORT, linkStatusCB, &connected); to link up
the connection and it goes well. At this point I declare a socket and try
to open a connection, in this way:

                /* set up address to connect to */
memset(&addr, 0, sizeof(addr));
addr.sin_len = sizeof(addr);
addr.sin_family = AF_INET;
addr.sin_port = PP_HTONS(80);
addr.sin_addr.s_addr = inet_addr("37.9.239.32");
int timeout = 10000;

/* create the socket */
s = lwip_socket(AF_INET, SOCK_STREAM, 0);
LWIP_ASSERT("s >= 0", s >= 0);

                /* first try blocking: */
/* connect */
ret = lwip_connect(s, (struct sockaddr*)&addr, sizeof(addr));
/* should have an error: "inprogress" */
LWIP_ASSERT("ret == -1", ret == -1);

the stack try to send a ppp request, 48 bytes well formatted, but no one
byte is never received from uart.

I did a lot of tests playing with some parameters but no one of them went
well. I don't want annoying you with all kind of tests I did. And yes, if
you are asking if the modem is still in data mode after pppOverSerialOpen.

Attached the log, I apologize if it is rude. If you need to change the
debug mask let me know.

All your help will be appreciated.

Thanks

Gennaro
Sending cmd:AT
Sending cmd:AT
Received response:OK
Sending cmd:AT
Received response:OK
Sending cmd:AT
Received response:OK
Sending cmd:ATE0
Received response:OK
Sending cmd:AT&K0
Received response:OK
Sending cmd:AT+CGATT=1
Sending cmd:AT+CGATT=1
Received response:OK
Sending cmd:AT+CGDCONT=1,"IP","internet.wind","0.0.0.0",0,0
Received response:OK
Sending cmd:ATD*99***1#
Received response:CONNECT
lcp_init: xmit_accm=0 0 0 0
upap_init: 0
pppOverSerialOpen: unit 0: Connecting
pppStart: unit 0
ppp_set_xaccm[0]: outACCM=0 0 0 0
ppp_send_config[0]: outACCM=FF FF FF FF
ppp_recv_config[0]: inACCM=0 0 0 0
lcp_lowerup: asyncmap=0 0 0 0
LCP: lowerup state 0 (LS_INITIAL) -> 2 (LS_CLOSED)
auth_reset: 0
lcp_addci: L opt=2 0
lcp_addci: L opt=5 34DE8CCF
lcp_addci: opt=7
lcp_addci: opt=8
pppWrite[0]: len=45
fsm_sdata(LCP): Sent code 1,1,20.
LCP: sending Configure-Request, id 1
LCP: open state 2 (LS_CLOSED) -> 6 (LS_REQSENT)
pppStart: finished
pppInProc[0]: got 7 bytes
pppInProc[0]: got 26 bytes
pppInProc[0]: got 28 bytes
pppInPropppInput[0]:0]: LCP len LCP len=20
                                          =20
                                             tes
fsLCP):1,1,20
fsm_rconfreLCP): Rcvd q(LCP): Rcvdid 1 state= id 1 state=6 6 (LS_REQSENT)
lcp_reqci: rcvd ASYNCMAP=0 MAGICNUMBER (EDB65B05) PCOMPRESSION ACCOMPRESSION
lcp_reqci: returning CONFACK.
pppWrite[0]: len=46
fsm_sdata(LCP): Sent code 2,1,20.
pppInput[0]: packet processed
pppInput[0]: LCP len=20
fsm_input(LCP):2,1,20
fsm_rconfack(LCP): Rcvd id 1 state=8 (LS_ACKSENT)
lcp_acki: Ack
ppp_send_config[0]: outACCM=0 0 0 0
ppp_recv_config[0]: inACCM=0 0 0 0
pppWrite[0]: len=16
fsm_sdata(LCP): Sent code 9,0,8.
link_established: unit 0; Lowering up all protocols...
upap_lowerup: init 0 clientstate s=0
IPCP: lowerup state 0 (LS_INITIAL) -> 2 (LS_CLOSED)
pppWrite[0]: len=30
fsm_sdata(IPCP): Sent code 1,1,22.
IPCP: sending Configure-Request, id 1pppInProc[0
pppIntesen state 2 (L state 2 (LSS_CLO
        SED) -> Proc[0]: go6 (LS_REQSENt 5 bytes
                                                T)
pppInput[0]: packet processed
pppInput[0]: LCP len=8
fsm_input(LCP):10,0,8
fsm_input(LCP): default:
pppInput[0]: packet processed
pppInProc[0]: got 11 bytes
pppInProc[0]: got 27 bytes
ppppInput[0]pInput[0]: I: IPCP len=PCP len=10
                                             e10
fsm_inps
        ut(IPCP):1,1,10
fsm_rconfreq(IPCP): Rcvd id 1 state=6 (LS_REQSENT)
ipcp_reqci: ADDR 10.185.66.145
ipcp_reqci: returning Configure-ACK
pppWrite[0]: len=18
fsm_sdata(IPCP): Sent code 2,1,10.
pppInput[0]: packet processed
pppInput[0]: IPCP len=22
fsm_input(IPCP):3,1,22
fsm_rconfnakrej(IPCP): Rcvd id 1 state=8 (LS_ACKSENT)
local IP address 10.185.66.145
primary DNS address 212.52.97.25
secondary DNS address 193.70.152.25
pppWrite[0]: len=30
fsm_sdata(IPCP): Sent code 1,2,22.
IPCP: sending Configure-Request, id 2
pppInput[0]: packet processed
pppInProc[0]: got 7 bytes
pppInProc[0]: got 23 bytes
pppInput[0]: IPCP len=22
fsm_input(IPCP):2,2,22
fsm_rconfack(IPCP): Rcvd id 2 state=8 (LS_ACKSENT)
np_up: 0 proto=21
np_up: maxconnect=0 idle_time_limit=0
ipcp: up
sifup: unit 0: linkStatusCB=0x80010ad errCode=0
ip_addr = 10.185.66.145
netmask = 255.255.255.0
dns1    = 212.52.97.25
dns2    = 193.70.152.25
local  IP address 10.185.66.145
remote IP address 10.185.66.145
primary   DNS address 212.52.97.25
secondary DNS address 193.70.152.25
pppInput[0]: packet processed
0wip_socket(PF_INET, SOCK_STREAM, 0) =
 port=80)32t(0, addr=
pppifOutput[0]: proto=0x21
pppifOutput[0]: proto=0x21
pppifOutput[0]: proto=0x21
pppifOutput[0]: proto=0x21
pppifOutput[0]: proto=0x21
pppifOutput[0]: proto=0x21
pppifOutput[0]: proto=0x21
lwip_connect(0) failed, err=-10
lwip_send(0, data=0x801ce90, size=881z, flags=0x0)
lwip_send(0) err=-10 written=0z
lwip_recvfrom(0, 0x2000c60c, 1024z, 0x0, ..)
lwip_recvfrom: top while sock->lastdata=0
lwip_recvfrom: netconn_recv err=-10, netbuf=0
lwip_recvfrom(0): buf == NULL, error is "Connection aborted."!
_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to