Arduino + ESP8266 ( Failed to set STA Mode )

i already another topic but the errrors is different, so i make this topic about Failed to set STA Mode once again
im using this for my project

• Arduino Uno + ESP8266.
• Blynk Library version v0.5.2
ESP version = AT version:1/2.0.0(Jul 0 2016 20:04;45) SDK vdrsion:1.5.4

right now i dont know about this problem, it said :

blynk1

i cant login into my authtoken, i already set my ESP with

AT+CWMODE=1 or AT+CWMODE=3

this is my source code, i just copt the code from the blynk website


#define BLYNK_PRINT Serial


#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "xxx";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Nawangsari";
char pass[] = "xxx";

// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial1

// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 115200

ESP8266 wifi(&EspSerial);

void setup()
{
  // Debug console
  Serial.begin(9600);

  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);
  
  Blynk.begin(auth, wifi, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, wifi, ssid, pass, "blynk-cloud.com", 8442);
  //Blynk.begin(auth, wifi, ssid, pass, IPAddress(192,168,1,100), 8442);
}

void loop()
{
  Blynk.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!
}

thank you in advance

Your software serial baud rate is too high. Read this post:

Pete.

1 Like

so i need to change the baud of my ESP?
is this using this "AT+UART_DEF=9600,8,1,0,0 " ?

And changing this to match the 9600

i already try the 9600 and it said tah rsp is not responding :frowning:

2 Likes

“Serial.begin(9600)” change for “Serial.begin(115200)”

@Matheus_Curcio this is a year-old topic, but I’m curious to know why you think that changing the serial port speed (which is being used for debugging) will help this issue.

Pete.