问题标签 [lwip]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
1953 浏览

c - 发送 udp 数据的空源端口(lwip、Cortex M3、Stellaris LM3S6965 评估板)

我正在使用 Cortex M3、Stellaris® LM3S6965 评估板。我正在向我的电脑发送一个 UDP 数据包。那行得通,因为我用wireshark检查了它。但我看到的是我没有源端口。我不知道如何解决这个问题。

我调用这个函数来发送一个 udp 数据包

Wireshark 数据包示例:(点此放大) 这里

0 投票
1 回答
1997 浏览

javascript - 使用 LwIP 服务器流式传输数据

我有一个运行 LwIP 服务器(v1.2)的嵌入式系统,我需要能够将数据数组流式传输到客户端的 javascript 中吗?我正在考虑使用 chrome 和一些 HTML5 功能,所以有些人建议使用 websockets。有谁知道我需要从哪里开始使用 LwIP 框架?任何帮助将不胜感激!

0 投票
1 回答
2502 浏览

api - Having difficulty sending small lwip packets immediately using the lwip API

I am creating a server on a ST Cortex M3 device. I am using the lwip API and FreeRTOS. All is working, but the response time is way off. I am currently using lwip 1.3.2 and FreeRTOS 7.3.

A single client connects to the server and must have some time-critical data sent frequently. These packets are on the order of 6 or so bytes. Other times, I am sending upwards of 20K.

The problem I am having is that these smaller packets seem to be taking forever to be sent. I assume this is because lwip is waiting for more data to be enqueued to make more efficient transmissions. I cannot wait around for 2 or 3 seconds for the data to be sent; the client is expecting the data nominally in a few micro-seconds or milli-seconds.

I have tried using lwip_send and lwip_write. (I understand that one is the same as the other with a flag passed at the end. Just had to try...) I have tried setting TCP_NODELAY on the socket to no avail. I tried to set SO_SNDLOWAT to '1', but this always returned -1, so I do not think it is supported.

I do not want to redo all of my code using TCP RAW. Is there a way to invoke the tcp_output() function outside of TCP RAW mode? Is there any way to speed things up or is this just how slow lwip TCP with small packets is?

Any and all suggestions are welcome. Thanks.

--EDIT-- I would also like to add that once I am ready to transmit, I make sure that my TX task in FreeRTOS is at the highest priority. There are no other tasks running up to the point at which I call lwip_send/write.

0 投票
1 回答
6955 浏览

c - 使用 microblaze 和 lwip 进行简单的数据传输

所以我在互联网上找不到任何简单的例子,而不是用于 microblaze 和 lwip 的 echo 程序,这对我来说很好,这里是他们的文件:echo.c:

这是 main.c :

现在我根本无法理解这段代码(其中一些但不是全部)你们能告诉我开始如何更改这段代码,而不是回显相同的数据,而是向主机发送一个包含字符串的字符串“嘿” 。谢谢你。

0 投票
1 回答
793 浏览

c - 自定义 lwip microblaze 回声示例

在回显示例中,我们有这个函数再次发送相同的数据包以便回显数据,我想更改它以便发送用户发送的任何固定数据,所以我更改了这个:

对此:

当我运行我的应用程序时,它不会回显任何内容,这是为什么呢?

0 投票
1 回答
137 浏览

c - microplaze 应用中的 lwip 缓冲液

只需我通过在接收回调函数中检查我的 pbuff 的有效负载来检查并将数据发送到我的 microplaze,它可以在我可以看到 microplaze 回显我的消息但当我尝试将它们从 mmicroplaze 打印到终端时工作(使用 printf()在c代码中)这里发生了一些奇怪的事情是打印输出:

那是什么,为什么,它发生在超过 3 个字符的任何地方.. 为什么会这样?有任何想法吗 ?

我正在使用带有 16 位总线和 4mb ram 的 microblaze 处理器的 sprtan3a。

0 投票
1 回答
1493 浏览

c - 在 FreeRTOS 中实现线程间通信的最佳方式?- 检查 lwIP 电缆的状态

我想在开启 DHCP 和 TCP 连接的情况下制作 lwip 电缆开/关防弹。两种解决方案都可以,但我不知道哪个更明智和正确。(我害怕错误的上下文函数调用)

  • 第一个解决方案:

我打电话:

然后在那之后:

所以有2个线程,主lwIP线程和hc_task线程。hc_task是:

hc_send与某个页面建立 TCP 连接以下载它。

然后我有一个间隔为 2 秒的轮询计时器,它检查 PHY 并读取电缆状态:

