0

I am having a problem when I want to run code like this on a Arduino Uno with esp8266-01. It's not working. In serial monitor nothing about esp.

#include <SoftwareSerial.h> 
SoftwareSerial esp8266(2,3);

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  esp8266.begin(9600);
  esp8266.print("AT+RST");
  delay(1000);
  esp8266.print("AT+CWMODE=1");
  esp8266.print("AT+CWJAP=\"ssisd\",\"pass\"");

}

void loop() {
  // put your main code here, to run repeatedly:

}

But when I load to Arduino empty code and to serial monitor write "AT" it working or I can connect to my wifi, but only with empty code.

enter image description here

RX is in pin 2 and TX is in pin 3. And i flashing esp with this Tutorial

| improve this question | | | | |
New contributor
Lukas is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • It should be a cross-connection like TX -> RX, RX -> TX, your wiring is wrong. – hcheung May 22 at 0:27
  • The wiring also doesn't match the code. The code is using SoftwareSerial on pins 2 and 3 to talk to the ESP8266. In the drawing it is connected to the hardware serial pins 0 and 1. – Delta_G May 22 at 3:25
  • to communicate with the esp-01, if you have an empty sketch in Uno, you connect the esp-01 to RX/TX of the USB chip on Uno. this chip is connected with TX to RX pin of Uno and with RX to Tx pin of Uno. – Juraj May 22 at 4:57
  • I had before TX and RX conected to pin 2 nad 3 i wrote this under picture. I tryed switch RX and TX still nothing. I tryed RX in pin 0 and TX in pin 1 and change code, but still nothing. – Lukas May 22 at 9:18
  • Try changing baud to 115200 ?? Sometimes it's not 9600, I talk about esp8266.begin ... – Shams El-Deen 2 days ago

Your Answer

Lukas is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.