cattledog:
The software serial constructor is from the point of view of the Arduino, and is ordered as Rx,Tx
Do you have the T pin of your constructor(Arduino Rx) connected to the Tx pin of the HC12 and the R pin of your constructor(Arduino Tx) connected to the Rx pin of the HC12 module?
Yes, I do and I can make each module communicate with my PC via arduino + USB. I get OK messages when sending AT commands.
cattledog:
I think, that he transmission every 100ms and the receiver blnk(blue, 100) will cause the blink led to stay on continually.
Given that there will be any signal, the LED should be at least blinking. It doesn't turn on at all. No, it's not broken, I've just tested it again.
cattledog:
digitalWrite(S, HIGH);
delay(1000);
HC12.print(F("AT+DEFAULT\r\n"));
delay(1000);
digitalWrite(S, LOW);
I can see that you've changed the order of digitalWrites (along with a few other things) in my receiver sketch, but when I try it out it still does not work.
GolamMostafa:
Upload the following simple codes in your Sender and Receiver Arduinos to do functional check of the HC12 Modules. If the Modules are working, Serial Monitor of Receiver will be showing 45 at 1-sec interval.
Huh, that's quite interesting. When trying to upload your codes I get the following error logs during the compilation stage:
<path>\BeegusDeeckoos\receiver.ino: In function '_GLOBAL__sub_I_HC12':
<path>\BeegusDeeckoos\receiver.ino:27:1: internal compiler error: Segmentation fault
}
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper.exe: fatal error: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr/bin/avr-gcc returned 1 exit status
compilation terminated.
c:/program files/windowsapps/arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld.exe: error: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Nano.
After a little bit of Scooby Dooing I found out that the foregoing error is caused by this line, for whatever the reason...
byte x = HC12.read();
I do believe I have my Arduino Studio updated. I will try to google these errors, but if you guys have any suggestions regarding what I should do, please let me know. Thank you for your response.
EDIT:
Arduino Studio update did help me with these weird internal errors, but I'm still stuck with 2 not working HC12s.