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
}
}
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.