This project is a WiFi to LAN with “ENC28J60” and “ESP32” firmware arduino source code (.ino).
The project gives you an internet access via WiFi modem, over the LAN port (like USB WiFi stations).
Simply you can plug the ESP32 power, configure it with the modem’s SSID and Password, connect your PC or laptop to the “ENC” module with a RJ45 LAN cable and access to the internet.
The project contains the following files:
- ESP32ENCWiFiLan.ino (Main handler file)
- user_global.h – Project global variables and definitions file.
- user_init.ino – Project initial script file.
- user_loop.ino – This file has a “userLoop()” function which calls repeatedly (like arduino “loop()” function).
- user_settings.ino – Project settings file.
- user_global.ino – This file has the global functions.
- Webapp.h – This file contains the WebApp’s script.
Before access to the internet via the LAN cable, setup the WiFi connections.
Then turn on the ESP32 module by plugging its USB cable and connect to its hotspot (WiCardWiFiLan by default). The default password is: 12345678
The default web application address is 192.168.4.1, insert the address in a web browser’s address bar to access to the configuration page.
- If you don’t have a WiFi support device, you can plug the LAN cable and go to 192.168.6.1 with a web browser.
The configuration has been divided to 3 parts:
- Modem Configuration
- Device Hotspot Configuration
- NAT ConfigurationIn this section you can set the DNS server ip address. The default is: 8.8.8.8
After the configuration, re-start the module, wait for a few seconds until ESP32 registers itself to the WiFi modem.
Then plug the LAN cable in your PC or laptop.
- In case you are using windows 7, turn off your laptop WiFi device before plugging the LAN cable.
Wait for a few seconds until DHCP done. Then your PC or laptop IP would be 192.168.6.2 and the WiFi LAN IP would be 192.168.6.1 and you can access to the WiFi modem Internet via you WiFi LAN device.
- Due too low buffer size of ENC28J60 and the low process speed of ESP32, this firmware can handle a few connections at the same time. So it’s suggested do not open multiple tabs in your browser.
- This is the first release of this project, and it is a good tutorial for Ethernet, IP, TCP-UDP and DHCP headers. In the next releases I will try to increase the firmware abilities.
- This release doesn’t support “ping” command.
The project is available in the following link (You can download it for free, by click on the “Promote” button):
LAN to WiFi Converter with ESP32 and ENC28J60 Arduino Source Code – Rev 1.0
Comments