FoundryNet / Error codes / MQTT / Sparkplug B CONNACK 2
MQTT / Sparkplug B error code

CONNACK 2 (0x02) — Connection Refused: identifier rejected

The client id is malformed or not permitted. The broker understood the connection attempt and specifically refused the identifier.

Start free MQTT / Sparkplug B → canonical

Diagnosis

When you hit this


Resolution

How to fix it

  1. Make ids unique and boring
    Alphanumerics and hyphens, under 23 characters. Derive from a stable device identifier, not from a random value that changes each boot.
  2. Look for a duplicate before blaming the format
    If two clients share an id, both will appear to connect and drop repeatedly. Broker logs show both connections.
  3. Never use empty id with a persistent session
    An empty id requires clean session true. The combination with false is a protocol error.

Normalization

What Forge does about it

This is a configuration or addressing mistake on the wire, upstream of anything Forge sees. Where Forge helps is the step after you fix it: once the point returns data, its vendor tag name maps to a canonical field automatically, so you do not also have to hand-maintain a name table for every point you just re-addressed.


Connect

Normalize MQTT / Sparkplug B telemetry

One MCP endpoint serves every protocol adapter. 16,908 curated mappings, 366 canonical fields.

# normalize telemetry from MQTT / Sparkplug B — and 13 other protocols
claude mcp add --transport http forge https://mcp.foundrynet.io/mcp \
  --header 'Authorization: Bearer YOUR_FORGE_KEY'
✓ forge connected — 32 tools available

Related

Keep reading

Other MQTT / Sparkplug B codes: CONNACK 1 CONNACK 3 CONNACK 5 Sparkplug NDATA before NBIRTH Sparkplug seq out of order

Equipment that speaks MQTT / Sparkplug B: MiR (Mobile Industrial Robots) Chemical process Food & beverage process Pharma process (GMP) OTTO Motors Geek+ (Geekplus) Locus Robotics Omron AMR (LD/HD) Trumpf

MQTT / Sparkplug B protocol hub

Other protocols: Modbus OPC UA FANUC FOCAS EtherNet/IP PROFINET / S7 BACnet/IP J1939 (CAN) MTConnect ROS 2 (DDS) SNMP MAVLink HTTP / REST CSV ingest

All error codes · All OEMs · All protocols

Industrial AI fails at the data layer. The Machine Agent explains why, weekly. Read it →
Get the thesis behind this infrastructure — The Machine Agent, weekly.