Hc12 woes or are they IDE woes?

I successfully tested all my hc12s on my win11 desktop computer, latest Arduino IDE, 2.3.5., using a USB-TTL converter and Termite. When I try to do the same with an UNO attached and using software serial to get an OK to AT prompt, I get question marks, like its a baud problem. When I attach the SAME circuit with all cables and jumper wires to a laptop computer running IDE 2.1.0 the HC12 responds to AT with an "OK". I've used these HC12 in 3-4 robots with no issues, but now I can't talk to them, at least not with the 2.3.5 IDE. I thought maybe it was USB2 (laptop) Vs USB3 (desktop) but I tried the USB2 on desktop with same results.
Any ideas? I'm grasping at straws.

#include <SoftwareSerial.h>
SoftwareSerial HC12(10,11);  //TX of HC12, RX of HC12

void setup() {
  Serial.begin(9600);  // Serial port to computer
  HC12.begin(9600);    // Serial port to HC12
 //FF pinMode (7,OUTPUT);// Select of HC12 for testing AT commands
  //digitalWrite(7,LOW);//LOW to select
  //digitalWrite(7,HIGH);// High to run normal
}
void loop() {
  while (HC12.available()) {    // If HC-12 has data
    Serial.write(Serial.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
  }
}type or paste code here

The only difference between not working on desktop to working with laptop is that the former has 2.3.5 IDE, the latter, 2.1.0 IDE. I have tried two different UNOs with same setup and the same results.

Are they both using the same core versions for whatever board you have selected? You didn't mention that.

Are all tool options (if any) set the same in both IDEs? You didn't mention that either.

Does the desktop IDE have the baud rate for the serial monitor set to 9600? Again, no mention.

So what happened when you changed the IDE version on the desktop to 2.1.0? Did it start working? You did try that, right?

So what happened when you changed the IDE version on the laptop to 2.3.5? Did it stop working? And you tried this too, right?

It is the same UNO, same wire connections, same HC12.
The tools are different because of the different versions of IDE, but in either case, I select the UNO R3, 9600 baud on each.
I did NOT change IDE on desktop to 2.1.0 (not sure how to do that other than re-installing)
And I didn't change the laptop to 2.3.5 because it is the one that is WORKING. I could change the desktop to 2.1.0, although I really like the GUI of 2.3.5. I'll look into it and see if I can downgrade.

I found version 2.1.0 but when I tried to install it, it said it couldn't find the server. Another popup said the "older version could not be removed". In this case the older version is my 2.3.5 which I didn't want to remove...it has so many board and library updates. (I use about 10 different boards).
All the HC12 I tested (with USB-TTL board) were set at DEFAULT (9600 baud, level 3, etc).

I believe there were issues with 2.3.5 and there is now a 2.3.6 available. You could try it.

Hi @queenidog.

Did you see the question marks in Termite, or in the Arduino IDE Serial Monitor?

When you did that, did you upload the sketch to the UNO board again? Or is the board still running the program that you uploaded while the board was connected to the desktop.

I ask this because if you uploaded the sketch again then we need to consider differences in the sketch dependencies environments (e.g., having different versions of the "Arduino AVR Boards" platform installed) of each computer as a factor. Differences in the installed dependencies can result in different behaviors from the program compiled from an identical sketch code.

Termite displayed proper data at the git-go. The question marks (inside a "diamond" icon) were only on the Arduino monitor.
And yes, I did upload the sketch every time when I switched from one to the other. Of note is that when I went from desktop (2.3.5) to laptop (2.1.0) the HC12 did not immediately work, forcing me to download the UNO once again, then it was okay. But doing the other way, moving USB to the desktop and downloading the UNO there did not work. In other words desktop 2.3.5 never works, the USB-TTL always works and the laptop always works.

thanks cattledog, I'll try it. I'll try anything....

I tried 2.3.6 on another computer and got the question marks. So I took the plunge and upgraded my 2.1.0 laptop that worked, to 2.3.6. It works!! So I eliminated V2.3.6 as the problem. The two desktops and the laptop used USB3. I'm going to scope those ports to see if there's a difference: frequency, voltage, noise. (I had a 220uFd cap across the voltage input to the hc12 but it didn't make a difference one way or the other).

1 Like

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