HC-12 worked great and then just stopped receiving

Have a pair of HC-12 (not knock off ones) ran the below code yesterday fine both worked perfect.. This morning I started messing with it and both will send but neither will receive. Checked band rates/changed through all the settings and updated codes all have same result. Tried to put them in AT mode (Set to Gnd) and would not respond. Both are on arduino mega2560.. Also changed to different standard HC codes same results. Any ideas?

#include <SoftwareSerial.h>

SoftwareSerial HC12(10, 11); // HC-12 TX Pin, HC-12 RX Pin

void setup() {
  Serial.begin(115200);             // Serial port to computer
  HC12.begin(115200);               // Serial port to HC12

}

void loop() {
  while (HC12.available()) {        // If HC-12 has data
    Serial.write(HC12.read());      // Send the data to Serial monitor
  }
  while (Serial.available()) {      // If Serial monitor has data
    HC12.write(Serial.read());      // Send that data to HC-12
  }
}

115200 baud is too much for SoftwareSerial on AVR, try use baudrate 9600 or 19200

And it’s not clear why even use a softserial on Mega, where there are enough hard ports

Was just testing the pair and distance with this code, I started on 9600 and just ended on 115200 trying different bauds to try and get it work. Its back on 9600 now with same results.

Enter AT mode by disconnecting power, connect set pin to Ground, then apply power. You should be in AT mode at 9600 baud.

Try AT + DEFAULT to get back to factory settings.

Same results :frowning: Thank you tho

The only way to tell if it is sending is to use a receiver.

Thats true, its just crazy that they worked so well yesterday and today this

How are they being powered?

Does AT mode and all the responses look normal?

Not sure why but SoftwareSerial stopped but moved to hard ports and it works

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.