ESP32_W5500_MQTT

ESP32 W5500 gateway with MQTT
ORIGINAL POST
By jozala
details

화면 캡처 2022-02-08 135608.png touch_osc Using TouchOSC with your project

ESP32 W5500 MQTT

Simple example of using Arduino Ethernet library with ESP32 and W5500 to subscribe and publish to MQTT broker.

Physical connection between ESP32 and W5500

  • GPIO23 <–> MOSI
  • GPIO19 <–> MISO
  • GPIO18 <–> SCLK
  • GPIO5 <–> SCS
  • GPIO11 <–> RESET

It is possible to change pins used for chip-select and reset in include/MasterConfig.h file.

Configuration

Fixed IP address of the device (ETHERNET_IP) and MQTT hostname (MQTT_HOSTNAME) should most probably be changed in include/MasterConfig.h to fit your setup. Changing other configurations in MasterConfig.h is optional.

Running the test

It has been prepared as PlatformIO project. All dependencies will be automatically downloaded if run with PlatformIO.

Script for publishing messages (so ESP32 has something to read) has been prepared with Bash and Docker. That means it Docker is required for it and it is simple to run on Linux. It may also work with Windows Subsystem for Linux but it has not been tested.

  1. Load and run project on ESP32
  2. Start script scripts/mqtt_pub_test.sh [MQTT_HOST]
  3. Observe serial output from ESP32

화면 캡처 2022-02-08 135608.png touch_osc Using TouchOSC with your project

ESP32 W5500 MQTT

Simple example of using Arduino Ethernet library with ESP32 and W5500 to subscribe and publish to MQTT broker.

Physical connection between ESP32 and W5500

  • GPIO23 <–> MOSI
  • GPIO19 <–> MISO
  • GPIO18 <–> SCLK
  • GPIO5 <–> SCS
  • GPIO11 <–> RESET

It is possible to change pins used for chip-select and reset in include/MasterConfig.h file.

Configuration

Fixed IP address of the device (ETHERNET_IP) and MQTT hostname (MQTT_HOSTNAME) should most probably be changed in include/MasterConfig.h to fit your setup. Changing other configurations in MasterConfig.h is optional.

Running the test

It has been prepared as PlatformIO project. All dependencies will be automatically downloaded if run with PlatformIO.

Script for publishing messages (so ESP32 has something to read) has been prepared with Bash and Docker. That means it Docker is required for it and it is simple to run on Linux. It may also work with Windows Subsystem for Linux but it has not been tested.

  1. Load and run project on ESP32
  2. Start script scripts/mqtt_pub_test.sh [MQTT_HOST]
  3. Observe serial output from ESP32
documents
Code
Source code

COMMENTS

Please Login to comment
  Subscribe  
Notify of