SimHub Integration
SimHub is the de-facto telemetry hub for PC sim racing — it scrapes per-game telemetry (speed, RPM, gear, sector deltas, tyre temps) and feeds whatever hardware listens. Lots of sim-racing builds use SimHub to drive RPM-LED shift indicators, OLED / segment dashboards, wind-fans, bass-shaker tactile rigs, and per-button lighting on a wheel face. NodeBlue ships a set of modules that make the board appear to SimHub as one of its supported device families, so the user gets a one-click profile in the SimHub UI and SimHub-side variable-bindings out of the box.
This page is the deep-dive flagged at the end of the Sim-Racing tutorial. If you only want a quick "turn on LEDs from SimHub" recipe, jump to the worked example at the bottom.
How SimHub talks to a board
SimHub speaks two protocol families:
| Family | Transport | NodeBlue endpoint |
|---|---|---|
| Serial | A virtual COM port (USB-CDC), text + binary mixed. Plug-and-play — the user picks the COM port in SimHub and starts using the device. | nSimHubInterface |
| HID Custom Device | A custom-USB-HID device that SimHub identifies by VID/PID. Easier setup for the user (no COM port to pick), and the device appears with full metadata in the SimHub UI. | nSimHubDevice |
The two interfaces speak almost the same wire-format underneath; the surface modules look very similar. Use nSimHubInterface for serial-based devices, nSimHubDevice for HID-based ones. You don't put both on the same canvas.
The transport endpoints
nSimHubInterface — serial
Drop this module on the canvas to declare the board as a serial-SimHub device.
| Parameter | Description |
|---|---|
| Sync | Usually MainLoop or InputSync. |
| ref | Name used by nSimHubInterface* companion modules to find this endpoint (default Interface). |
| bufferSize | Internal Rx buffer size — 256 is fine for most projects; bump it if you're shovelling large LED matrices. |
| crc table | The CRC8 table used to authenticate packets — leave at the default crc_table_crc8. |
| Debug | Optional debug-output serial port. Picking a non-None port unlocks the per-area debug flags (Packet, Parser, Commands, …). Admin-only — most users will leave this off. |
| Port | Direction | What it carries |
|---|---|---|
Tx (input) | board → SimHub | A cBuffer carrying status / response packets. Usually wired from a companion module's response output. |
Rx (output) | SimHub → board | A cBuffer carrying every incoming SimHub command. Routed into the companion modules below — they each subscribe to one packet type. |
Bauds (output) | board → companion | A u32 reporting the current serial baud rate — useful when the SimHub side switches speeds mid-session. |
You typically wire nSimHubInterface.Rx into a chain of companion modules, each one declaring one packet code it cares about ('G' for Gear, 'S' for TM1637 data, 'M' for LED Matrix, …). Each companion's output gives you a clean typed buffer or single value you can route into the rest of the project.
nSimHubDevice — HID custom device
Same shape, different transport. Used when you want the board to appear as a custom HID device in SimHub's "My Hardware" panel, with brand, picture URL and a hardware-type tag — SimHub treats it as a first-class device the user can configure through the UI.
| Parameter | Description |
|---|---|
| Brand | Vendor name (default ElectroSeed). |
| Picture URL | URL of a product picture SimHub shows in its UI. |
| Autodetect | Whether SimHub auto-detects the device on USB enumeration. |
| Type | DEVICETYPE_* — pick the family that matches (Wheel, Pedals, Button Box, Shifter, etc.). SimHub uses this to suggest sensible bindings. |
| ULock | "Upload locked" — prevents SimHub from over-writing the firmware via its own update flow. Leave on unless you know you want SimHub managing firmware. |
| Leds / ButtonLeds | Number of addressable LEDs / button-backlight LEDs the device advertises. |
| Layout | A string description of the LED layout — SimHub's editor uses it. |
| Matrix / Fans | Number of matrix and fan controllers the device advertises. |
Ports Tx (input) / Rx (output) / Leds (output) — same idea as the serial interface, plus a dedicated Leds channel for LED data SimHub pushes.
The HID-device route also requires the board's USB type to be HID-capable (customhid or one of its serial*customhid* siblings).
The companion modules — receiving commands
The interface modules above are pure transports — they decode framing and CRCs but don't know what any specific packet means. The companion modules are the per-packet-type subscribers.
nSimHubInterfaceIn — built-in command types
Pick the SimHub packet you want from the type drop-down and the module fills in the protocol details for you:
| Type | Outputs | What SimHub sends |
|---|---|---|
| Gear | u8 — the current gear (R, N, 1–8). | The active gear, as an ASCII character. |
| TM1637 | Brightness + 9 data bytes — a buffer ready to feed straight into a TM1637 four- or six-digit display. | Pre-rendered text + brightness for a 7-segment screen. |
| TM1638 | Brightness + 17 data bytes — for the TM1638 module. | Same idea, for a larger TM1638 LED keypad. |
| Led Matrix | Brightness + 9 data bytes — mono- or bi-colour data for a small dot-matrix. | Per-pixel data plus a global brightness byte. |
| Custom | User-defined — pick the data code, count, element length, output type. | Whatever you've configured SimHub to send. |
Each subscriber also emits a Sync output — a u8 pulse that fires when a packet arrives, useful for triggering a downstream "refresh display" cycle without polling.
You attach a subscriber to the interface by selecting it from the interface drop-down — populated from every nSimHubInterface on the canvas.
nSimHubInterfaceInExt — extended command types
For commands with more complex framing — currently the PWM-output type — nSimHubInterfaceInExt adds extra plumbing the basic In module doesn't have (per-element counts, feature-code negotiation, ack codes). The dialog locks the fields once a Type is chosen.
Build a PWM-driven device (fan, vibration motor) by routing this subscriber's output into the nPWMOutput module.
LED output paths
LEDs are SimHub's most common payload. NodeBlue has three modules that decode it depending on the LED stack you're using.
nSimHubInterfaceLeds — strip / matrix over Serial
The drop-in for RGB LED strips and RGB LED matrices driven over the serial-SimHub interface.
| Parameter | Description |
|---|---|
| interface | The nSimHubInterface it subscribes to. |
| Type | Led Strip (a 1D strip — Count is user-set) or Led Matrix (a 2D matrix — Count fixed at 8×8). |
| Count | Number of LEDs (strip only). The module pushes the chosen count down into the LED driver it's wired to. |
| Code / Feature Code | The wire-format identifiers (auto-filled by Type). |
Output is a Buffer of RGB-data ready to feed into a nFastLed or nWS2812Serial driver — nSimHubInterfaceLeds automatically updates the downstream driver's Nb Leds parameter when you change Count, so you don't manage two counts that have to match.
For monochrome LED displays driven by SimHub colour data, drop an nRGBToMonochrome between this module and the driver — nSimHubInterfaceLeds also propagates Count into it.
nSimHubHIDLeds — HID-flavoured LED report
For HID-side LED delivery (nSimHubDevice), nSimHubHIDLeds is the equivalent.
| Parameter | Description |
|---|---|
| Count | LED count. |
| ReportID | The HID report ID the LED data arrives on (default 0x68). |
Input: an HID report buffer (wired from the HID-device's output, or from a generic HID input handling). Output: a buffer of RGB-bytes ready for nFastLed / nWS2812Serial.
nSimHubLedsNextion — LEDs displayed on a Nextion screen
When the "LEDs" are actually rendered on a Nextion display (RPM bar widgets, status pixels), nSimHubLedsNextion produces the data in a format the Nextion-side modules expect:
| Output | What it carries |
|---|---|
Data | RGB pixel data. |
Bright | Brightness byte. |
B+D | Brightness + Data concatenated — usually what the downstream Nextion handler wants. |
This module attaches to a nNextionInterface automatically (the include directive does the wiring); no interface drop-down to pick.
Sending data back — telemetry-out (rare)
Most SimHub deployments are one-way from PC to board — the board displays / actuates whatever SimHub computes. The Tx side of the interface modules exists for the few cases that need an upstream channel:
- Acknowledgements — confirm a command was applied (some companion modules emit them automatically).
- Sensor read-back — push a temperature, a force-feedback gain, a current draw back to SimHub's dashboard.
- Custom plugin — a user-written SimHub plugin pulling state from the board.
Wire whatever buffer you want to send into nSimHubInterface.Tx / nSimHubDevice.Tx. SimHub's incoming-data plugin docs cover how the receiving side reads it.
A worked example — RPM LEDs on an RGB strip
The "Hello World" of SimHub integration: a 16-LED WS2812 strip on the wheel showing engine RPM as a left-to-right bar that turns red at the shift point.
nSimHubInterface(USB-CDC) →Rx→nSimHubInterfaceLeds(Type =Led Strip, Count = 16) →Part D→nFastLed(data pin, LED type WS2812B) → physical strip.
On the SimHub side:
- In SimHub, Add a new device → pick Arduino → Serial → COM port.
- Open the LED designer, set the LED count to 16, draw an RPM-bar profile mapping to your game's RPM range.
- Hit Send to device — the strip lights up.
Total: three modules on the canvas. No firmware writing, no LED-mapping code — nSimHubInterfaceLeds does the decoding and pushes the count straight into the FastLed driver. See SimHub/Serial/Teensy32_PL9823_FastLeds or SimHub/Serial/TeensyLC_WS2812Serial.
A worked example — TM1637 dashboard
Same idea, but the SimHub data drives a TM1637 4-or-6-digit display showing speed / gear / sector delta.
nSimHubInterface→Rx→nSimHubInterfaceIn(Type =TM1637) →B+D→nTM1637(CLK / DIO pins) → physical display.
The B+D output of the In module is the exact buffer shape nTM1637 expects — no buffer-split, no remap. See SimHub/Serial/TM1637_6Digits.
A worked example — full wheel with USB-HID + LEDs
A wheel that's both a HID gamepad (buttons / encoders / paddles) and a SimHub LED target:
nFFBHIDornHIDfor the gamepad side (axes, buttons, hat).nSimHubInterfacein parallel, on a CDC serial endpoint, for the LED side.
The USB type would be serialhid (HID + CDC), and SimHub picks up the serial port for LED commands while the game sees the HID gamepad. See the TM*_Wheel_USB.txt family under SimHub/Serial/.
A worked example — over the air via NRF24
A wheel-side board receives the SimHub data via a wired host link (USB serial), then forwards it over NRF24 radio to the actual wheel sitting on the rim:
nSimHubInterface(on the host-link board) → SimHub commands arrive → selected companion → → → packed into a buffer →nNRF24(channel) → over the air → receiver board →nNRF24(matching channel) → drives the wheel-side LEDs / TM1637 / matrix.
The "+Radio" variants of the example files show this exact pattern — SimHub/Serial/Max7219_LedMatrixRadio, SimHub/Serial/RGBLedMatrixRadio.
Debugging
Both transports expose per-area debug flags (Packet / Parser / Commands / Errors), enabled by selecting a debug serial port in the module dialog (usually SerialUSB1 on Teensy or a hardware UART on other boards). The flags add Serial.print traces of the relevant pipeline stages — useful when SimHub seems to talk but no commands arrive at the board.
The flags are admin-only (hidden from regular users) — turn them on only while debugging and remove them before sharing the project, otherwise the debug traffic eats into the loop budget.
For the SimHub side, the SimHub log window (Settings → Logs) shows every command sent / received with timestamps — the first place to look when handshake fails.
What's next
With buttons, FFB and SimHub covered, the only remaining sim-racing topic is the clutch / paddle bite-point engine — nClutchManager, which gets its own deep-dive in Clutch & Paddle Bite Point. After that, the game-controller test page is what you'll use to verify it all works.