New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TW#13173] Usage of esp_wifi_internal_tx function #677
Comments
We don't treat this function as part of public API, so you're on your own if you decide to use it. |
@igrr thanks for fast response. When this new function for sending 802.11 frames will be available? Should I tinker with |
@igrr |
Could be a couple of weeks, depending on how QA for the current version goes. |
Ok, thanks. And final question - is it possible to disable 802.11 retransmission of non-acked data frames? |
@digitalentity as @igrr said, esp_wifi_internal_tx is not a public API, it's internal only. Moreover, esp_wifi_internal_tx is only used to send ethernet packet from lwip to wifi driver after the connection is setup and the IP address got. If you want to send raw 802.11 packets, we have another API esp_wifi_80211_tx, however, this API is not ready yet, I think it will be ready in next release. Finally, when you talk about non-acked frames, do you means multicast packets? For multicast, WIFI will not retransmit the packet. |
Is |
@liuzfesp Any updates on the esp_wifi_80211_tx() API? |
Hi @serverwentdown , esp_wifi_80211_tx is already implemented in idf 2.1, but we still haven't declared it in esp_wifi.h officially because not all of it's function are full tested, we need more test about it before we publish it. This API is actually a complicated API, especially if you want to send the packet when the station or soft-AP has WiFi connections. Anyway, you can use this API if you want, the declaration: esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len); BTW, some ESP32 customer (such as Ali etc) already use this API for their application and it works well. Recently we will test it and publish it, but I still can't promise the exact publish date. |
@serverwentdown please be kindly reminder that the interface of this API may changed to:
|
But in IDF 2.1, the interface is still:
|
We are experimenting with this functionality to send custom WiFi beacon frames in a project that might be released as a product. Official support would be really helpfull and is one of the discussion points in deciding whether to stick to the ESP32. I understand and appreciate the concerns about security though. Maybe an interesting approach to protect the functionality would be some kind setting in flash only accessible using JTAG / SWD? |
Hi @seppestas , For this requirement, there's a couple of supported features that may give you what you need: ESPNOW allows you to send & receive custom connectionless 802.11 data frames. 802.11 vendor Information Element support allows you to attach arbitrary data to different 802.11 frame types in a standards compliant way. |
Hey @projectgus After some investigation, both ESPNOW and the vendor Information Element feature seem to be too restrictive for our use-case. ESPNOW sets the first 4 bytes of the MAC frame data to a combination of a "Category Code" (with a value of 127) and a Organization Identifier defined by the mac address (it is not clear to me if this last part can be overwritten by As far as I can see the data that can be added to frames using vendor information is limited to Vendor-Specific Information Elements. If it would be possible to set arbitrary 802.11 Information Elements using this function it would be a bit more useful, but we also require the ability to add non-Information Elements to the frame. |
Does |
The When setting The old Is it possible to somehow send frames with arbitrary frame counters using a new / supported function? |
Is it normal that If the addr1 is broadcast (0xFF...0xFF) then packet is transmitted once. Is this normal? I couldn't find a specification that explains this. |
Yes, @QuadCorei8085 it is normal, for unicast packet, the WiFi driver re-transmit the packet until the 802.11 ACK, which is responded by the destination, is received or the max re-transmit time reaches; for broadcast, only send one time. |
@seppestas just as you pointed out, the implementation in IDFv3.0/v2.1, the last parameter en_sys_seq has no effect. The code is ready for IDFv3.1 and now is in review status. |
@liuzfesp Hello, Can I set the retry flat to 0 to let esp send unicast only once manually? |
@malaimoo the retry should always be 0. Whether the packet should be retried and how many times the packet needs to be retried is totally controlled by internal WiFi driver. |
WiFi API has the declaration of
esp_wifi_internal_tx
which is used by lwip implementation. Is it safe to useesp_wifi_internal_tx
in own application? What are the limitations of the function? Can it be used to broadcast custom data packets? Will it send packets from a device in client mode if it is not associated with an AP?The text was updated successfully, but these errors were encountered: