Hi, i am trying to Send and Receive comands via HC-12.
This is the code that's suposed to receive comands from the HC-12 (command is a String variable), but for some reason it always showes the error message even if the comand that he has just received correspods to one of the options. How can i Solve this issue? Thanks, Luca.
The fact that the condition does not work obviously means that the command line and the line in the condition are not equal to each other.
Since they look the same on print, it means there are non-printable characters in the received string. Try printing the received data character by character in hexadecimal format
As I expected, you have a service character with a code 0xD at the end of the command = CR (carriage return)
You need to either remove it from the command on reception, or not send it on transmission
Now it seams working but only forr one of the four comands that it's suposed to receive (in the code i shared u can see only 3 because the other one is in another part of the program). How can i integrate the other comands?