<?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[[Solved]Lan Module and WiFi]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">Could be possible to use the Lan module and the WiFi at the same time? I have noticed when I stack the Lan, to the M5 Basic, I start to lose the WiFi communication, maybe I need a cap somewhere...</p>
<p dir="auto">Best regards,</p>
<p dir="auto">Elvis</p>
]]></description><link>https://community.m5stack.com/topic/763/solved-lan-module-and-wifi</link><generator>RSS for Node</generator><lastBuildDate>Fri, 01 May 2026 01:07:04 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/763.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 15 Mar 2019 08:43:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [Solved]Lan Module and WiFi on Sat, 15 Aug 2020 13:38:11 GMT]]></title><description><![CDATA[<p dir="auto">Hello again</p>
<p dir="auto">I think the following library should allow you to switch between WiFi or Ethernet OTA:</p>
<p dir="auto"><code>https://github.com/espressif/arduino-esp32/tree/master/libraries/Update</code></p>
<p dir="auto">Use it with either a <code>WiFiClient</code> or <code>EthernetClient</code> client.</p>
<p dir="auto">Cheers<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/9662</link><guid isPermaLink="true">https://community.m5stack.com/post/9662</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Sat, 15 Aug 2020 13:38:11 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Lan Module and WiFi on Sat, 15 Aug 2020 11:26:27 GMT]]></title><description><![CDATA[<p dir="auto">Hello Thomas</p>
<p dir="auto">glad to hear you've got Ethernet working.</p>
<p dir="auto">From what I can tell the HTTPUpdate library only supports OTA over WiFi connections. So in order to use Ethernet for OTA I guess you'd need to modify the HTTPUpdate library to use an Ethernet connection instead of WiFi.</p>
<p dir="auto">Greetings<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/9661</link><guid isPermaLink="true">https://community.m5stack.com/post/9661</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Sat, 15 Aug 2020 11:26:27 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Lan Module and WiFi on Fri, 14 Aug 2020 17:10:16 GMT]]></title><description><![CDATA[<p dir="auto">Thanks Felix,<br />
meanwhile i got it work with via ethernet.h , same wway like your post.</p>
<p dir="auto">But the main skill was and still is unsolved, how get it work with LAN and WIFI together.<br />
OR anway switch within one code between wifi and lan.</p>
<p dir="auto">so fare i dint found an way to update the sketch .bin via LAN.<br />
Almost all very nice codes working perfekly via WIFI webserver upload .<br />
like :<br />
"HTTPUpload&amp; upload = server.upload();"<br />
or<br />
" t_httpUpdate_return ret = ESPhttpUpdate.update(update_server, 80, update_uri, firmware_version);"</p>
<p dir="auto">but via ethernet, i am not able to get it wokrk i found nothing so fare :-/</p>
<p dir="auto">greeets Thomas</p>
]]></description><link>https://community.m5stack.com/post/9655</link><guid isPermaLink="true">https://community.m5stack.com/post/9655</guid><dc:creator><![CDATA[Thom]]></dc:creator><pubDate>Fri, 14 Aug 2020 17:10:16 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Lan Module and WiFi on Sun, 26 Jul 2020 21:23:49 GMT]]></title><description><![CDATA[<p dir="auto">Hello Thomas</p>
<p dir="auto">If I read your code correctly the UDP packets are sent out via WiFi instead of the Ethernet interface. I think you'll need to include Ethernet2 library (from M5 Stack W5500 WebServer example) and then include and declare the following:</p>
<pre><code>#include &lt;Ethernet2.h&gt;
#include &lt;EthernetUdp2.h&gt;

EthernetUDP Udp;
</code></pre>
<p dir="auto">instead of</p>
<pre><code>WiFiUDP Udp, Udp2 ;
</code></pre>
<p dir="auto">The Ethernet interface needs to be initialised as well with something like this (taken from M5Stack W5500 WebServer example):</p>
<pre><code>#define SCK 18
#define MISO 19
#define MOSI 23
#define CS 26

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = {
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
IPAddress ip(192, 168, 1, 177);

  SPI.begin(SCK, MISO, MOSI, -1);
  Ethernet.init(CS);
  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);
