Lab

Why every AT command returns ERROR

AT is a line protocol. The module does not act on characters as they arrive — it collects them and waits for a terminator that tells it the line is finished. The Serial Monitor’s line-ending dropdown is what decides whether it ever sees one, which is why every command can fail while nothing is wrong with your wiring.

It opens where your IDE opens. Since Arduino 1.8.6 a fresh install has defaulted to New Line — a bare line feed, 0A — and IDE 2 kept that default. So an HC-05 gets 41 54 0A and says nothing at all. You are already sending a byte. It is already the wrong one, and nothing on screen tells you. Move the dropdown to Both NL & CR and the same command answers OK.

Watch the order on that one, incidentally: the label reads “NL & CR” and the bytes go out the other way round — carriage return first, then line feed.

Then switch the module to a genuine HM-10 without touching the dropdown. It returns ERROR — because it treats the line as complete on its own, so the carriage return you are appending became part of a command it does not have. The two failures mean opposite things: silence is not enough, ERROR is too much.

Last, compare the genuine HM-10 with the CC41-A sold under the same name. They want opposite settings. That is why a perfectly good tutorial produces a perfectly bad result: the author had one module on the desk.

THE MODULE ON YOUR BENCH
command mode at 38400 — hold the button down while you apply power
SERIAL MONITOR DROPDOWN
appends 0A
WHAT ACTUALLY GOES DOWN THE WIRE
41540A
the amber bytes are the only thing the dropdown changes
WHAT COMES BACK
— nothing at all —
Still nothing. HC-05 wants 0D 0A — both bytes. You sent 0A, so the line is still not terminated as far as it is concerned.

What this shows

Every AT command failing is almost never a broken module. AT is a line protocol: the module collects characters and acts only when it sees the terminator it expects, so the Serial Monitor's line-ending dropdown decides whether anything happens at all.

There is no single correct setting. An HC-05 and the CC41-A clones want Both NL & CR; an HC-06 and a genuine HM-10 want no line ending at all. A genuine HM-10 and the clone sold as one want opposite settings, which is why a good tutorial can produce a bad result.

The two failures mean opposite things. Silence means the module is still waiting for a terminator it never received, so your characters are sitting in its buffer. ERROR means it did see a complete line, and the bytes you appended became part of a command it does not have.

That distinction tells you which way to move the dropdown, which is the difference between a minute and an evening.

The bytes are shown as they go down the wire, because a terminator is invisible on screen and that is exactly why this fault is so hard to see.

Common questions

What line ending does an HC-05 need?
Both NL & CR — a carriage return and a newline together. With any other setting the module never sees a finished line and stays silent. Its command mode is also a fixed 38400 when you enter it by holding the button down while applying power, whatever its data rate is set to. That number goes in the sketch, not the Serial Monitor, which stays at 9600.
Why does my HM-10 return ERROR on every command?
Almost certainly because the dropdown is not on No line ending. A genuine HM-10 treats the line as complete on its own, so an appended carriage return becomes part of the command and it rejects the whole thing. It also takes uppercase only.
I get no reply at all rather than ERROR. Is the module dead?
No, and the difference matters. Silence means the module is still waiting for a terminator, so it has not acted on anything yet — move the dropdown towards more bytes. ERROR means a complete line arrived and was not understood, so move it towards fewer.
Why do the HM-10 and the CC41-A need opposite settings if they are sold as the same part?
Because they are not the same part. The CC41-A, AT-09 and MLT-BT05 are different firmware on a similar radio, sold under the HM-10 name. They want Both NL & CR where a genuine HM-10 wants none, so the first thing to settle is which one you actually own.