
ESP32_W5500_GW
An MQTT ESP-Now Gateway — Using the W5500 module to create a hardwired ethernet connection
The code
This is a PlatformIO build (and if you haven’t tried PlatformIO yet, you really should, it’s great!), but is easily adapted to the Arduino IDE, if that happens to be your weapon of choice.
Under PlatformIO, the platformio.ini file will automatically download and install the correct Ethernet and PubSubClient libraries for you when you type “pio run” for the first time. The SPI library is already shipped in the lib directory, as that particular version wasn’t generally available when I originally wrote the code (and it contains a coule of fixes essential to the ESP32 platform).
What does it do?
At the moment, this is simply something to get you going with the ESP32 and the W5500 module. It doesn’t do anything much more than initialize the module and make an initial connection to your MQTT server (broker).
It does have some clunky hardware checks in the start-up code, so pay attention to the serial output from your ESP32 when you first run it; it will try to guide you to solutions for simple hardware issues.
You should be able to build on this code to implement any of the client/server samples in the /examples directory of the Ethernet library.
COMMENTS