Post topics, source code that relate to the Arduino Platform

User avatar
By Gilles Orazi
#46326 Hi,

I'm trying to work with a small ESP8266 board and I have issues to communicate with it.

I first did a very basic test : I wired the board to the Rx and Tx pins of an arduino uno and sent commands manually from the serial monitor interface in the Arduino IDE. It worked very well, and I was able to send commands like AT, AT+CWLAP

The next step I took, was to send commands and read responses directly from the arduino. Unfortunately it does not work as expected. I tried various approaches with the Serial interface or the SoftwareSerial library. I always get some response with a kind of random characters.

The most basic code I tried was this one :

#include <SoftwareSerial.h>
SoftwareSerial ESPserial(2,3); // RX | TX

void setup()
{
Serial.begin(115200);
ESPserial.begin(115200);
}

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

Using this sketch to relay my manual commands from the Serial monitor, I only get some weird stuff in response.
I also tried to vary the baud rate, with no success.
I also tried to use Serial to communicate and used a LCD display to monitor, but I had no success.

Any idea / hint ?
Gilles:
User avatar
By Damaging_Ostrich
#46375 I'm trying to do something similar and ran into like issues. A couple of things to check out:
1. From what I read only certain pins can be used with software serial
2. Fast rates cause issues.

I got everything working 100% above after changing the baud rates to 9600.

Good luck
User avatar
By Gilles Orazi
#46782 Hello,

I lowered the baud rate and things are working better now. To do this, put the ESP8266 directly on the serial lines of the Arduino and send the command (AT+CIOBAUD=19200) from the serial monitor. Then, it's possible to unplug the ESP8266 and plug it into another project, it keeps the baud rate.

Thanks for the help, it actually put me on the way to the solution.

Regards,
Gilles