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