<link rel="stylesheet" href="/fonts/devicon/devicon.css" data-beasties-skip>

STM32 Ethernet MQTT Controller

Ethernet MQTT Node for a Smart-Building Controller

Role
Embedded systems engineer
Year
2026
Status
Prototype
Stack
C · STM32F767 · STM32 HAL · lwIP · MQTT · Mosquitto · Ethernet
Board
NUCLEO-F767ZI
MCU
STM32F767
TCP/IP stack
lwIP
Messaging
MQTT · Mosquitto

Overview

Ethernet-connected STM32F767 (NUCLEO-F767ZI) node built on STM32 HAL and the lwIP TCP/IP stack, with no RTOS. Gets its address over DHCP, connects to a local Mosquitto broker through lwIP's MQTT client, publishes on a 3-second interval, and switches an on-board LED from MQTT commands. Built as the communication layer for a planned smart-building controller.

What I built

  1. Ethernet node on a NUCLEO-F767ZI: STM32 HAL, RMII to the on-board LAN8742A PHY
  2. lwIP TCP/IP stack with no RTOS (NO_SYS), polled from the main loop, address over DHCP
  3. lwIP MQTT client to a local Mosquitto broker: publishes to home/stm32/test, subscribes to home/stm32/cmd
  4. Remote hardware control: LED_ON / LED_OFF commands over Ethernet switch an on-board LED
  5. Tuned lwIP memory pools (MEMP_NUM_SYS_TIMEOUT, TCP queues) to fix a timeout-pool assertion and keep MQTT stable
  6. Communication layer for a planned smart-building controller (sensors, relays, RS485 are next)

Architecture

STM32 Ethernet MQTT Controller architecture diagram

Key decisions

Board
NUCLEO-F767ZI
MCU
STM32F767
TCP/IP stack
lwIP
Messaging
MQTT · Mosquitto

Stack

C · STM32F767 · STM32 HAL · lwIP · MQTT · Mosquitto · Ethernet

Outcome

Publishes over MQTT every 3 s; LED switched remotely over Ethernet. Prototype · 2026.

Next case — 06 / 10

MPU-6050 Attitude Monitor Bare-metal Artificial Horizon on STM32L031K6 · 2026 All work