IP Networking — Ethernet, WiFi, UDP, MQTT
Once you need more than two devices talking, or you want to reach the rest of a network rather than another microcontroller, you cross over from raw radios into IP networking. NodeBlue offers two ways onto an IP network, with two different module layouts:
- Ethernet — the board has its own IP stack (via a Wiznet W5500/W5100 chip and an
nEthernetmodule). Higher-level transports — UDP and MQTT — are then separate modules (nUDP,nMQTTInterface+nMQTTInput+nMQTTOutput) wired into the design. - WiFi via ESP8266 — the IP stack lives on the ESP8266 module itself. The board only sees a UART.
nESP8266handles UDP / TCP inside the module (via its Com. Mode setting); you don't add a separatenUDPfor this path.
So the same design doesn't move automatically from Ethernet to WiFi — they're laid out differently. The sections below walk through each.
Getting on the network
Ethernet (W5500 etc.)
For boards with an Ethernet shield (Wiznet W5500 / W5100 family), drop in an nEthernet module. It's the on-board IP stack.
| Parameter | Description |
|---|---|
| SPI port + CS pin | How the chip is wired to the MCU. |
| MAC address | A unique 6-byte hardware address (use a random one if your shield doesn't have a printed MAC). |
| IP mode | Static (fixed IP / mask / gateway / DNS) or DHCP (ask the router). |
| Static IP / netmask / gateway / DNS | Only when IP mode is Static. |
Once initialised, nEthernet is rarely wired directly — it's the carrier on which nUDP / nMQTTInterface run. The Examples/04-Communication/Ethernet design shows the bring-up.
WiFi via ESP8266
If your project doesn't have a wired LAN, the easy path is an ESP8266 module connected over a UART. The ESP runs its own WiFi and IP stack — nUDP and nMQTT* are not used on this path; the nESP8266 module talks UDP or TCP itself, via its Com. Mode parameter.
| Parameter | Description |
|---|---|
| Port | The hardware UART the ESP module is wired to. |
| Op. Mode | Station (join a WiFi network) or Soft-AP (the board becomes the WiFi network). |
| Com. Mode | UDP or TCP — the transport the ESP relays in and out of the board. |
| SSID / Key / Security | WiFi credentials (when in Station mode), or the AP credentials it will advertise (Soft-AP mode). |
| Channel | WiFi channel (1–13) — when in Soft-AP mode. |
| Host Name / Host Port | The peer address / port the ESP forwards packets to. |
| Nb Pipes | How many simultaneous TCP/UDP connections the ESP juggles. |
| Buffer size | Receive-buffer size in bytes. |
You wire data directly into / out of nESP8266's inputs and outputs — the WiFi link and the UDP (or TCP) framing both live inside the module.
Boards with native WiFi (ESP32, certain Arduino MKR / Nano IoT variants) follow the same self-contained pattern through their own platform-specific module: the WiFi stack and the UDP/TCP framing are bundled together.
UDP (on top of Ethernet)
For Ethernet boards, the nUDP module is the no-frills IP transport: "send this packet of bytes to this IP and port; hope it arrives". Perfect for fast control loops, sensor streaming and anywhere you'd rather drop the occasional packet than buffer up latency.
| Parameter | Description |
|---|---|
| Listen Port | The port the module listens on for incoming packets. |
| Dest IP | The IPv4 address packets are sent to (entered as four bytes). |
| Dest Port | The port at the destination. |
Anything wired into its input becomes a UDP packet to (Dest IP, Dest Port); incoming packets land on the output. The Examples/04-Communication/UDP design shows the basics — small text packets between two boards.
nUDP runs on top of nEthernet. For UDP over WiFi, don't add an nUDP — configure the nESP8266 module's Com. Mode to UDP instead, and it handles the framing itself.
MQTT
For projects spanning boards, gateways and a backend, MQTT's publish/subscribe model is hard to beat. A central broker holds named topics; each board publishes to topics and subscribes to others. NodeBlue splits the pattern across three modules:
| Module | Role |
|---|---|
| nMQTTInterface | The connection to the broker — host, port, credentials, client id. One per board. |
| nMQTTInput | Subscribes to a topic. Its output emits the payload of every matching incoming message. |
| nMQTTOutput | Publishes to a topic. Each buffer arriving on its input becomes a message. |
A typical pattern: every sensor board publishes to home/livingroom/temperature (etc.), and a dashboard board subscribes to home/+/temperature to display them all. Topic wildcards (+ for one level, # for everything beneath) let one subscriber handle many sources without enumerating them.
MQTT brokers commonly run on a Raspberry Pi or any always-on machine on your LAN (Mosquitto is the standard). Once one's up, a NodeBlue board joining the network only needs the broker's IP, a client id, and which topics to publish/subscribe.
Picking between them
| Setup | Modules |
|---|---|
| Wired LAN, fire-and-forget packets | nEthernet + nUDP |
| Wired LAN, pub/sub | nEthernet + nMQTTInterface + nMQTTInput/nMQTTOutput |
| WiFi, UDP | nESP8266 with Com. Mode = UDP — all in one module |
| WiFi, TCP | nESP8266 with Com. Mode = TCP — all in one module |
Two lower-level buses — SPI and I²C — are used internally by a lot of modules (sensors, displays, the radio chips themselves). Start with SPI.