vshymanskyy / TinyGSM

A small Arduino library for GSM modules, that just works
GNU Lesser General Public License v3.0
1.91k stars 708 forks source link

Problem changing baud rate using ESP8266 as modem when using AT commands #760

Open ZamperSPA opened 7 months ago

ZamperSPA commented 7 months ago

[ x ] Bug or issue with library functionality (ie, sending data over TCP/IP)

What are you working with?

Modem: ESP8266 , ESP-01S Main processor board: Atmega1284P TinyGSM version: 0.11.5 , but the new version also has the bug

Code:

void setBaudImpl(uint32_t baud) {
    sendAT(GF("+UART_CUR="), baud, ",8,1,0,0");//<---add the comma before the 8 to fix
    if (waitResponse() != 1) {
      sendAT(GF("+UART="), baud,",8,1,0,0");  // Really old firmwares might need this //<---add the comma before the 8 to fix
      // if (waitResponse() != 1) {
      //   sendAT(GF("+IPR="), baud);  // First release firmwares might need
      //   this
      waitResponse();
      // }
    }
  }

Scenario, steps to reproduce

use setBaud() function

Expected result

change the baudrate of communication

Actual result

ERROR is displayed on the serial monitor

Debug and AT command log

I did not save the logs, I simply added the comma and the issue was fixed.