Skip to main content

MQTT broker on ESP32-S3

The broker connects Master and MQTT nodes over local Wi-Fi. Nodes publish readings and states; subscribers receive messages. Continuous operation does not require a separate computer running a server OS. Modbus devices connect to their Master over RS485, not to the MQTT broker GPIO pins.

This section covers the standard ESP32-S3 broker without RGB. RGB uses a separate hardware profile; do not combine pin assignments from the two variants.

Board and memory​

The tested configuration is ESP32-S3 N16R8: 16 MB Flash and 8 MB PSRAM. The image uses a 16 MB layout and external PSRAM for dynamic broker data. This is a tested configuration, not a proven minimum PSRAM size. Boards without PSRAM or with 4 MB Flash are not considered compatible with this image. GPIO numbers are not header positions; check the exact board markings and schematic. A build profile does not guarantee identical wiring across DevKit boards.

See Web Serial installation for initial setup.

Full and DEMO versions​

FeatureFullDEMO
Wi-Fi client, AP, DHCP and static IPv4SupportedSupported
Authenticated RU/EN Web UISupportedSupported, with a DEMO notice
MQTT connections and subscription acknowledgementsSupportedSupported
Message delivery, retained replay and LWT forwardingSupportedDisabled
Client and subscription listsReal connectionsLabelled demonstration rows
Device ID and OTA transition to fullSupportedSupported after operator admission
OLEDDiagnostic pagesWi-Fi → IP → DEMO

DEMO shows four text-only client examples and 12 subscriptions. These do not mean physical nodes are connected. DEMO does not deliver actual control commands or readings. Automatic update checks are disabled in DEMO.

The screenshots show full version 4.0.2. Four active Manual-* clients, eight subscriptions and manual/broker/ messages were generated in software to illustrate real MQTT connections. They are not sensor measurements or built-in DEMO rows. Grey areas hide identifiers and local network details. Some labels in the current English UI remain Russian or display untranslated keys.

Initial installation through Web Serial​

Sign in to the public installer as ota / ota. Select ESP32-S3 MQTT Broker (esp32s3). The installer automatically offers one current DEMO App + FS pair, with no separate version or file lists. Choose Prepare firmware kit. The successful result below requires 16 MiB Flash.

Prepared public MQTT Broker DEMO kit: App + FS, 16 MiB

The screenshot confirms preparation in the browser, not a board flash: board Flash has not been read and the serial port has not been opened. Follow the step-by-step Web Serial guide to continue.

First login​

After a fresh installation, join the open ESP32_Broker_AP Wi-Fi network and open http://192.168.4.1. No AP password is required. Web UI login is admin / admin until changed; open Wi-Fi does not remove UI authentication. If the device already uses your Wi-Fi network, open its current local address.

Broker Web UI login in English

Status​

Status shows clients, message/subscription counters, uptime, memory and system information. Verify delivery by receiving a message on a separate subscriber; a UI counter alone is not delivery confirmation. Screenshot client counts and memory values are not performance specifications.

Broker status with four active software MQTT clients

Network​

Enter your SSID and Wi-Fi password, then choose DHCP or static IPv4. Static mode requires your network's IP, gateway, netmask and DNS. Select Save and reboot, then open the UI at the resulting address.

Enter both SSID and the current Wi-Fi password on every network save, including DHCP/static changes. The SSID is not filled automatically; an empty password does not mean keep the existing one. Use a DHCP reservation or an agreed static address so Master and other clients can reconnect reliably.

Client Wi-Fi with DHCP or static IPv4 selection

Security​

Web UI credentials and MQTT access are independent. Security lets you change the UI password, allow anonymous MQTT or set shared MQTT credentials for clients. If anonymous access is disabled, configure the same MQTT credentials in Master and other nodes. Without TLS, the MQTT password travels in clear text; UI login protection does not encrypt MQTT traffic.

Saving MQTT settings reboots the broker, disconnects clients and clears retained messages and sessions stored in RAM. Plan this during setup. Logging level and interface language are also configured here.

Independent MQTT access and Web UI authentication settings

Clients and subscriptions​

Clients shows Client ID, connection state, address and connection time. Give each node a unique Client ID. Subscriptions shows topics, clients and QoS; topic grouping helps find multiple subscribers.

The example Manual-Master subscribes to manual/broker/+/telemetry, while Manual-Panel subscribes to manual/broker/#. + matches one topic level; # matches the remaining branch. These topics are documentation examples only.

