send AT commands to esp8266 via Arduino

6 years 1 month ago #2185 by DerTieja
Hello I use a esp8266. I can communicate with the esp without any problems over the serial monitor.

If i use the code from page
#include <SoftwareSerial.h>
 SoftwareSerial esp8266(2,3); // make RX Arduino line is pin 2, make TX Arduino line is pin 3.
                // This means that you need to connect the TX line from the esp to the Arduino's pin 2
                // and the RX line from the esp to the Arduino's pin 3
 void setup()
  esp8266.begin(9600); // your esp's baud rate might be different
 void loop()
  if(esp8266.available()) // check if the esp is sending a message   
    // The esp has data so display its output to the serial window   
    char c =; // read the next character.
   // the following delay is required because otherwise the arduino will read the first letter of the command but not the rest
   // In other words without the delay if you use AT+RST, for example, the Arduino will read the letter A send it, then read the rest and send it
   // but we want to send everything at the same time.
   String command="";
   while(Serial.available()) // read the command character by character
     // read one character
   esp8266.println(command); // send the read character to the esp8266

I will receive a lot of crap signs, see the attached picture :unsure:
The following user(s) said Thank You: osalval

Please Log in or Create an account to join the conversation.

6 years 1 month ago #2187 by NightOne
Normally crap signs like that means that the Baud rate is wrong... the firmware on the ESP determines the Baudrate and can be set.... to check if this is the case simple Serial.begin to 115200 or 57600 and see if that helps

Please Log in or Create an account to join the conversation.

Time to create page: 0.231 seconds

Forum latest

  • No posts to display.