Ajay Garg | 22 Aug 09:48 2015
Picon

TCP/IP/PPP for bare-metal

Hi All.

I started writing the following, using the link http://lwip.wikia.com/wiki/PPP

#############################################################
#include <stdio.h>
#include <unistd.h>

#include "lwip/tcpip.h"

static void tcpip_init_done(void *arg)
{
    if (arg) {
        *((char *)arg) = 1;
    }
}

int main()
{
    int setup = 0;
    printf("Initializing TCP\n");
    tcpip_init(tcpip_init_done, &setup);
    printf("Done !!!\n");

    while(1)
    {
        sleep(1);
    }
    return 0;
}
#############################################################


Following is lwipopts.h ::

#############################################################
#ifndef __LWIPOPTS_H__
#define __LWIPOPTS_H__

#define NO_SYS                      1

#endif
#############################################################



Upon compiling, it says that "main.c:18:5: warning: implicit declaration of function ‘tcpip_init’ [-Wimplicit-function-declaration]", even though lwip/tcpip.h is very much in the include-path.

Looking at lwip/tcpip.h, it seems that all the function headers are wrapped within
                                                    #if !NO_SYS



So, are there any good starting-points wherein I may implement the TCP/IP/PPP layers for bare-metal?
Is that even doable for bare-metal?


Thanks and Regards,
Ajay
_______________________________________________
lwip-users mailing list
lwip-users@...
https://lists.nongnu.org/mailman/listinfo/lwip-users
Pîrvu Mihai | 21 Aug 14:26 2015
Picon

Question regarding how to access a linux lwip application from outside.

Let's say I developed an application that uses the lwip API, on linux using the contrib/unix/ stuff. I have modified the "unixsim" application that comes by default so it serves my purpose.

I have a random server application created with lwip-socket API that runs on, let's say port 5555 and I have a public ip of let's say 188.99.99.99.

If i were to write this application using the posix API, I could easily connect to the server at 188.99.99.99:5555, but using the unix port, it creates a virtual interface "tap0", with a different set of IP and mask from my public IP from ethernet cable or wi-fi.

My question is, how can i access my application from a different network, over internet, using my public IP.

Mihai
_______________________________________________
lwip-users mailing list
lwip-users@...
https://lists.nongnu.org/mailman/listinfo/lwip-users
Sergio R. Caprile | 19 Aug 16:25 2015
Picon

Re: What should I do when tcp_err callback

I will assume you are using the RAW API, you are using no RTOS, and you
have set NO_SYS=1

A call to tcp_err callback y as indication of a problem in a connection.
It has been aborted (reset by the other end) or never setup (timeout on
connection attempt).
When called, you must free your own resources and not disturb lwIP,
since it already did what it had to do.
See the accompanying examples in the contrib tree for more information
and proper usage, you'll save a lot of time; yours and ours.

--

-- 
jo.van.montfort1 | 20 Aug 17:01 2015
Picon

memory management

Hi,

I like the lwip memory managent but HOW to point ram_heap to external memory?


Kr,Jo

_______________________________________________
lwip-users mailing list
lwip-users@...
https://lists.nongnu.org/mailman/listinfo/lwip-users
Ajay Garg | 19 Aug 11:22 2015
Picon

Opinions on using lwIP for making application GPRS-chipset-agnostic

Hi All.

We have a scenario, wherein we are developing application to be run in an embedded-scenario.
This application can be flashed on any umpteen number of micro-controllers.

This application talks to external-internet-world by interfacing through GPRS-chipsets.

These chipsets may or may-not contain embedded TCP/IP stacks within them.
Worse, even if some of them do, each of those chipsets is likely to have a non-standardised set of "extended AT commands" for TCP connection setup/methods.
This would mean that we would have to compile different versions of our application for different chipsets.


So, we were wondering if we could use lwIP to integrate the TCP/IP stack within our application, and use standard "Hayes AT commands" to talk to GPRS-chipsets (both that contain and those that do-not-contain embedded TCP/IP stacks).

Does our approach make sense? In particular, will this make our application chipset-agnostic (as far as TCP/IP connectivity is concerned)?
(Note that I haven't delved much into lwIP's code as of now, just wanted to confirm if our requirement is sensible in the lwIP-ecosystem).


We will be highly grateful for listening from you experts :) :)


Thanks and Regards,
Ajay
_______________________________________________
lwip-users mailing list
lwip-users@...
https://lists.nongnu.org/mailman/listinfo/lwip-users
Xun Chen | 11 Aug 15:20 2015

What should I do when tcp_err callback

Hi all,


I run into a problem and don't know how to handle it properly.


I am using lwip 1.4.1 to pump data out at 400kB/sec rate. After many many GB data (even Wireshark 12 crashed a few times during the process due to memory leak), I will get tcp_err callback from tcp.c::tcp_slowtmr(void)::line #974::TCP_EVENT_ERR(err_fn, err_arg, ERR_ABRT);


Below is the Wireshark capture of last moment BEFORE the tcp_err callback
https://www.dropbox.com/s/z6tsdckwuobvmnt/lastmoment.pcapng?dl=0


In the tcp_err callback, I remove all callbacks and invoke tcp_close to close the TCP socket.


lwip will continue to run, but it will not accept any more TCP connection and won't receive UDP packets.


I had this happened to me a few times


What should I do properly when tcp_err callback?

Thanks for any pointer!


XC



_______________________________________________
lwip-users mailing list
lwip-users@...
https://lists.nongnu.org/mailman/listinfo/lwip-users
Radouch, Zdenek | 10 Aug 23:32 2015

