HC-05 antwortet auf jeden AT-Befehl außer reinem AT mit ERROR:(0)
Von English mit KI übersetzt ·
Eine kurze Frage, wahrscheinlich peinlich. Ich verwende ein HC-05 als serielle Brücke, damit eine Laborwaage Gewichte an ein Gateway senden kann, das sie an Hermetry weiterleitet. Ich möchte das Modul umbenennen und seine Baudrate auf 9600 setzen.Halte ich beim Einschalten den Taster gedrückt, blinkt die LED langsam alle 2 s, das Modul ist also im AT-Modus. Ich sende von einem Uno-Sketch aus, der den Serial Monitor mit 38400 an den HC-05 durchreicht. „AT“ liefert „OK“. Alles andere:
AT+NAME=BAL-07
ERROR:(0)
AT+UART=9600,0,0
ERROR:(0)
Quick one, embarrassing probably. I’m using an HC-05 as a serial bridge so a lab balance can send weights to a gateway that forwards them to Hermetry. I want to rename the module and set its baud to 9600.
Holding the button at power-up, LED blinks slowly every 2 s, so it’s in AT mode. I’m sending from an Uno sketch that passes the Serial Monitor through to the HC-05 at 38400. „AT“ gives „OK“. Everything else:
AT+NAME=BAL-07
ERROR:(0)
AT+UART=9600,0,0
ERROR:(0)
Von English mit KI übersetzt ·
Vielleicht stimmt die Baudrate nicht? Probier 9600 im Sketch.
Maybe the baud rate is wrong? Try 9600 in the sketch.
Von English mit KI übersetzt ·
Das Gleiche ist mir mit einem aus einem Starter-Kit passiert, ich verfolge den Thread.
Same thing happened to me with one from a starter kit, following.
Von English mit KI übersetzt ·
Die Baudrate stimmt, sonst würde auch das einfache AT nicht mit OK antworten. ERROR:(0) ist der Code des HC-05 für einen Befehl, den er nicht parsen konnte, und bei diesem Modul bedeutet das fast immer das Zeilenende. Er verlangt, dass jeder Befehl mit CR+LF endet. Wenn der Serielle Monitor nur auf „No line ending“ oder „Newline“ steht, kommt das kurze „AT“ manchmal durch, die längeren Befehle aber nicht.Stellen Sie den Monitor auf „Both NL & CR“. Schreiben Sie die Befehle außerdem in Großbuchstaben. Bei einigen Firmware-Versionen funktioniert AT+NAME nur, wenn der KEY/EN-Pin während des gesamten Vorgangs auf High gehalten wird, nicht nur beim Einschalten. Wenn NAME weiterhin fehlschlägt, verbinden Sie KEY während des Sendens mit einem Draht mit 3,3 V.AT+UART=9600,0,0 legt danach die Baudrate im Datenmodus fest. Der AT-Modus bleibt davon unabhängig bei 38400.
The baud is right, otherwise plain AT wouldn’t answer OK either. ERROR:(0) is the HC-05’s code for a command it couldn’t parse, and with this module that almost always means the line ending. It wants every command to end with CR+LF. If the Serial Monitor is on „No line ending“ or „Newline“ only, the short „AT“ sometimes gets through and the longer commands don’t.
Set the monitor to „Both NL & CR“. Also type the commands in capitals, and on some firmware versions AT+NAME only works while the KEY/EN pin is held high the whole time, not only at power-up. If NAME still fails, tie KEY to 3.3 V with a wire while you send it.
AT+UART=9600,0,0 then sets the data mode baud. AT mode stays at 38400 regardless.
Von English mit KI übersetzt ·
Der Monitor stand auf „Newline“. NL & CR sowie NAME und UART wurden gleichzeitig gesendet. Kevin, die Baudrate war in Ordnung, der AT-Modus ist bei diesen immer 38400.
Monitor was on „Newline“. Both NL & CR and NAME and UART went through at once. Kevin, the baud was fine, AT mode is always 38400 on these.
- Du musst angemeldet sein, um auf dieses Thema antworten zu können.
Mitdiskutieren
Melde dich an, um Fragen zu stellen und zu beantworten, hilfreiche Beiträge mit „Gefällt mir“ zu markieren und die Antwort zu kennzeichnen, die dein Problem gelöst hat. Jeder Beitrag bringt Punkte und Stufen.

