<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Core2, W5500 and ESP-IDF example eth2ap]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I like to use a Core2 as Wifi-AP for some small sensors. My starting point was the eth2ap example from ESP-IDF v4.3.2. I added some outputs to the example to see was going on. I changed  FLOW_CONTROL_QUEUE_TIMEOUT_MS to 500:</p>
<pre><code>#define FLOW_CONTROL_QUEUE_TIMEOUT_MS (5*100)
#define FLOW_CONTROL_QUEUE_LENGTH (40)
#define FLOW_CONTROL_WIFI_SEND_TIMEOUT_MS (100)

typedef struct {
    void *packet;
    uint16_t length;
} flow_control_msg_t;

// Forward packets from Wi-Fi to Ethernet
static esp_err_t pkt_wifi2eth(void *buffer, uint16_t len, void *eb)
{
    if (s_ethernet_is_connected) {
        if (esp_eth_transmit(s_eth_handle, buffer, len) != ESP_OK) {
            ESP_LOGE(TAG, "Wifi-&gt;ETH: Ethernet send packet failed");
        }
    }
    esp_wifi_internal_free_rx_buffer(eb);
    return ESP_OK;
}

// Forward packets from Ethernet to Wi-Fi
// Note that, Ethernet works faster than Wi-Fi on ESP32,
// so we need to add an extra queue to balance their speed difference.
static esp_err_t pkt_eth2wifi(esp_eth_handle_t eth_handle, uint8_t *buffer, uint32_t len, void *priv)
{
    esp_err_t ret = ESP_OK;
    flow_control_msg_t msg = {
        .packet = buffer,
        .length = len
    };
    if (xQueueSend(flow_control_queue, &amp;msg, pdMS_TO_TICKS(FLOW_CONTROL_QUEUE_TIMEOUT_MS)) != pdTRUE) {
        ESP_LOGE(TAG, "ETH-&gt;Wifi: send flow control message failed or timeout, length=%d", len);
        free(buffer);
        ret = ESP_FAIL;
    }
    return ret;
}

