ESP8266 not responding to MCU AT command but responding to terminal AT command

I have tested it with ITEAD with arduino mega and Arduino uno available library link is given below.

In this i have used SDK 0.18 and 0.22 version and latest version 2.0.1 but it does not respond to any of the command from MCU whereas it is working fine with usb to serial converter using terminal.
I have used the bidirectional level shifter also between Arduino and ESP8266 .
Supply current rating is also 1A.

So i want to know that whether how could i can make it work using the Other MCU apart from terminal.

I have searched lot of place,but i did not find any satisfactory answer and applied all the approaches to make it work.I have used ESP8266 SDK version 2.0.1 latest with STM32F401,STM32F407 .But it does not respond to AT Command with STM32 or any other microcontroller.

I have tested it with ITEAD with arduino mega and Arduino uno available library link is given below.

In this i have used SDK 0.18 and 0.22 version and latest version 2.0.1 but it does not respond to any of the command from MCU whereas it is working fine with usb to serial converter using terminal.
I have used the bidirectional level shifter also between Arduino and ESP8266 .
Supply current rating is also 1A.

So i want to know that whether how could i can make it work using the Other MCU apart from terminal.

I have searched lot of place,but i did not find any satisfactory answer and applied all the approaches to make it work.

Post a wiring diagram. I guess a swap of RX/TX.

Thanks for the quick reply. I am attaching written representation of how i connected and i have checked it and it is ok only TX----RX and RX----TX of arduino and esp8266.

I am also seeing 1 more thing in terminal that for every small letter case the string coming from esp8266 is gibberish while capital letter words are ok.

IMG_20170831_235232.jpg

Please post the code you use on the Mega. Die you try to use a simple forwarder sketch:

void setup() {
  Serial.begin(57600);
  Serial1.begin(57600);
}

void loop() {
  if (Serial.available()) {
    Serial1.write(Serial.read());
  }
  if (Serial1.available() {
    Serial.write(Serial1.read());
  }
}

/**

  • @example ConnectWiFi.ino
  • @brief The ConnectWiFi demo of library WeeESP8266.
  • @author Wu Pengfeipengfei.wu@itead.cc
  • @date 2015.03
  • @par Copyright:
  • Copyright (c) 2015 ITEAD Intelligent Systems Co., Ltd. \n\n
  • This program is free software; you can redistribute it and/or
  • modify it under the terms of the GNU General Public License as
  • published by the Free Software Foundation; either version 2 of
  • the License, or (at your option) any later version. \n\n
  • THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  • IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  • FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  • AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  • LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  • OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  • THE SOFTWARE.
    */
    #include "ESP8266.h"

#define SSID "Xender_APf402"
#define PASSWORD "vipin123"

ESP8266 wifi(Serial1);

void setup(void)
{
Serial.begin(9600);
Serial.print("setup begin\r\n");

Serial.print("FW Version: ");
Serial.println(wifi.getVersion().c_str());

if (wifi.setOprToStation()) {
Serial.print("to station ok\r\n");
} else {
Serial.print("to station err\r\n");
}

if (wifi.joinAP(SSID, PASSWORD)) {
Serial.print("Join AP success\r\n");
Serial.print("IP: ");
Serial.println(wifi.getLocalIP().c_str());
} else {
Serial.print("Join AP failure\r\n");
}

Serial.print("setup end\r\n");
}

void loop(void)
{
}
This code i have used

ConnectWiFi.zip (7.96 KB)

This code i have used

You forgot the code tags, please use them next time!

What baud rate do you use when you connect the USB2serial and use the terminal to talk to the ESP8266?

Hi ,

I have used 115200 to communicate with AT command from the ESP8266 and In this code i have checked with 115200,9600,38400,1200,2400,4800 all baudrate with the code i shared.

With terminal i only used the 115200 and i will attach the response that i got from the ESP8266.There is no issue from the Terminal At commands

Thanks for the support you are giving.

Regards,
Vipin

Terminal.PNG

With terminal i only used the 115200 and i will attach the response that i got from the ESP8266.There is no issue from the Terminal At commands

Excuse me but that output doesn't look like "no issue" to me. There are a lot of strange characters in the output that shouldn't be there. If the connection to the Mega is as bad as this I understand that the sketch does not work.