-->
Page 1 of 1

Getting error while using AT command on Softwareserial

PostPosted: Thu Feb 27, 2020 1:15 pm
by eickytang876
I am doing a project which requires using esp8266 and Arduino uno. When I try to use AT command to test esp8266 by using Arduino uno, it only shows error. However, AT commands work when I try to use USB to TTL and Realterm. My question is how to make AT command work while using Arduino board. Below is code.



#include <SoftwareSerial.h>
SoftwareSerial mySerial(5,4);
void setup()
{
Serial.begin(9600);
while (!Serial) {
}
mySerial.begin(9600);
}
void loop()
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
}



⸮⸮⸮⸮=!R⸮$A⸮⸮⸮ښ⸮⸮⸮⸮Zښ⸮⸮⸮⸮K⸮⸮χ T⸮⸮⸮v⸮X⸮E⸮⸮⸮⸮⸮.⸮⸮|⸮x⸮ڂ⸮Q⸮$҆v⸮⸮
ready
AT

ERROR




My TX pin of Esp8266 is connected to 5 pin and RX pin of esp8266 is connected to 4 pin. And I just directly connected to 3.3 v output of arduino uno for the power source of esp8266. Do I need any external power source or voltage regulator (ex AMS1117) for esp8266? Any help is greatly appreciated. Thanks!

Re: Getting error while using AT command on Softwareserial

PostPosted: Fri Feb 28, 2020 1:44 am
by JurajA
wire TX to RX. transmit to receive

Re: Getting error while using AT command on Softwareserial

PostPosted: Fri Feb 28, 2020 2:03 am
by eickytang876
JurajA wrote:wire TX to RX. transmit to receive

It works now. Thank you.