现在下次当电缆接通时,我会打电话:

我猜在定时器中断中调用这些函数是正确的。

  • 第二种解决方案:

第二种方法是定时器中断向主lwip线程发送消息:

定时器中断向主 lwip 线程发送一条消息以调用:

或者:

我有一个全局变量来存储电缆状态(从那个定时器中断中保存),我在主lwip线程中检查它以调用正确的函数(链接向上或向下)。

所以我问哪种解决方案是更好/正确的方法:在定时器中断调用链接向下或向上(这些是 lwip 函数)或定时器中断向主 lwIP 线程发送消息?

我的配置:微处理器 LPC1768 - LAN8720 PHY - FreeRTOS 7.4 - lwip 1.4.1 - 包括 DHCP - 包括 TCP/IP

0 投票
2 回答
17441 浏览

udp - UDP broadcast/multicast vs unicast behaviour (dropped packets)

I have an embedded device (source) which is sending out a stream of (audio) data in chunks of 20 ms (= about 330 bytes) by means of a UDP packets. The network volume is thus fairly low at about 16kBps (practically somewhat more due to UDP/IP overhead). The device is running the lwIP stack (v1.3.2) and connects to a WiFi network using a WiFi solution from H&D Wireless (HDG104, WiFi G-mode). The destination (sink) is a Windows Vista PC which is also connected to the WiFi network using a USB WiFi dongle (WiFi G-mode). A program is running on the PC which allows me to monitor the amount of dropped packets. I am also running Wireshark to analyze the network traffic directly. No other clients are actively sending data over the network at this point.

When I send the data using broadcast or multicast many packets are dropped, sometimes upto 15%. However, when I switch to using UDP unicast, the amount of packets dropped is negligible (< 2%).

Using UDP I expect packets to be dropped (which is OK in my Audio application), but why do I see such a big difference in performance between Broadcast/Multicast and unicast?

My router is a WRT54GS (FW v7.50.2) and the PC (sink) is using a trendnet TEW-648UB network adapter, running in WiFi G-mode.

0 投票
0 回答
665 浏览

c - 使用 lwip_sendto 时 mbox 无效

我正在尝试使用 freertos 中的 lwip 堆栈通过多个套接字进行基于 UDP 的通信。我的第一个问题是,套接字创建失败,因为lwip_socket调用了对 的调用netconn_new,其中包含对的调用TCPIP_APIMSG(&msg),该调用返回错误。我发现错误TCPIP_APIMSG(&msg)是因为sys_mbox_valid(&mbox)返回错误而产生的。

在认识到我创建了比 lwip 配置变量所允许的更多的 UDP 套接字后,我可以解决这个问题memp_n_udp_pcb。我只是增加了memp_n_udp_pcb

现在我遇到了lwip_sendto发送大约 300 个数据包后停止工作的问题。同样,无效的 mboxTCPIP_APIMSG(&msg)似乎是原因。lwip_sendto调用netconn_send,调用TCPIP_APIMSG(&msg),由于无效的 mbox 返回错误。

我只是尝试将 lwip 堆栈与 freertos 一起使用,但我对 lwip 堆栈的实现细节没有经验。我不知道无效的 mbox 是什么意思以及如何解决问题。

我希望有人可以向我解释这里出了什么问题。memp_n_udp_pcb当使用超过预定义数量的 4 个 UDP 套接字时,是否需要更改任何其他设置(除了)?为什么lwip_sendto发送几百个数据包没有问题后失败?

0 投票
3 回答
23822 浏览

c - gcc c错误:数字常量前应为')'

嗨,我一直在尝试将 LWIP 移植到新的 arm 设备。编译代码时,我收到错误消息:

当我转到这个文件时,我在该行找到了几个类似的宏,下面是几个类似的宏:

如果我通过定义取消激活 RAW 功能来消除对该宏的需求,则错误将移至下一个 LWIP_MEMPOL() 宏。

它似乎想在前面放一个')'的定义是这样定义的:

未定义 RAW_PCB 而是“与 MEMP_ 结合”以在枚举中创建一个元素。

我试图用 -E 选项编译整个 ting 以获取人类可编辑的目标文件,看看我是否可以在 MEMP_RAW_PCB 出现的区域周围找到任何打开的 '(' 并将 MEMP_NUM_RAW_PCB 替换为 1 但我没有找到任何人工检查呢。

有什么建议可以在这里发生,或者我可以做些什么或寻找什么来找到错误的原因?

我应该补充一点,到目前为止,我没有调用 main() 中的任何 LWIP 代码或 main() 中使用的任何函数。