freeRTOS + lwIP + ppp

nobody wrote on Wednesday, September 13, 2006:

Hello,

I tested it with the recent changes and PAP support looks good. In addition I commitd the changes to the FreeModbus STR71XTCP port in CVS.
A interesting thing to check for would be the number of allocataed/free buffers before and after a PPP connection has been closed. I think this could be done by the following test sequence:

1) print free/allocated buffers
2) start a PPP connection
3) print free/allocated buffers ( for example in
    the callback)
4) shutdown PPP connection.
5) let pppMain exit.
6) print free/allocated buffers.

If they are the same I think we have resolved all the memory leak issues. Anyway I found it very interesting that we are the first ones noticing these bugs because lwIP is quite common.

Kind regards,
  Christian Walter

nobody wrote on Wednesday, September 13, 2006:

I tested my ppp not and it is very very stable (over 50 pppOpen/Close/SIGhup cycles). I have little problem to automatic reconnection (in this moment manual simulation DSR by button because my development board has usart0 (rx,tx,rts,cts only) and debug (rx,tx) only) - it works fine now but I am still thinking I can improve that:) My device works both pppd and GPRS so I hope it is good sign. We are the first because a lof of people escape from ppp + lwIP (look at groups). We are pioneers, hihihihi.

Congratulations:)

best regards
Janusz

nobody wrote on Wednesday, September 13, 2006:

I found one page where somebody wrote the PPP doesn’t not support HDLC frames for some reconnections! I was mistake and first attention into our bug. When pppInProc gets whole PPP frames everything will be ok and pppDrop is not necessary (all memory will be free). Our PPP fully supports HDLC layer and we don’t have to implement this in sio layer like the man to solve reconnection problem. Therefore I am sure it is proper way.

Janusz

nobody wrote on Wednesday, September 13, 2006:

I did not test the whole pbuf memory of lwIP but I should accent all pointers in every ppp connection had the same address (without any leaks!).

J

nobody wrote on Thursday, September 14, 2006:

Hi Christian,

I found a little bug in your demo. The PPP will crash on pppOpen/Close sequention in special situation. The problem is in callback. I had to add to my callback PPPERR_CONNECT as no final disconnection.

Janusz

my code now:
static void pppLinkStatusCallback (void * ctx, int errCode, void * arg)
{   
    (void) ctx;

    switch (errCode) {
        case PPPERR_NONE:
            kprintf("connected\n");
            AT91C_BASE_PIOA->PIO_CODR = LED3;
            SetpppState(CONNECTED);        // connected
            if (arg == NULL) break;        // in not sure whether it is connected
            struct ppp_addrs *arg2 = arg;
            #define ip4_addrfull(x) ip4_addr1(x),ip4_addr2(x),ip4_addr3(x),ip4_addr4(x)
            kprintf("adr our: %u.%u.%u.%u ip: %u.%u.%u.%u mask: %u.%u.%u.%u\n",
                    ip4_addrfull(&arg2->our_ipaddr),
                    ip4_addrfull(&arg2->his_ipaddr),
                    ip4_addrfull(&arg2->netmask));
            kprintf("dns1: %u.%u.%u.%u dns2: %u.%u.%u.%u\n",
                    ip4_addrfull(&arg2->dns1),
                    ip4_addrfull(&arg2->dns2));           
            break;
           
        case PPPERR_CONNECT:            // it is no critical
            kprintf("connection lost, waiting…\n");
            break;
           
        default:
            kprintf("error: %d\n", errCode);
            AT91C_BASE_PIOA->PIO_SODR = LED3;
            SetpppState(DISCONNECTED);    // disconnected
            break;
    }
}

nobody wrote on Thursday, March 15, 2007:

Im looking to use freeRTOS + lwip + ppp

What I want to do is kind of the opposite. I don’t want PPP to dial out using a modem. I want to use my pc, setup a dial up connection on com1 (install a “standard modem driver”). I want to connect com1 to the SAM7X serial port. I then want to establish a dial up connection on the PC and have the SAM7x give it the proper response to get the PC to think its connected, and then supply an IP and get internet access.

If anyone can do this please email me at ray at enrtech dot com

Thanks,
Ray

fanlex wrote on Thursday, July 16, 2009:

This is an old thread, but I cannot find any demo version involving PPP with LWIP for the sam7x platform, can somone tell me where I could find one ? init phase, uart dependencies, documentation ?
I have to use GPRS with a GSM module on uart0.
I’m working with lwip version 1.3.0
thanks in advance,
Jean-Luc

serkam53 wrote on Friday, December 04, 2009:

Hi Jean-Luc

Could you move forward with PPP and lwIP?
I need to use a serial modem GSM/GPRS G24 from Motorola and I have no idea on how to use it with FreeRTOS and lwIP.
If you have any information about, this will very much apreciated.
Thanks.