</code></pre>
<p dir="auto">Note: all of the above is untested and might need some additional fine tuning.</p>
<p dir="auto">Good luck!</p>
<p dir="auto">Cheers<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/9448</link><guid isPermaLink="true">https://community.m5stack.com/post/9448</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Sun, 26 Jul 2020 21:23:49 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Lan Module and WiFi on Tue, 21 Jul 2020 21:33:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/salty_good" aria-label="Profile: salty_good">@<bdi>salty_good</bdi></a> Hello, are there any solution meawhile?</p>
]]></description><link>https://community.m5stack.com/post/9393</link><guid isPermaLink="true">https://community.m5stack.com/post/9393</guid><dc:creator><![CDATA[Thom]]></dc:creator><pubDate>Tue, 21 Jul 2020 21:33:38 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Lan Module and WiFi on Thu, 25 Jul 2019 21:19:32 GMT]]></title><description><![CDATA[<p dir="auto">Hello There,  are the an way to get it solved ? :-/<br />
so far i couldn't find it.<br />
Greeets Thomas</p>
<p dir="auto"><a href="http://forum.m5stack.com/topic/763/solved-lan-module-and-wifi" target="_blank" rel="noopener noreferrer nofollow ugc">http://forum.m5stack.com/topic/763/solved-lan-module-and-wifi</a></p>
]]></description><link>https://community.m5stack.com/post/4873</link><guid isPermaLink="true">https://community.m5stack.com/post/4873</guid><dc:creator><![CDATA[Thom]]></dc:creator><pubDate>Thu, 25 Jul 2019 21:19:32 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Lan Module and WiFi on Tue, 21 May 2019 15:15:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/m5-docs" aria-label="Profile: m5-docs">@<bdi>m5-docs</bdi></a><br />
Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/elvis6m" aria-label="Profile: elvis6m">@<bdi>elvis6m</bdi></a> let me ask for an uptate , thank you, best regards Thomas</p>
]]></description><link>https://community.m5stack.com/post/4381</link><guid isPermaLink="true">https://community.m5stack.com/post/4381</guid><dc:creator><![CDATA[Thom]]></dc:creator><pubDate>Tue, 21 May 2019 15:15:31 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Lan Module and WiFi on Tue, 07 May 2019 12:16:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/thom" aria-label="Profile: thom">@<bdi>thom</bdi></a> said in <a href="/post/4175">Lan Module and WiFi</a>:</p>
<blockquote>
<p dir="auto">" char packetBuffer[UDP_TX_PACKET_MAX_SIZE]; //buffer to hold incoming packet,"<br />
this row can be deleted.</p>
</blockquote>
]]></description><link>https://community.m5stack.com/post/4176</link><guid isPermaLink="true">https://community.m5stack.com/post/4176</guid><dc:creator><![CDATA[Thom]]></dc:creator><pubDate>Tue, 07 May 2019 12:16:42 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Lan Module and WiFi on Tue, 07 May 2019 12:12:06 GMT]]></title><description><![CDATA[<p dir="auto">Thanks <a class="plugin-mentions-user plugin-mentions-a" href="/user/elvis6m" aria-label="Profile: elvis6m">@<bdi>elvis6m</bdi></a> for your attention. Here is the siplified code,<br />
//<br />
// Ethernet Settings * i try to use Example "M5Stack/Modules/W5500/Webserver"<br />
// Problem: M5Stack LAN Module works with this settings but only seperate code not together with WiFi at same time,<br />
// _________&amp; OTA was as well not possible<br />
//  _________<a href="https://m5stack.readthedocs.io/en/master/product-documents/modules/m5stack_lan_module.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://m5stack.readthedocs.io/en/master/product-documents/modules/m5stack_lan_module.html</a><br />
//<br />
// MyProject : connect to home WiFi accesspoint, if done, then Button A pass an UDP message to 2channel LAN relais<br />
//____________connected at the RJ45 M5Stack LAN Module.<br />
// (so fare works only via home wifi accesspint to lan, but not when we connect the crossovercable to M5StackLAN)<br />
//<br />
//<br />
#include &lt;M5Stack.h&gt;<br />
#include "WiFi.h"</p>
<p dir="auto">#include &lt;WebServer.h&gt;<br />
WebServer server(80);</p>
<p dir="auto">//for static IP address configuration<br />
IPAddress staticIP(192, 168, 178, 39); //M5stack static ip<br />
IPAddress gateway(192, 168, 178, 100);   //IP Address of your WiFi Router (Gateway)<br />
IPAddress subnet(255, 255, 255, 0);  //Subnet mask<br />
IPAddress dns(192, 168, 178, 100);  //DNS</p>
<p dir="auto">#include &lt;AsyncUDP.h&gt;<br />
#include &lt;WiFiUdp.h&gt;<br />
#include &lt;ArduinoOTA.h&gt;</p>
<p dir="auto">//UDP<br />
WiFiUDP Udp, Udp2 ;<br />
char packetBuffer[UDP_TX_PACKET_MAX_SIZE]; //buffer to hold incoming packet,</p>
<p dir="auto">#define TFT_GREY 0x5AEB</p>
<p dir="auto">//SSID and Password of your WiFi router<br />
const char* WiFi_hostname = "M5Stack"; // works with M5Stack, NudeMCU , D1 Mini(Board 12E Module).<br />
const char* ssid = "test"; //"SSID"type your ssid,<br />
const char* password = "test"; //type your password,</p>
<p dir="auto">void setup() {<br />
M5.begin();<br />
M5.Lcd.clear();<br />
M5.Lcd.println("m5.begin");</p>
<p dir="auto">WiFi.setHostname(WiFi_hostname);   //Name im WiFi router<br />
<a href="//WiFi.config" target="_blank" rel="noopener noreferrer nofollow ugc">//WiFi.config</a>(staticIP, subnet, gateway, dns);<br />
WiFi.begin(ssid, password);     //Connect to your WiFi router<br />
WiFi.mode(WIFI_STA);<br />
Serial.println("");<br />
Serial.println("wiwfi");<br />
Serial.println("");<br />
M5.Lcd.println("..");</p>
<p dir="auto">// wait for connection<br />
while (WiFi.status() != WL_CONNECTED) {<br />
delay(500);<br />
Serial.print(F("."));<br />
M5.Lcd.print(F("."));<br />
}</p>
<p dir="auto">//OTA<br />
// Port defaults to 8266<br />
ArduinoOTA.setPort(8266);<br />
// Hostname defaults to esp8266-[ChipID]<br />
ArduinoOTA.setHostname(WiFi_hostname);<br />
ArduinoOTA.onStart(<a class="plugin-markdown-hidden-link small link-danger"></a> {</p>
<pre><code>M5.Lcd.clear();
M5.Lcd.println("..start update prozess" );
//  display.display();
String type;
if (ArduinoOTA.getCommand() == U_FLASH) {
  type = "sketch";
} else { // U_SPIFFS
  type = "filesystem";
}


Serial.println("Start updating " + type);
</code></pre>
<p dir="auto">});<br />
ArduinoOTA.onEnd(<a class="plugin-markdown-hidden-link small link-danger"></a> {<br />
Serial.println("\nEnd");<br />
});<br />
ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {<br />
Serial.printf("Progress: %u%%\r", (progress / (total / 100)));</p>
<pre><code>M5.Lcd.setTextSize(3);
M5.Lcd.setCursor(20, 60);
M5.Lcd.print("..update" );
M5.Lcd.print( String((progress / (total / 100))) + " % " );
</code></pre>
<p dir="auto">});<br />
ArduinoOTA.onError([](ota_error_t error) {<br />
Serial.printf("Error[ % u]: ", error);<br />
if (error == OTA_AUTH_ERROR) {<br />
Serial.println("Auth Failed");<br />
} else if (error == OTA_BEGIN_ERROR) {<br />
Serial.println("Begin Failed");<br />
} else if (error == OTA_CONNECT_ERROR) {<br />
Serial.println("Connect Failed");<br />
} else if (error == OTA_RECEIVE_ERROR) {<br />
Serial.println("Receive Failed");<br />
} else if (error == OTA_END_ERROR) {<br />
Serial.println("End Failed");<br />
}<br />
});<br />
ArduinoOTA.begin();<br />
Serial.println("Ready");<br />
M5.Lcd.setTextSize(1); //zurücksetzen<br />
//OTA ENDE</p>
<p dir="auto">startWebServer(); // starting webserver<br />
M5.Lcd.setCursor(0, 0);<br />
M5.Lcd.setTextSize(2);<br />
M5.Lcd.println(String(WiFi_hostname));<br />
M5.Lcd.println(WiFi.localIP());<br />
M5.Lcd.setTextSize(1);</p>
<p dir="auto">} // ENDE SETUP</p>
<p dir="auto">//==============================================================<br />
//xxxxxxxxxxxxxxxxxxxxxxxxxxx  LOOP  xxxxxxxxxxxxxxxxxxxxxxxxxxx<br />
//==============================================================<br />
void loop() {<br />
ArduinoOTA.handle();<br />
delay(80);<br />
server.handleClient();          //Handle client requests<br />
M5.update();<br />
if (M5.BtnA.wasReleased()) {<br />
M5.Lcd.print('A');<br />
RelaissendUDP();<br />
} else if (M5.BtnB.wasReleased()) {<br />
M5.Lcd.print('B');<br />
} else if (M5.BtnC.wasReleased()) {<br />
M5.Lcd.print('C');<br />
}<br />
} // END of LOOP</p>
<p dir="auto">void startWebServer()<br />
{<br />
// Root-URL<br />
server.on("/", handleRoot);</p>
<p dir="auto">// further path<br />
server.on("/m5", <a class="plugin-markdown-hidden-link small link-danger"></a> {<br />
server.send(200, "text/plain", "m5 path hello");<br />
});</p>
<p dir="auto">// relaistrigger<br />
server.on("/11", RelaissendUDP);<br />
// and further more if need.</p>
<p dir="auto">// if path not valid<br />
server.onNotFound(handleNotFound);</p>
<p dir="auto">// server ok so, go<br />
server.begin();<br />
Serial.println("HTTP server started");<br />
}</p>
<p dir="auto">void handleNotFound()<br />
{<br />
String message = "File Not Found\n\n";<br />
message += "URI: ";<br />
message += server.uri();<br />
message += "\nMethod: ";<br />
message += (server.method() == HTTP_GET) ? "GET" : "POST";<br />
message += "\nArguments: ";<br />
message += server.args();<br />
message += "\n";<br />
for (uint8_t i = 0; i &lt; server.args(); i++) {<br />
message += " " + server.argName(i) + ": " + server.arg(i) + "\n";<br />
}<br />
server.send(404, "text/plain", message);<br />
}</p>
<p dir="auto">void handleRoot()<br />
{<br />
String content = String(WiFi_hostname)+"&lt;br&gt; this button  trigger the relais same way button A at M5stack &lt;a href="/11"&gt;RELAISTRIGGER&lt;/a&gt;&lt;/body&gt;&lt;/html&gt;";<br />
String s = "&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;";<br />
s += "&lt;meta name="viewport" content="width=device-width,user-scalable=0"&gt;";<br />
s += "&lt;title&gt;";<br />
s += "M5Stack";<br />
s += "&lt;/title&gt;&lt;/head&gt;&lt;body&gt;";<br />
s += content;<br />
s += "&lt;/body&gt;&lt;/html&gt;";<br />
server.send(200, "text/html", "OK http connect: " + s);<br />
}</p>
<p dir="auto">//LAN 2Chanal Relais<br />
void RelaissendUDP ()<br />
{<br />
// 2WayRelais<br />
IPAddress 2channelRelais(192, 168, 178, 32);<br />
unsigned int UDP2port = 6723; //sendePport 6723 UDP für 2WayRelais, TCP port 6722<br />
const int UDP_PACKET_SIZE = 4; //packetgroesse wictig rüf Relaisansteuerung<br />
byte packet2Buffer[ UDP_PACKET_SIZE]; //buffer to hold incoming and outgoing packets<br />
boolean packet2Rcvd = true;</p>
<p dir="auto">delay(10);<br />
memset(packet2Buffer, 0, UDP_PACKET_SIZE);<br />
sprintf((char*)packet2Buffer, "11:5"); //PCB Relais2, close for 5seconds<br />
Udp.beginPacket(2channelRelais, UDP2port);<br />
Udp.write(packet2Buffer, UDP_PACKET_SIZE);<br />
Udp.endPacket();<br />
delay(10);<br />
memset(packet2Buffer, 0, UDP_PACKET_SIZE);<br />
sprintf((char*)packet2Buffer, "12:4"); //PCB Relais2, close for 4seconds<br />
Udp.beginPacket(2channelRelais, UDP2port);<br />
Udp.write(packet2Buffer, UDP_PACKET_SIZE);<br />
Udp.endPacket();<br />
}</p>
]]></description><link>https://community.m5stack.com/post/4175</link><guid isPermaLink="true">https://community.m5stack.com/post/4175</guid><dc:creator><![CDATA[Thom]]></dc:creator><pubDate>Tue, 07 May 2019 12:12:06 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Lan Module and WiFi on Sun, 05 May 2019 10:12:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/elvis6m" aria-label="Profile: elvis6m">@<bdi>elvis6m</bdi></a> I also need your code.</p>
]]></description><link>https://community.m5stack.com/post/4131</link><guid isPermaLink="true">https://community.m5stack.com/post/4131</guid><dc:creator><![CDATA[m5-docs]]></dc:creator><pubDate>Sun, 05 May 2019 10:12:39 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Lan Module and WiFi on Wed, 01 May 2019 21:25:20 GMT]]></title><description><![CDATA[<p dir="auto">Hello are there any solution ?<br />
or an example code ?<br />
Thanks for help<br />
Thomas</p>
]]></description><link>https://community.m5stack.com/post/4087</link><guid isPermaLink="true">https://community.m5stack.com/post/4087</guid><dc:creator><![CDATA[Thom]]></dc:creator><pubDate>Wed, 01 May 2019 21:25:20 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Lan Module and WiFi on Wed, 03 Apr 2019 06:31:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/elvis6m" aria-label="Profile: elvis6m">@<bdi>elvis6m</bdi></a> Hi, I'm a SHIO.</p>
<p dir="auto">Our engineer said that you can use WiFI and LAN module at the same time.<br />
Please show us your code if you can.</p>
<p dir="auto">thank you.</p>
]]></description><link>https://community.m5stack.com/post/3515</link><guid isPermaLink="true">https://community.m5stack.com/post/3515</guid><dc:creator><![CDATA[salty_good]]></dc:creator><pubDate>Wed, 03 Apr 2019 06:31:04 GMT</pubDate></item></channel></rss>