Solved! HC-12 ERROR

Hello,

I have 2 MEGA2560 boards trying to communicate over radio by means of 2 HC-12 modules. Everything worked fine in the beginning. I could send and receive characters from one device to the other and vice versa. Then I started to mess around with baudrates what also worked in the beginning. But suddenly I got continuously ERROR messages from one module after sending an AT-Command in Programming mode.

The curious thing is, that I can't find any documentation about this behaviour. But it becomes even more wired. As I thought that I might have destroyed the module, I ordered some new ones and ... same behaviour from the first moment.

So I thougth maybe the arduinos Serial-Port might be the problem. I'm using the Serial3-Port. But on the ohter hand I get some serious communication with the HC-12.

Example:
If I send in Programming Mode (HC-12 Pin:SET->GND): AT+RB
I get:
OK-B9600
ERROR
ERROR
ERROR
:

So it seems that I'm receiving these ERRORs from the HC-12 and the serial port seems to work correctly.

Any ideas?

The core part of the arduino-code is:

  if (Serial3.available()) {
    int inByte = Serial3.read();      // read from Serial3
    Serial.write(inByte);                // write it to Serial
}

An error message is generated if the HC12 is sent a message it doesnt understand, ie cant parse.
Sounds like the MEGA is sending unwanted chars to the HC12.
Can you send data to the HC12 from another source, ie something like a PC serial terminal?
The other possibility is that you have changed the serial data format from the default (8 data bits , 1 stop bit) to something else.
ie the data rate is right, but the data bits and or stop bits are wrong.

Thank you mauried!

But as you can see in the example above the HC-12 understands the messages and also responds correctly to it but THEN starts these ERROR Messages.
I'm almost sure, that I haven't changed the serial format (8 data bits, 1 stop bit). But maybe this was the reason. I now have set the parameters back to SERIAL_8N1 (the default) and it works again.

Thank you very much!

palmstroem:
I now have set the parameters back to SERIAL_8N1 (the default) and it works again.

Hello!

I have changed the default 8N1 with AT+U8O1.. and now it's not possible to communicate with Arduino.
Can you please explain me hot to return to default setting?