lwip stm32-HTTP请求失败 [英] lwip stm32 - http requests failing

查看:513
本文介绍了lwip stm32-HTTP请求失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用在stm32处理器(stm32f407)上使用的套接字api运行freeRTOS和lwip 1.4.1. 总的来说,它工作得很好. 我可以使用udp和tcp发送和接收数据.

I running freeRTOS and lwip 1.4.1 with the socket api in use on an stm32 processor (stm32f407). Overall it works pretty fine. I can send and receive data with udp and tcp.

但是在3到7天的时间内,我看到了一种奇怪的行为.

But in a timewindow of 3 to 7 days I see a strange behavior.

我的问题

我的客户端(Windows 10,每秒发送1-2个HTTP请求)每隔3到7天无法发送这些请求.发生这种情况时,将连续有约10个请求失败.在极短的时间内,堆栈根本不会重新生成.

Every 3 to 7 days my client (Windows 10, which sends 1-2 HTTP-Requests per second) fails to send those requests. When this happens, there are ~10 Requests successively, which are failing. In very few moments, the stack won't regenerate at all.

我的猜测

我认为我可能在LWIP配置中配置错误. 因为堆栈使用得很好,并且在此方向上不应有任何错误

I think I have possibly missconfigured something in my LWIP config. Because the stack is well used and shouldn't have any bugs in this direction

我的以太网设置

服务器和客户端直接连接,两者之间没有交换机,集线器或路由器.

server and client are directly connected, no switch,hub or router in between.

服务器(stm32/lwip):

server (stm32/lwip):

  • 静态,192.168.168.2
  • 网络掩码,255.255.255.0

客户端(win10)eth0:

client (win10) eth0:

  • 静态,192.168.168.1
  • 网络掩码,255.255.255.0

客户端(win10)eth1:

client (win10) eth1:

  • dhcp,连接到正常工作的网络

我的尝试

目前,我正在运行测试,这些测试每秒发送〜7-8个请求,但是错误不会更频繁地出现. 我玩过lwip配置:

At the moment I have tests running which are sending ~7-8 Requests per second, but the error doesn't apply more often. I played around with the lwip config:

  • 堆栈的更多内存
  • 更多pbufs
  • 更大的pbufs
  • 有/无积压

但是一切都没有改善此连接问题. 可能是由于客户端经常重复使用的端口号会导致此问题吗?

But everything without improving of this connection problem. Could it be because of the often reused port numbers from the client, which could make this problem?

在这里,我有lwip调试输出的相关部分:

Here I have the relevant part of the lwip debuging output:

tcp debugging output

https://pastebin.com/a9JabhET

这里是Wireshark日志:

Here the Wireshark log:

hole wireshark log:

https://www.file-upload.net/download-12682664/debug_tcp_00001_20170828172950.html

这是我的lwipopts.h:

And here my lwipopts.h:

lwip configuration:

https://pastebin.com/cW0v4hF6

推荐答案

这似乎是内存问题,但由于它是暂时的,可能会导致某些内容超时. 我建议使用LwIP的内存统计功能,并启用ARP调试消息.

It seems a memory problem, but as it is temporary, it could be a timeout on something. I suggest to use the memory stats functions of LwIP, and also to enable the ARP debug messages.

这篇关于lwip stm32-HTTP请求失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