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