// This task will fetch the packet from the queue, and then send out through Wi-Fi.
// Wi-Fi handles packets slower than Ethernet, we might add some delay between each transmitting.
static void eth2wifi_flow_control_task(void *args)
{
    flow_control_msg_t msg;
    int res = 0;
    uint32_t timeout = 0;
    while (1) {
        if (xQueueReceive(flow_control_queue, &amp;msg, pdMS_TO_TICKS(FLOW_CONTROL_QUEUE_TIMEOUT_MS)) == pdTRUE) {
            timeout = 0;
            if (s_sta_is_connected &amp;&amp; msg.length) {
                do {
                    vTaskDelay(pdMS_TO_TICKS(timeout));
                    timeout += 2;
                    res = esp_wifi_internal_tx(WIFI_IF_AP, msg.packet, msg.length);
                } while (res &amp;&amp; timeout &lt; FLOW_CONTROL_WIFI_SEND_TIMEOUT_MS);
                if (res != ESP_OK) {
                    ESP_LOGE(TAG, "ETH-&gt;WiFi: send packet failed: %d, timeout=%d, length=%d", res, timeout, msg.length);
                }
                else {
                    ESP_LOGI(TAG, "ETH-&gt;WiFi: send packet ok: %d, timeout=%d, length=%d", res, timeout, msg.length);
                }
            }
            free(msg.packet);
        }
    }
    vTaskDelete(NULL);
}
</code></pre>
<p dir="auto">It worked sometimes: If I send 10 pings, 2-3 reached the server.  I cann't used a browser to show some small html-page.<br />
My output is:</p>
<pre><code>I (14004) wifi:new:&lt;1,0&gt;, old:&lt;1,1&gt;, ap:&lt;1,1&gt;, sta:&lt;255,255&gt;, prof:1
I (14004) wifi:station: 5e:6c:e2:e0:0f:66 join, AID=1, bgn, 20
I (14034) eth_example: Wi-Fi AP got a station connected
I (14074) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (14104) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (14174) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (14204) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
E (16534) eth_example: ETH-&gt;WiFi: send packet failed: 12309, timeout=100, length=60
I (16534) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (16534) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (16544) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (16554) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=590
I (16554) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (16564) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (16574) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (16584) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=86
I (16584) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=295
I (16594) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (16604) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=770
I (16614) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (16614) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=1314
I (16624) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=86
I (16634) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=88
I (16644) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (16644) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=590
I (16654) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=812
I (16664) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=832
I (16674) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=316
I (16674) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=336
I (16684) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=1168
I (16694) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=1188
I (16704) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=1398
I (16704) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=1418
I (16714) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=86
E (18974) eth_example: ETH-&gt;WiFi: send packet failed: 12309, timeout=100, length=60
I (18974) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (18974) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (18984) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (18994) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (18994) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (19004) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (19014) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (19014) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (19024) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=88
I (19034) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=74
I (19044) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (19044) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=590
I (19054) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (19064) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
E (21324) eth_example: ETH-&gt;WiFi: send packet failed: 12309, timeout=100, length=60
I (21324) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (21324) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (21334) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (21344) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=316
I (21344) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=336
I (21354) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=590
I (21364) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=812
I (21374) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=832
I (21374) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=1398
I (21384) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=1418
I (21394) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=1168
I (21404) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=1188
I (21404) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (21414) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (21424) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (21434) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=88
I (21434) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=107
I (21444) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=131
I (21454) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=86
I (21464) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (21464) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=86
I (21474) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=86
I (21484) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (21494) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (21494) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=705
I (21504) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (21514) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
E (22494) eth_example: ETH-&gt;Wifi: send flow control message failed or timeout, length=832
E (22994) eth_example: ETH-&gt;Wifi: send flow control message failed or timeout, length=1398
E (23494) eth_example: ETH-&gt;Wifi: send flow control message failed or timeout, length=1418
E (23774) eth_example: ETH-&gt;WiFi: send packet failed: 12309, timeout=100, length=60
I (23774) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (23774) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (23784) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (23794) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (23794) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=86
I (23804) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (23814) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=191
I (23824) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=191
I (23824) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=86
I (23834) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=60
I (23844) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=86
I (23854) eth_example: ETH-&gt;WiFi: send packet ok: 0, timeout=2, length=750
...
</code></pre>
<p dir="auto">Have anyone used the ESP32 as WiFi-AP and knows the challenges?</p>
]]></description><link>https://community.m5stack.com/topic/3910/core2-w5500-and-esp-idf-example-eth2ap</link><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Apr 2026 03:11:33 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/3910.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 09 Jan 2022 09:27:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Core2, W5500 and ESP-IDF example eth2ap on Tue, 11 Jan 2022 12:32:25 GMT]]></title><description><![CDATA[<p dir="auto">Hello Felix,</p>
<p dir="auto">thank you for your quick answer. I can ping sometimes and I cann't surf the Internet with my phone or with my computer and eth2ap-modul.</p>
<ul>
<li>
<p dir="auto">I have changed the channel the softAP is using. Small changes in quality can be seen, but no significant improvement.</p>
</li>
<li>
<p dir="auto">I tried a different wireless client, for example my computer and my phone.</p>
</li>
<li>
<p dir="auto">I used a 12V/3A power adapter on LAN-Module with W5500. The M5Core2 and the LAN module also run stably with other applications and the same power supply.</p>
</li>
</ul>
<p dir="auto">Bye,<br />
Uwe</p>
]]></description><link>https://community.m5stack.com/post/16144</link><guid isPermaLink="true">https://community.m5stack.com/post/16144</guid><dc:creator><![CDATA[sheepDog]]></dc:creator><pubDate>Tue, 11 Jan 2022 12:32:25 GMT</pubDate></item><item><title><![CDATA[Reply to Core2, W5500 and ESP-IDF example eth2ap on Mon, 10 Jan 2022 10:47:53 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/sheepdog" aria-label="Profile: sheepDog">@<bdi>sheepDog</bdi></a></p>
<p dir="auto">the eth2ap sample code runs fine on my M5Core2 w/o any modifications except adapting the GPIOs. Ping are fine and I can surf the Internet just fine from the wireless cleint.</p>
<ul>
<li>Have you tried to change the channel the softAP is using? Maybe there is too much interference in your area?</li>
<li>Have you tried with a different wireless client?</li>
<li>How are you powering the M5Core2 and LAN module? Maybe there is a power issue?</li>
</ul>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/16135</link><guid isPermaLink="true">https://community.m5stack.com/post/16135</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Mon, 10 Jan 2022 10:47:53 GMT</pubDate></item></channel></rss>