VoriaSolutions · 2026

Networking on microcontrollers

Learning TCP/IP from the wire up on two microcontrollers: bare-metal Ethernet in Rust on an ESP32-S3, and secure MQTT to the cloud on an STM32H5 running Zephyr.

Goal

VoriaSolutions' devices talk to hospital networks and to the cloud. Before building on that, I wanted to know the stack below the application: how an Ethernet controller is driven over SPI, how sockets behave on an RTOS, and what it takes to run TLS and MQTT on a microcontroller with little RAM.

What I built

Bare-metal Ethernet in Rust

On an ESP32-S3 with no operating system, I drove a WIZnet W5500 Ethernet controller over SPI at 33 MHz from no_std Rust, wrapped it in a small driver layer with a static address and link checks, and tested UDP round trips against a Python script on the host.

Sockets on Zephyr

On an STM32H573 board, TCP and UDP echo servers on Zephyr's socket API, with the network shell and statistics turned on to watch what the stack does.

MQTT over TLS

Building on Zephyr's AWS IoT sample, I ran MQTT over TLS first to a Mosquitto broker on a host PC with my own certificate authority, then to AWS IoT Core with device certificates. The board gets its address over DHCP, finds the broker through DNS, sets its clock over SNTP so certificates validate, acknowledges QoS 1 messages, and registers a Last Will message so the broker announces when it drops off.

Result

The Ethernet bring-up went straight into the bedside-monitor gateway, which drives the same W5500 controller. The MQTT client connects to AWS IoT Core over TLS with its own device certificate and announces its own disconnects through the Last Will.

What I learned

  • Driving an SPI Ethernet controller from no_std Rust through the embedded-hal traits.
  • Zephyr's networking stack: sockets, DHCP, DNS, SNTP, buffer sizing and the network shell.
  • TLS on a microcontroller: mbedTLS configuration, certificate handling and the memory it costs.
  • MQTT in practice: QoS levels, keep-alive and Last Will, against a self-hosted broker and AWS IoT Core.