W5500
W5500
10/100 Mbps
TCP/IP, UDP, ICMP, HTTP, DHCP
-40C to 85C
180mA (typical)
GPIO
| RJ45 Connector | Standard |
25.4 x 19.8 x 9.5 mm
Applications
| The M5Stack LAN Module with W5500 is suitable for a wide range of applications, including |
IoT devices and applications
Industrial automation
Robotics
Home automation
Building automation
Medical devices
Consumer electronics
Conclusion
The M5Stack LAN Module with W5500 is a compact, high-performance Ethernet module that provides an easy-to-use and reliable solution for enabling Ethernet connectivity in a wide range of devices and applications. With its low power consumption, compact design, and ease of integration, this module is an ideal choice for developers and designers looking to add Ethernet connectivity to their projects.
M5Stack LAN Module with W5500 DocumentationOverviewThe M5Stack LAN Module with W5500 is a compact and versatile Ethernet module designed for IoT applications. It is based on the W5500 chip, a high-performance Ethernet controller with a built-in TCP/IP stack. This module provides a reliable and efficient way to connect your IoT devices to the internet or local networks.Hardware SpecificationsMicrocontroller: W5500
Ethernet: 10/100Mbps
Protocol: TCP/IP, UDP, ICMP, ARP, HTTP, DHCP, DNS, etc.
Interface: SPI
Power Supply: 3.3V
Dimensions: 38.5 x 26.5 x 12.5 mmSoftware FeaturesAPI: Supports Arduino, Python, and UIFlow programming languages
Network protocols: TCP, UDP, HTTP, DHCP, DNS, etc.
Socket API: Allows developers to create custom network applicationsCode Examples### Example 1: Simple Web Server using ArduinoThis example demonstrates how to create a simple web server using the M5Stack LAN Module with W5500 and Arduino.```cpp
#include <M5Stack.h>
#include <WiFi.h>
#include <Ethernet.h>// Set the MAC address and IP address
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip(192, 168, 1, 100);EthernetServer server(80); // Create a web server on port 80void setup() {
M5.begin();
Serial.begin(115200);// Initialize the Ethernet module
Ethernet.begin(mac, ip);// Start the web server
server.begin();
Serial.println("Web server started");
}void loop() {
EthernetClient client = server.available();if (client) {
Serial.println("Client connected");// Read the request from the client
String request = client.readStringUntil('
');// Send the response
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();
client.println("<h1>Welcome to M5Stack LAN Module!</h1>");// Close the connection
client.stop();
Serial.println("Client disconnected");
}
}
```### Example 2: Send HTTP Request using PythonThis example demonstrates how to send an HTTP GET request using the M5Stack LAN Module with W5500 and MicroPython.```python
import machine
import network
import socket# Initialize the Ethernet module
eth = network.Ethernet(machine.Pin(5), machine.Pin(18))
eth.active(True)# Set the IP address and subnet mask
eth.ifconfig(('192.168.1.100', '255.255.255.0', '192.168.1.1', '8.8.8.8'))# Create a socket object
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)# Connect to the server
sock.connect(("www.example.com", 80))# Send the HTTP request
sock.send(b"GET / HTTP/1.1
Host: www.example.com
")# Receive the response
response = sock.recv(1024)
print(response.decode())# Close the socket
sock.close()
```These examples demonstrate the basic usage of the M5Stack LAN Module with W5500 in various contexts. You can explore more advanced features and applications by referring to the official documentation and API references.