instructables
How to Use Ethernet on Raspberry Pi Zero W
by renakim
WiFi is convenient, but sometimes it's slow or disconnects. Some projects require a more reliable connection than
convenience.
In this case, it may be more advantageous to use a wired connection, that is, an Ethernet interface.
So, I'm going to explain how to add an Ethernet interface to Raspberry Pi Zero W.
Supplies:
Hardware
Raspberry Pi zero W
WIZ850io (W5500 ethernet module)
Jumper wires
The WIZ850io is a module from WIZnet, which is based on the W5500 Ethernet chip and includes an RJ45 connector.
The W5500 is an Ethernet controller chip with hardwired TCP/IP and supports SPI communication. It helps to easily add
an internet connection to the embedded system.
Details of the WIZ850io module can be found on the link below.
WIZ850io shop link
WIZ850io
Software
To store and manage sessions, I used PuTTY, a representative free terminal program. You can use the terminal program
you are comfortable with.
PuTTY (optional)
Raspberry Pi OS
I used 2021-10-30 released version (Linux kernel 5.10.63)
How to Use Ethernet on Raspberry Pi Zero W: Page 1
Step 1: Hardware Connection
Below is the pin connection information of RPI zero and WIZ850io.
Each pinmap can be found at the following link. For RPI zero, the direction may be confusing, from the side with the
micro sd card slot to the one.
WIZ850io speci cation
Raspberry Pi pinout
If all the pins are connected, it will look like the image.
How to Use Ethernet on Raspberry Pi Zero W: Page 2
How to Use Ethernet on Raspberry Pi Zero W: Page 3
Step 2: Enable Linux Driver for WIZ850io
Device tree overlay setting
To use WIZ850io(W5500), we need to add a device tree overlay setting.
Since the binary le is already included in the OS, we can add the w5500 con guration to /boot/con g.txt.
The name used when setting the device tree overlay follows the name of the .dtbo le.
The le name is w5500.dtbo that we will use.
To modify les in the boot directory, root authority is required, so use the sudo command.
sudo vi /boot/config.txt
Add below line.
How to add text with vim
How to Use Ethernet on Raspberry Pi Zero W: Page 4
To go to end of le: shift + g
To insert text: i
Add text: dtoverlay=w5500
To quit edit mode: Esc
To save and quit le: :wq
After setting, reboot to apply the Overlay setting.
$ sudo reboot
Since the ssh connection is disconnected after rebooting, run putty again to connect.
Activate Device driver module
Activate the W5500 ethernet device driver module using the modprobe command.
The W5500 device driver can be referred to in the following path.
Raspberry Pi linux - ethernet
sudo modprobe w5100_spi
Use the following command to check whether the driver module has been successfully loaded.
lsmod | grep w5100
Now, we can check the network interface with the ifcon g -a command.
We can see that the eth0 interface has been created. If a DHCP server is set up on the router, an IP can be assigned
automatically.
How to Use Ethernet on Raspberry Pi Zero W: Page 5
How to Use Ethernet on Raspberry Pi Zero W: Page 6
Step 3: Using Ethernet As Static IP
Optionally, you can con gure Ethernet to be used as a static IP. Set the IP according to the internal network IP band of the
environment in use.
Since my AP uses the 192.168.50.X band, I set it up like below.
Open a network con guration le with VIM.
sudo vi /etc/dhcpcd.conf
interface eth0
static ip_address=192.168.50.96/24
static routers=192.168.50.1
static domain_name_servers=168.126.63.1 168.126.63.2
After saving the le(:wq), reboot to apply the con guration.
sudo reboot
Now, you can connect to Raspberry Pi zero W with ethernet interface using static IP!
How to Use Ethernet on Raspberry Pi Zero W: Page 7
How to Use Ethernet on Raspberry Pi Zero W: Page 8