Hello everyone,
I kindly ask for guidance as I feel I am stuck on a simple project. I am trying to make an Arduino UNOr3 talk to a ESP8266 via Serial. Almost all tutorial I see online use custom pins with SoftwareSerial. Unfortunately I run out of digital pins so I can only use RX/TX.
I understand that RX/TX are used by USB communication so I usually follow this workflow:
- unplug ESP8266
- connect USB to PC and upload sketch
- unplug USB
- plug ESP8266
- plug a usb-wall-socket charger directly for power
Afaik, the above procedure should let me use the RX/TX as I please.. but I can't seem to send/receive anything..or so it seems. Also:
- afaik RX/TX on the UNOr3 should work with 115200 no problem
- if I put the UNOr3 in "reset" mode, I am able to talk to the ESP module from my PC SerialMonitor. See below for proof that the ESP module works.
- the ESP unit has a blu led that blinks when it sends data. When I power it up, I see it blinking (i.e. it's sending a "ready"), but when I expect it to send an "OK" to my "AT" command, I don't see the led blinking.
I am working with a super simple code:
void setup() {
Serial.begin(115200);
delay(1000);
Serial.print("AT\r\n"); // this should get an "OK" from the esp module
delay(1000);
char* reply = Serial.readString().c_str();
print_text_on_lcd(reply);
}
void loop() {}
ESP Module while talking directly with PC:
AT
OK
AT+GMR
AT version:1.3.0.0(Jul 14 2016 18:54:01)
SDK version:2.0.0(5a875ba)
Farylink Technology Co., Ltd. v1.0.0.2
May 11 2017 22:23:58
OK
So, my question is, why don't a get a reply from the ESP unit? Any help or guidance is much appreciated!
Thanks!