Actual software connections illustrating the client list

Eight client subscriptions and grouping by topic; some labels remain Russian

OLED and DS3231 clock​

OLED is optional: networking, MQTT and the UI work without it. The driver supports SSD1306 128×64 at I²C address 0x3C. Configure brightness, page interval, awake time and sleep time on the OLED page; saving does not reboot. Wake sends a display request, not proof that pixels are lit. The screenshot reports no display because the test setup has no connected OLED.

DS3231 RTC (0x68) shares SDA/SCL. It is optional; physical simultaneous OLED/RTC operation was not qualified in this hardware test.

Optional OLED settings with no display detected on the test board

Current firmware pins​

FunctionGPIO / terminalConnection
Shared I²C SDAGPIO6OLED SDA and DS3231 SDA in parallel
Shared I²C SCLGPIO7OLED SCL and DS3231 SCL in parallel
BOOT / UI credential resetGPIO0Button to GND, active low
RTC supply3V3DS3231 VCC; check the exact module
Common groundGNDBoard, OLED and RTC ground

The shared bus is I²C0 at 100 kHz, with internal pull-ups enabled. Check module pull-ups and 3.3 V signal levels; check the exact OLED supply and connector against its documentation. Firmware addresses are fixed at 0x3C for OLED and 0x68 for RTC. Other display controllers/resolutions or address 0x3D are not considered compatible. No dedicated OLED RESET/DC/CS or RTC INT/SQW/32K GPIO is configured.

Hold GPIO0/BOOT low for at least 10 seconds while the application is running to reset Web UI credentials to admin/admin and reboot. This does not erase all Flash or network settings. Entering USB download mode depends on the board and is a different procedure from this running-application feature.

Current ESP-IDF service signals are UART0 TX GPIO43 / RX GPIO44 at 115200 baud, native USB D− GPIO19 / D+ GPIO20, and PSRAM CS GPIO26 / CLK GPIO30. These are not free peripheral pins. Actual USB wiring, memory signals and other GPIO availability depend on the module and board. The standard broker assigns no GPIO for RGB/WS2812, relays, OneWire or RS485.

OTA and obtaining full firmware​

On OTA, copy the full Device ID of the actual target S3 board and provide it to the operator through the agreed channel. Compact ID is not a substitute. After operator admission, run a manual update check and install the offered full release. A compatible transition updates App and FS together without another USB install. Keep power connected until the firmware boots successfully, then check version, network and MQTT operation. Official API URL: https://ota.esp32ota.top/api/v1.

Device information and OTA with private identifiers masked

Scope​

The broker targets local MQTT over TCP on port 1883. Do not expose it directly to the Internet. MQTT 3.1.1, ordinary QoS 0/1/2 messages, retained and LWT, and a DEMO-to-full transition passed on one S3. This is functional validation, not a server-class performance, maximum-client, MQTT 5 or power-loss recovery guarantee. Validate message rates, payload sizes and subscriber counts in your own system.

Prolonged practical testing verified a mixed setup: one MQTT Slave and another Modbus Slave, simultaneously 12 control channels and 13 measurements. MQTT used the broker; Modbus used a direct RS485 line. This is a verified scenario, not a maximum MQTT client/topic count. Node count, message frequency and workload affect the result; larger configurations require separate testing.

RGB broker: separate profile​

RGB broker: indicates startup, networking, operation and problems. The current implementation uses an addressable WS2812-family indicator. A conventional three-channel RGB LED is not a direct replacement. The current profile uses GPIO48; this is a build-specific assignment, not a universal pin for every S3 board. Supply and colour order must match the indicator and hardware profile.

Current RGB indicationMeaning
BlueStartup/waiting for readiness
Flashing blueConnecting to a network
Double blue flashesPreviously available network lost
White backgroundOperating with an address in the client Wi-Fi network
Yellow backgroundAccess point mode without a client Wi-Fi address
Green flashesReceive activity; periodic indication is also possible without clients
Flashing redResource shortage
Solid redCritical error

White indicates a local address, not Internet availability. A green flash does not confirm delivery to the recipient or precisely indicate TX/queue occupancy. An unlit LED can mean disabled indication or an indicator fault. It does not replace diagnostics. This table describes the current software implementation; verify indicator compatibility and colour order on the actual board.