lwip full duplex?

Hi there,
I have not watched the lwip development for a while, so I just need a quick update.
I know that lwip did not support full duplex mode on sockets. Is that still the case?
That is, can a thread send() while sharing a socket with another thread waiting in recv()?
Thanks.

-Z
arcolight | 10 Aug 14:32 2015
Picon

Re: lwip ARP reply delay at first time (Dmitriy Zabotlin)

Thank you for your reply.

I'm using Atmel SAM4E16E CPU with DMA driver from Atmel XDK-ASF, so 
there is no polling, only interrupts.
Cable ok, I trying with different cables, with switch and without switch.
And I've noticed, that windows have more problems with bad FCS.

I see in wireshark, that all replies comes at one time. It seems like 
that they somewhere collected and than pushed away from some buffer.
May it be caused by bad FCS? Or this is different problem?

On 04/15/2015 07:00 PM, lwip-users-request@... wrote:
> Send lwip-users mailing list submissions to
> 	lwip-users@...
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://lists.nongnu.org/mailman/listinfo/lwip-users
> or, via email, send a message with subject or body 'help' to
> 	lwip-users-request@...
>
> You can reach the person managing the list at
> 	lwip-users-owner@...
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of lwip-users digest..."
>
>
> Today's Topics:
>
>     1. Re: lwip ARP reply delay at first time (Sergio R. Caprile)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 15 Apr 2015 09:32:28 -0300
> From: "Sergio R. Caprile" <scaprile@...>
> To: lwip-users@...
> Subject: Re: [lwip-users] lwip ARP reply delay at first time
> Message-ID: <552E5A5C.7000009@...>
> Content-Type: text/plain; charset=utf-8
>
> Dmitriy, you seem to have a non-working port and/or a non-working driver.
> FCS errors are not intentionally generated, so you can't correct them
> unless you know why they are there. So... I'll assume you mean those
> errored frames belong to the lwIP board. FCS should be correctly
> generated by a correctly initialized Ethernet chip; check your driver,
> check your cable.
> The delay between frames can be because of an RTOS task polling the chip
> instead of an interrupt driven rx framework. Check your port.
> The initial delay... if you connect two machines together without a
> hub/switch, one of them needs to reverse its function (unless you use a
> crossover cable), that might be both Ethernet chips trying to satisfy
> the other. A correctly configured chip shouldn't take long, but... check
> your driver, try with a switch or a crossover cable if you can't get a
> switch.
> In any case, you should step through your code to find some answers.
> Regards
>
Michael Steinberg | 4 Aug 18:32 2015
Picon

tcpip thread / no_sys

Hello,

during my implementation of a STM32F4 port I'm running across the
situation where I want to roll my own ip-thread, because I have more
base protocols (ptp for instance, more to come) rolling in that service
(want to use raw api) and I'm crossing thread boundaries very often. Now
the NO_SYS api would be a good match to drive lwip from my custom thread
I suppose? According to sources and documentation lwip-tcpip-thread as
well as the no_sys-api  both directly incorporate the scheduling theme
instead of passing the problem to a kind of "scheduler api", which could
be exchanged. Now obviously I need timing for my own constructs in my
thread, that way I'm basically having 2 timer schedulers running in my
custom thread (ie. my own and the one lwip is doing). Is there a way to
forward lwip's timing requirements to my "timer service" without hacking
around in lwip's sources or copying/changing it over to my own sources?

Kind regards,
Michael
Michael Steinberg | 4 Aug 18:21 2015
Picon

pbuf handling / possible bug?

Hello,

during my implementation of a zero copy port to stm32f4 I ran into some
difficulties. As in presumably all implementations, a dma chain/ring is
used to exchance data with the MAC core. I do fill the related dma
descriptors with lwip pbufs (well, custom buffers, read below). However
a situation might arise, when there is no pbuf left when a receive dma
descriptor shall be "rearmed". I could not find a mechanism where lwip
notifies me that a lwip-pbuf is available again, so I think I would have
to poll lwip for buffers, which is out of question. That's why I felt I
had to use custom pbufs, because through the custom pbuf deleter
functions I am notified in such situations. (Please correct me if I'm
wrong alltogether, I would gladly like to use lwips standard buffers,
because currently I have to manage a second "heap-like" buffer ring of
custom pbufs because of that).

Now during my custom pbuf usage I ran across situations, were lwip would
call mem_trim or other such functions, not checking for whether the
custom-pbuf-flag is set. A notable occasion would f.e. be in line
"pbuf.c":417. In my eyes it might be a lot clearer if custom pbufs are
not indicated by a flag bit, but by their own type maybe?

Kind regards,
Michael
Rishit Borad | 1 Aug 05:03 2015
Picon

Problem with SSI, does not read SSI file content, reads/writes only header.

Hello,

i am trying to implement SSI in my IOT project, I am using LPC4337 board. 

When i request a file from browser, may it be HTML or SSI, httpd.c - first sends header and than the file content. In case of HTML everything is working alright, webserver is writing to buffer & sending buffer data to the browser in that order - first header and than file content. However in case of SSI it is just sending the header and not finding the file content . As a consequence web browser shows the garbage values.
i am using only one SSI tag. but i dont think program is even reading the file because hs->tag_state is always TAG_NONE. when i read the ptr in http_write() it just gives header for SSI file.

Can anyone please help me resolve the issue.

Thanks in advance
Rishit 
_______________________________________________
lwip-users mailing list
lwip-users@...
https://lists.nongnu.org/mailman/listinfo/lwip-users

Gmane