Re: [lwip-users] 2 packets received in tcp and passed as only 1 with doubled size

2017-09-22 Thread Dirk Ziegelmeier
Are you aware TCP is a STREAM protocol, NOT a PACKET based protocol like
UDP? The behavior sounds perfectly fine.

Dirk

On Fri, Sep 22, 2017 at 5:24 PM, gussabina  wrote:

> Hello:
>
> I'm using lwIP 1.4.1 with FreeRTOS 7.30 running on Atmel ATSAM4E, with an
> application creating a tcp (mqtt) connection to the cloud via ethernet. I
> noticed in some cases, where 2 consecutive packets are sent from the cloud
> (in a very short time between them), even when 2 TCP segments are received
> in the ethernet interface (as observed in wireshark), the stack passes only
> one packet with double size
> In this case the application fails as it's not what would expect
>
> How can this be avoided?
>
> Thanks
> Gus
>
>
>
> --
> Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html
>
> ___
> lwip-users mailing list
> lwip-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] Correct way to use SNTP safely

2017-09-22 Thread Dirk Ziegelmeier
Read:
http://www.nongnu.org/lwip/2_0_x/index.html
and
http://www.nongnu.org/lwip/2_0_x/pitfalls.html


Check the "Modules" section, the APIs are separated in "Callback-style"
(tcpipthread only) and "Sequential-style" (to be used from other threads)

Ciao
Dirk

On Fri, Sep 22, 2017 at 8:51 AM, Wayne Uroda  wrote:

> My mistake.
>
> Other functions I am calling:
>
> tcpip_init
> netif_add
> netif_set_default
> netif_set_up
> dhcp_start
> dns_setserver
> netbiosns_set_name
> netbiosns_init
> sntp_setservername
> sntp_init
> netconn_*
> netbuf_*
>
> When I said the other functions use the mailbox, I guess I was referring
> to the netconn and netbuf functions, because all those other ones don't
> seem to use the mailbox.
>
> I take it any function which doesn't make use of the mailbox should be
> called on the tcp thread somehow.
> What is the preferred/easiest method of doing that?
> Am I missing some key piece of "lwip for beginners" information which I
> never read in the first place?
>
> Thanks
> - Wayne
>
>
> On Fri, Sep 22, 2017 at 3:43 PM, Simon Goldschmidt 
> wrote:
>
>> Wayne Uroda wrote:
>> >> Which functions are you talking about?
>> > I am calling only sntp_setservername and sntp_init from my code.
>>
>> Ehrm, when I aske which functions you are talking about, I was referring
>> to your "Every other lwip function I've used [..]" to see if you're
>> violating threading anywhere else.
>>
>> SNTP is a callback API application and must not be used from outside
>> tcpip_thread (unless you write your own wrapper functions). Period. Nothing
>> paranoid about that.
>>
>>
>> Simon
>>
>> ___
>> lwip-users mailing list
>> lwip-users@nongnu.org
>> https://lists.nongnu.org/mailman/listinfo/lwip-users
>
>
>
> ___
> lwip-users mailing list
> lwip-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] Correct way to use SNTP safely

2017-09-22 Thread Wayne Uroda
My mistake.

Other functions I am calling:

tcpip_init
netif_add
netif_set_default
netif_set_up
dhcp_start
dns_setserver
netbiosns_set_name
netbiosns_init
sntp_setservername
sntp_init
netconn_*
netbuf_*

When I said the other functions use the mailbox, I guess I was referring to
the netconn and netbuf functions, because all those other ones don't seem
to use the mailbox.

I take it any function which doesn't make use of the mailbox should be
called on the tcp thread somehow.
What is the preferred/easiest method of doing that?
Am I missing some key piece of "lwip for beginners" information which I
never read in the first place?

Thanks
- Wayne


On Fri, Sep 22, 2017 at 3:43 PM, Simon Goldschmidt  wrote:

> Wayne Uroda wrote:
> >> Which functions are you talking about?
> > I am calling only sntp_setservername and sntp_init from my code.
>
> Ehrm, when I aske which functions you are talking about, I was referring
> to your "Every other lwip function I've used [..]" to see if you're
> violating threading anywhere else.
>
> SNTP is a callback API application and must not be used from outside
> tcpip_thread (unless you write your own wrapper functions). Period. Nothing
> paranoid about that.
>
>
> Simon
>
> ___
> lwip-users mailing list
> lwip-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/lwip-users
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users