<?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[&quot;ESPAsyncWebServer&quot; equivalent working with LAN Module 13.2 ?]]></title><description><![CDATA[<p dir="auto"><strong>General informations :</strong></p>
<ul>
<li>M5Stack Core 2</li>
<li>LAN Module 13.2</li>
<li>Using PlatformIO with platform=platformio/espressif32@^6.9.0 &amp; board=m5stack-core2</li>
<li>M5Stack powered by USB-C</li>
</ul>
<p dir="auto"><strong>Problem :</strong><br />
I'm trying to run a web server on my M5Stack and I'll need the benefits of async to do parallel processing.</p>
<p dir="auto">Unfortunately the best-known lib “ESPAsyncWebServer” doesn't seem to be ethernet compatible, and I can't get its <a href="https://github.com/khoih-prog/AsyncWebServer_ESP32_W5500?tab=readme-ov-file#why-do-we-need-this-AsyncWebServer_ESP32_W5500-library" target="_blank" rel="noopener noreferrer nofollow ugc">variant for ethernet</a> to work with W5500, even with their example program.</p>
<p dir="auto">Do you know of another library that would work, or if you can get <a href="https://github.com/khoih-prog/AsyncWebServer_ESP32_W5500/blob/main/examples/AsyncSimpleServer_ESP32_W5500/AsyncSimpleServer_ESP32_W5500.ino" target="_blank" rel="noopener noreferrer nofollow ugc">the example library</a> to work?</p>
<p dir="auto">Thanks for your time!</p>
]]></description><link>https://community.m5stack.com/topic/6937/espasyncwebserver-equivalent-working-with-lan-module-13-2</link><generator>RSS for Node</generator><lastBuildDate>Wed, 06 May 2026 01:28:08 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/6937.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 29 Oct 2024 10:16:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to &quot;ESPAsyncWebServer&quot; equivalent working with LAN Module 13.2 ? on Thu, 31 Oct 2024 09:45:14 GMT]]></title><description><![CDATA[<p dir="auto">Thanks <a class="plugin-mentions-user plugin-mentions-a" href="/user/kuriko" aria-label="Profile: kuriko">@<bdi>kuriko</bdi></a> for your reply!</p>
<p dir="auto">With this informations I tried with this pins without success :<br />
#define INT_GPIO 35<br />
#define MOSI_GPIO 23<br />
#define MISO_GPIO 38<br />
#define SCK_GPIO 18<br />
#define CS_GPIO 33</p>
<p dir="auto">I think there must be weird things happening in the SPI initialization with M5.begin() and all that, in any case this code doesn't work:</p>
<pre><code>#include &lt;Arduino.h&gt;
#include &lt;M5Unified.h&gt;
#include &lt;M5Module_LAN.h&gt;
#include &lt;SPI.h&gt;

#define _ASYNC_WEBSERVER_LOGLEVEL_ 2
M5Module_LAN LAN;

//////////////////////////////////////////////////////////

// Optional values to override default settings
// Don't change unless you know what you're doing
#define ETH_SPI_HOST SPI3_HOST
#define SPI_CLOCK_MHZ 25

// Must connect INT to GPIOxx or not working
#define INT_GPIO 35
#define MOSI_GPIO 23
#define MISO_GPIO 38
#define SCK_GPIO 18
#define CS_GPIO 33

//////////////////////////////////////////////////////////

#include &lt;AsyncTCP.h&gt;
#include &lt;AsyncWebServer_ESP32_W5500.h&gt;

AsyncWebServer server(80);

const char *PARAM_MESSAGE = "message";

void notFound(AsyncWebServerRequest *request)
{
  request-&gt;send(404, "text/plain", "Not found");
}

