NodeBlue Interface Protocol (NBI)
The NodeBlue Interface (NBI) is the command protocol the NodeBlue IDE uses to talk to a running board — read live output values, set parameter values, save them to EEPROM, query firmware identity, dump axis ranges. It's also the channel the IDE's dashboard uses to drive widgets, and the channel used to talk between two NodeBlue boards over any transport.
This tutorial covers what NBI is, how to wire the on-board endpoint (nNodeBlueInterface), how to define your own message codes via nNodeBlueInterfaceIn, and the typical transports it runs on (USB, USB-Serial, BLE, NRF24, Nextion).
What the protocol carries
Every NBI packet is one of a small fixed set of commands. The IDE uses these constantly during a session; the user rarely thinks about them but knowing they exist makes the dashboard, the game-controller test page, and the radio-host examples make sense.
| Command | Direction | What it does |
|---|---|---|
| SET_INPUT | host → board | Set a module's input port to a value — same as if a wire on the canvas had carried that value. |
| SET_OUTPUT | host → board | Send a value out of a module's output port — used to inject simulated readings. |
| GET_OUTPUT | host → board | Ask for the current value on a module's output port. The board replies with the raw bytes. |
| SET_PARAM | host → board | Change a module's parameter in RAM (not persisted across reset). |
| SAVE_PARAM | host → board | Change the parameter and persist it to EEPROM. |
| GET_PARAM | host → board | Read a parameter's current value. |
| INIT | host → board | Re-run the project's startup logic without rebooting. |
| CLEAR_STORAGE | host → board | Wipe the EEPROM-backed parameter store. |
| GET_AXIS_INFOS | host → board | Dump the running min/max/learned-range for every axis (used by the IDE's calibration UI). |
| GET_FREEMEM | host → board | Free RAM, in bytes. |
| GET_FW_INFO | host → board | Firmware identity — VID/PID, name, NodeBlue version, project name. |
| GET_EEPROM_SIZE / READ_EEPROM / WRITE_EEPROM | host → board | Raw EEPROM read/write for backup-restore tools. |
| (custom) | host → board | Whatever you've declared with nNodeBlueInterfaceIn. |
Each packet is prefixed by the header byte 0x03, then the command code, then the target module's address or CRC-of-name, the parameter/port index, and the value bytes. Replies to GET commands return the raw value bytes only, no echo of the command or address — so a host sending several GETs in flight must serialise them and rely on FIFO correlation.
The on-board endpoint — nNodeBlueInterface
nNodeBlueInterface is the module that does the protocol parsing on the board side. It accepts an incoming byte stream on its Rx input, decodes NBI packets out of it, dispatches them to the right module (SET_INPUT on module X, GET_OUTPUT on module Y, etc.), and emits any replies on its Tx output.
| Parameter | Description |
|---|---|
| Sync | Usually MainLoop — packets are processed each loop iteration. InputSync is also valid and gets you faster turnaround at the cost of more work per tick. |
| ref | A user-chosen name (default "Interface"). Other modules (nNodeBlueInterfaceIn, nNodeBlueNextion) reference an NBI endpoint by name, so several endpoints can coexist on the same board — e.g. one on USB-Serial for the IDE, another on NRF24 for inter-board comms. |
Both ports are typed cBuffer (small fixed-size buffers — every NBI packet fits in well under 256 bytes). You wire the Rx to whatever transport you're using and the Tx back to the same transport's send input.
When the IDE auto-injects a Raw-HID NBI
The IDE has an auto-injection rule so a freshly-started "empty" project still talks to the host. When the canvas has no USB module (no nHID, nHIDPro, nUSBSerial*, nUSBToSerial*) and the target is not a Teensy, the IDE silently appends an nHID (RawHID, 0 buttons, 31-byte config report) plus an nNodeBlueInterface wired through it, before compiling. That gives the Board Server a USB-HID channel to talk NBI on for any project that doesn't explicitly declare its own USB transport.
| Situation | What happens |
|---|---|
| Empty project, non-Teensy board | Auto-injected RawHID + NBI. The host talks NBI over USB-HID with no work from you. |
| Teensy board | The Teensy USB stack always exposes a RawHID interface regardless of your USB-type choice, so the IDE uses it directly — no injection needed. |
You declared an nHID / nHIDPro / nUSBSerial* | No auto-injection. If you want the IDE to talk to the running board you must add an nNodeBlueInterface yourself and wire it through your HID's Config endpoint (the Config input/output pair appears once the module's Config Report parameter is non-zero) or through one of the nUSBSerial* modules' Rx/Tx. Forget this and the host has no way to read params, drive the dashboard, or read axis info — the board still runs, but the IDE side goes dark. |
BLE-only project (nBLEGamePad, nBLEKeyboard, nBLEuart etc.) with no USB module | Auto-injection still happens (BLE doesn't count as a USB module) — so the host can talk NBI over USB-HID while the user-facing gamepad is on BLE. |
| You want NBI over BLE | Add nBLEuart and nNodeBlueInterface explicitly, wired together — there's no automatic BLE-NBI path. |
You drop an nNodeBlueInterface on the canvas in any of three situations: (a) you have a USB module and need to restore the host-talk path, (b) you want NBI on a transport that isn't auto-handled (hardware UART, NRF24 channel, Nextion serial line), or (c) you want to define custom message codes with nNodeBlueInterfaceIn (next section).
Connecting to a serial / radio transport
Two typical patterns:
NBI over hardware UART (board-to-board through a wire pair):
nSerial(Rx output) →nNodeBlueInterface(Rx input)nNodeBlueInterface(Tx output) →nSerial(Tx input)
NBI over NRF24 radio (board-to-board wireless):
nNRF24(channel Rx output) →nNodeBlueInterface(Rx)nNodeBlueInterface(Tx) →nNRF24(channel Tx input)
The radio side adds the NodeBlue radio's reliability layer underneath — NBI doesn't reinvent retransmission, it relies on whatever transport guarantees the link provides.
See Examples/04-Communication/NodeBlueInterfaceSerial.
Custom message codes — nNodeBlueInterfaceIn
The standard NBI commands cover read/write of the project's modules. For application-level messages — "the host wants to send me a 3-byte RGB colour", "the host wants to push a 12-character LCD line" — you use nNodeBlueInterfaceIn to declare a new code and pick up the body as a buffer on the canvas.
| Parameter | Description |
|---|---|
| Interface | The ref name of the nNodeBlueInterface endpoint to attach to. Drop-down populated from the nNodeBlueInterface modules on the canvas. |
| Code | A single character (or 0xNN byte literal) that identifies your custom message. Use any value that doesn't collide with the built-in NBI command codes — the built-in codes start at 0xEE and grow downward, plus the ASCII upper-case letters 'A'/'F'/'H'/'N' are reserved for ACK / Features / Hello / Device Name. Lowercase letters and digits are always safe. |
| Len | Body length in bytes (fixed at compile time). |
The output is a Buffer of size Len — the body of every incoming packet with this code, dropped onto the canvas as soon as the packet arrives.
Example: host pushes a per-frame RGB colour
nNodeBlueInterfaceIn with Code = 'C' and Len = 3 gives a 3-byte buffer output. Pipe that into an nBufferSplit to get R / G / B as individual values, then into nNeoPixel. On the host side, send 0x03 'C' R G B and the LED updates within one MainLoop tick of the packet arriving.
Example: host sends a Nextion line via NBI tunnelling
See Examples/04-Communication/NodeBlueInterfaceSerial — the host sends a string with a custom code and the board pushes it to a Nextion display.
NBI over Nextion — nNodeBlueNextion
Nextion displays speak a UART protocol of their own (text commands like t0.txt="Hello"). To let an nNodeBlueInterface share the same UART as a Nextion display — common when a board has one Nextion plus an NBI-over-USB-Serial control link from the dashboard — drop an nNodeBlueNextion module on the canvas alongside nNextionInterface.
nNodeBlueNextion is a no-port "annotation" module — its mere presence tells the firmware to multiplex NBI packets and Nextion commands on the same serial line. The Nextion ignores any byte stream that starts with the NBI header 0x03; conversely the NBI parser ignores Nextion ASCII traffic, so the two coexist without confusion.
This is what makes the IDE's dashboard widgets work even when the board's only spare UART is already wired to a Nextion.
NBI vs the radio channel protocol
NodeBlue has two distinct cross-device protocols that often get confused:
| Concept | Use it for | Module(s) |
|---|---|---|
| NodeBlue radio channels | High-bandwidth board-to-board data streams — sensors, axis values, button bitmaps. Eight reliability-managed channels per link, fixed 31-byte payload. | nNRF24, nNRF52. |
| NodeBlue Interface (NBI) | Commands — host driving the board, reading params, reading axis info, custom application messages. | nNodeBlueInterface on top of any transport. |
A typical multi-board project uses both at once:
Wheel-base board ↔ button-box board: shared data over
nNRF24radio channels (steering position, button bits, FFB telemetry).Host (PC dashboard) ↔ wheel-base board: NBI over USB-HID or USB-Serial (calibrate axes, save parameters, query firmware ID).
The two protocols don't know about each other; you pick whichever fits the kind of message you're sending.
Deprecated: nSimpleHostInterface
Older projects (pre-2022 or so) used nSimpleHostInterface for the same job. It's still in the IDE for legacy import, but on first import the module is silently replaced with an nNodeBlueInterface — the checkImport hook does the substitution and preserves wires. Don't add new nSimpleHostInterface modules; pick nNodeBlueInterface in its place.
Examples
- 04-Communication/NodeBlueInterfaceSerial — bare NBI over a serial port, with
nNodeBlueInterfaceIncarrying a custom code.
Many of the multi-board examples under Boards/ use NBI implicitly via radio + USB chains — open any of them to see real-world wiring of the endpoint on each board.
Next: now you've seen how boards exchange events, learn how to drive physical motion with the motor modules — Motors & Drivers.