Hello guys,
nevermind about the delay problem. It seems I was blocking the serial
interface my self by sending too much debug data through serial way too
fast.
However, the program still crashes when connected to the tcp client. It
seems as if the connection breaks: I got the error -11 after a
tcp_write. Any ideas why that would happen?
Thanks,
Julio
Am 17.11.2016 um 12:25 schrieb Julio Cesar Aguilar Zerpa:
Hi there,
I get data from a sensor every 65ms over asynchronous calls to the
serial interface of a microprocessor. I need to send that data over
ethernet (TCP) for visualization and debug, which I could do with the
help of LwIP and this mailing list.
Now I noticed that sending the data over TCP causes a delay in the
receiving of the serial data ranging from 80ms to 130ms, which is bad.
I don't see how the serial interrupts are related to the ethernet
interface. Does LwIP somehow blocks/stops serial interrupts from
ocurring?
I use tcp_write and tcp_output(tpcb), which are inside a sys_timeout
callback and I call sys_check_timeouts in my main loop.
I also noticed that if I comment tcp_output(tpcb), the server is not
able to send data returning a -1 (NO MEM) from tcp_write. However, the
serial data is received at the right frequency again.
NOTE 1: It is not ideal but I don't care if a few ethernet packages
get lost or whatever once in a while, the important thing is to keep
all other parts of the system running as they should. Maybe there is a
way to signal LwIP when it is OK to send data?
NOTE 2: I timed how long it takes my send function to send data (call
tcp_write and tcp_output) and it was 1ms, which means that even if
this functions are blocking, this time should not be a problem. So,
what is wrong?
NOTE 3: I don't know if this is caused by my configuration of
lwipopts.h but sometimes the microprocessor freezes while connected to
the visualization client. This doesn't happen when the ethernet
connection is not established.
I hope you guys can help me again. I am using version 1.4.1 (raw api).
I am relative new with the LwIP, should I use the 2.0 version?
Best Regards,
Julio
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users