Skip to the content.

Device status codes can lie

TL;DR: Don’t assume a device’s protocol uses HTTP/TCP status codes the way the web does — a 401 may mean “malformed command,” not “wrong credentials” — verify against the device’s own spec before you chase the wrong problem.

The situation

You’re integrating a device over its IP control protocol — a matrix switch, an AVR, a display. It speaks something that looks like HTTP, and it returns familiar-looking status codes. So when a control command comes back with a code you recognize, you interpret it the way you would on the web: 401 means authentication failed, 404 means wrong endpoint, and so on. You start debugging from that interpretation.

What bit me

A control command to a device returned 401. The natural reading — wrong password — sent debugging straight down the credentials path: re-check the token, re-pair, re-enter the secret. None of it helped, because in that device’s protocol 401 didn’t mean “unauthorized” at all. It meant the command itself was illegal or malformed. The real fix was the command’s format, not its authentication. Reading a borrowed status code with its borrowed meaning could have burned days.

The general rule

A device’s protocol owns the meaning of its status codes — not the web’s conventions. Vendors routinely repurpose numeric codes to mean whatever their protocol needs. The number looking familiar tells you nothing reliable; only the device’s own documentation does.

This holds because pattern-matching is seductive when you’re debugging: a code you’ve seen a thousand times hands you an instant hypothesis, and a wrong instant hypothesis is worse than no hypothesis at all — it sends you confidently in the wrong direction. The most expensive debugging sessions are the ones where you were sure you knew what the error meant.

How to apply it

How to verify