void setup()
{
  M5.begin();
  Serial.begin(115200);

  if (esp_netif_init() != ESP_OK)
  {
    Serial.println("main::setup(): Error: Unable to initialize network interface");
  }

  uint8_t cs_pin = 33;
  uint8_t rst_pin = 0;
  uint8_t int_pin = 35;

  SPI.begin(SCK, MISO, MOSI, -1);
  LAN.setResetPin(rst_pin);
  LAN.reset();
  LAN.init(cs_pin);

  Serial.print(F("\nStart AsyncSimpleServer_ESP32_W5500 on "));
  Serial.print(ARDUINO_BOARD);
  Serial.print(F(" with "));
  Serial.println(SHIELD_TYPE);
  Serial.println(ASYNC_WEBSERVER_ESP32_W5500_VERSION);

  Serial.println("Default SPI pinout:");
  Serial.println("SPI_HOST:" + String(ETH_SPI_HOST));
  Serial.println("MOSI:" + String(MOSI_GPIO));
  Serial.println("MISO:" + String(MISO_GPIO));
  Serial.println("SCK:" + String(SCK_GPIO));
  Serial.println("CS:" + String(CS_GPIO));
  Serial.println("INT:" + String(INT_GPIO));
  Serial.println("SPI Clock (MHz):" + String(SPI_CLOCK_MHZ));
  Serial.println("=========================");

  ///////////////////////////////////

  // To be called before ETH.begin()
  ESP32_W5500_onEvent();

  // bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
  //            int SPI_HOST, uint8_t *W5500_Mac = W5500_Default_Mac);
  // ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
  Serial.print("Network::connectEthernet(): Connecting to Ethernet with DHCP ");
  byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
  if (!Ethernet.begin(mac))
  {
    Serial.println("Network::connectEthernet(): DHCP failed, aborting");
  }

  EthernetLinkStatus linkStatus;
  while ((linkStatus = Ethernet.linkStatus()) != LinkON)
  {
    Serial.print(".");
    delay(100);
  }

  Serial.println(" ...Connection established!");
  Serial.println("Network::connectEthernet(): IP address   : " + LAN.localIP().toString());
  Serial.println("Network::connectEthernet(): Subnet mask  : " + LAN.subnetMask().toString());
  Serial.println("Network::connectEthernet(): Gateway IP   : " + LAN.gatewayIP().toString());
  Serial.println("Network::connectEthernet(): DNS          : " + LAN.dnsServerIP().toString());
  ESP32_W5500_waitForConnect();

  ///////////////////////////////////

  server.on("/", HTTP_GET, [](AsyncWebServerRequest *request)
            { request-&gt;send(200, "text/plain", "Hello, world from AsyncSimpleServer_ESP32_W5500"); });

  // Send a GET request to &lt;IP&gt;/get?message=&lt;message&gt;
  server.on("/get", HTTP_GET, [](AsyncWebServerRequest *request)
            {
    String message;

    if (request-&gt;hasParam(PARAM_MESSAGE))
    {
      message = request-&gt;getParam(PARAM_MESSAGE)-&gt;value();
    }
    else
    {
      message = "No message sent";
    }

    request-&gt;send(200, "text/plain", "Hello, GET: " + message); });

  // Send a POST request to &lt;IP&gt;/post with a form field message set to &lt;message&gt;
  server.on("/post", HTTP_POST, [](AsyncWebServerRequest *request)
            {
    String message;

    if (request-&gt;hasParam(PARAM_MESSAGE, true))
    {
      message = request-&gt;getParam(PARAM_MESSAGE, true)-&gt;value();
    }
    else
    {
      message = "No message sent";
    }

    request-&gt;send(200, "text/plain", "Hello, POST: " + message); });

  server.onNotFound(notFound);

  server.begin();
}

void loop()
{
  delay(1000);
}
</code></pre>
]]></description><link>https://community.m5stack.com/post/26908</link><guid isPermaLink="true">https://community.m5stack.com/post/26908</guid><dc:creator><![CDATA[msauv]]></dc:creator><pubDate>Thu, 31 Oct 2024 09:45:14 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;ESPAsyncWebServer&quot; equivalent working with LAN Module 13.2 ? on Wed, 30 Oct 2024 01:35:18 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/msauv" aria-label="Profile: msauv">@<bdi>msauv</bdi></a><br />
Looking at the log, maybe the pin configuration is wrong? You can check the corresponding pins of Core2 and LAN13.2 here.<br />
<img src="https://static-cdn.m5stack.com/resource/docs/products/module/LAN%20Module%2013.2/img-f9248228-436c-435c-8f2f-97e9a772831b.webp" alt="alt text" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/26892</link><guid isPermaLink="true">https://community.m5stack.com/post/26892</guid><dc:creator><![CDATA[kuriko]]></dc:creator><pubDate>Wed, 30 Oct 2024 01:35:18 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;ESPAsyncWebServer&quot; equivalent working with LAN Module 13.2 ? on Tue, 29 Oct 2024 10:36:22 GMT]]></title><description><![CDATA[<p dir="auto">By the way, I get this info when I run it, I think the pins are wrong but no idea what to put here 😅</p>
<pre><code>Start AsyncSimpleServer_ESP32_W5500 on M5Stack Core2 with ESP32_W5500
AsyncWebServer_ESP32_W5500 v1.6.4 for core v2.0.0+
Default SPI pinout:
SPI_HOST:2
MOSI:23
MISO:19
SCK:18
CS:5
INT:4
SPI Clock (MHz):25
</code></pre>
]]></description><link>https://community.m5stack.com/post/26886</link><guid isPermaLink="true">https://community.m5stack.com/post/26886</guid><dc:creator><![CDATA[msauv]]></dc:creator><pubDate>Tue, 29 Oct 2024 10:36:22 GMT</pubDate></item></channel></rss>