Post topics, source code that relate to the Arduino Platform

User avatar
By rmark
#84595 I ordered an ESP01 module (black version, 1MB flash size, 26MHz crystal) which I want to use with Arduino Nano.
On the ESP module I updated the firmware, current versions: AT 1.5.0.0, SDK 2.1.0.
My problem is that the Arduino can't communicate properly with the ESP module.
I tried both SoftwareSerial and AltSoftSerial (pin 8,9) but neither of them works well.
The ESP's baudrate is 115200. A simple AT command is still almost always works well, but a longer one, like AT+GMR gives wrong answer many times, e.g. there are garbage characters in the answer or the command is simply not recognized.
I can't change the baudrate since my ESP does not recognize AT+CIOBAUD command. So I can't try other baudrates yet.
The problem must be in the software serial as the ESP works well if I connect its RX TX to the Arduino's RX,TX pins (can list the APs and can connect, gets IP address, etc.)
Can anyone help? Why these fails? The ESP still connected with ~10cm wires. Does it already matters at this speed?
Can anyone send an ESP8266 firmware in which I can set the baudrate? (I downloaded firmwares from different places, but only two of them works at all, they don't know the CIOBAUD command)


Example ino file:
Code: Select all#include <AltSoftSerial.h>
AltSoftSerial altSerial;

void setup() {
  Serial.begin(115200);
  while (!Serial) ; // wait for Arduino Serial Monitor to open
  Serial.println("AltSoftSerial Test Begin");
  altSerial.begin(115200);
}

void loop() {
  altSerial.print("AT+GMR\r\n");
  delay(100);
  while (altSerial.available()) {
    char c = altSerial.read();
    Serial.print(c);
    Serial.available();
  }
  delay(1000);
}


And its output:
Code: Select allAT+GMR
AT version:1.5.0.0(Oct 24 2017 12:03:18)
SDK version:2.1.0(ace2d95)
cAT+GMR
AT version:1.5.0.0(Oct 24 2017 12:03:18)
SDK version:2.1.0(ace2d95)
cAT+GMR
AT version:1.5.0.0(Oct 24 2017 12:03:18)
SDK version:2.1.0(ace2d95)
cAT+GMR
AT version:1.5.0.0(Oct 24 2017 12:03:18)
SDK versi⸮K⸮r⸮r⸮B
⸮⸮⸮d95)
coAT+GM5

ERROR
AT+GMR
AT version:1.5.0.0(Oct 24 2017 12:03:18)
SDK version:2.1.0(ace2d95)
c
...




An other strange thing is that AltSoftSerial cuts the output around at 80 bytes (size of its RX buffer), but if I use a modified code it prints all of the output (except when there are fail characters...) :

Code: Select allvoid loop() {
  if (Serial.available()) {
    altSerial.print( (char)Serial.read() );
  }
  if (altSerial.available()) {
    Serial.print( (char)altSerial.read() );
  }
}