[SOLVED] Problem With #include < SoftwareSerial.h >

where is the #include <SoftwareSerial.h> ?
i have some Problem IDE Say: ERROR Compilling for Board …
i think Caused Do not find The SoftwareSerial.h’s file

So How can i do Arduino with ESP 01.
I flashed The Esp 01 With “AT22SDK10020150320boot12.bin” So Which Sketchs Are For Arduino Serial Communication With ESP 01 ?

Do you have that library installed?

https://www.arduino.cc/en/Reference/SoftwareSerial

@taitrt so i want the arduino(uno , nano … ) sketch.

Which boards are you using? Do you have an arduino uno AND a ESP01 for wifi connection? or do you just have an ESP01?

@taitrt

dosent work with any board

So are you using an arduino mega? or an arduino uno? How many physical microcontrollers are sitting in front of you:

https://www.arduino.cc/en/Main/Boards

Uno , Nano , Mega
i just click on compile for test sketch but …

[14646] Failed to enable MUX
[15657] Failed to set STA mode

Sounds like you do not have all the proper Arduino libraries installed, or installed incorrectly.

Reinstall the latest Arduino IDE and make sure you add in the ESP8266 board support.

Please copy/paste your code (formatted properly as required) instead of just screen shots. Thank you.

@Gunner
I have this :point_up_2:t2:error

I have no idea what you are trying to say :wink:

@Gunner i success to use arduino with esp 01 but on app side the device connect and disconnect again connect and disconnect. why?on serial monitor i have:

[9] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.4.8 on Arduino Nano

[592] Connecting to **************
[13628] AT wersion:1.2/0.0(Jul  1 3016 20:04:44)
SDK vershon:1.5.4.1(39cn

[14678] Failed to set STA mode
[34892] Ready (ping: 11ms).
[44914] Login timeout
[201092] Ready (ping: 14ms).
[211115] Login timeout
[257491] Ready (ping: 18ms).
[267513] Login timeout
[282618] Ready (ping: 11ms).
[292640] Login timeout

You are using SoftwareSerial for your ESP connection, so drop the BAUD rate in both the sketch and on your ESP to 9600.

And as stated before, please copy paste your sketches next time… too hard to read screenshots :wink:

1 Like

you said that i use a same baudrate for both esp and arduino serial? like this:

/*************************************************************
  Download latest Blynk library here:
    https://github.com/blynkkk/blynk-library/releases/latest

  Blynk is a platform with iOS and Android apps to control
  Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build graphic interfaces for all your
  projects by simply dragging and dropping widgets.

    Downloads, docs, tutorials: http://www.blynk.cc
    Sketch generator:           http://examples.blynk.cc
    Blynk community:            http://community.blynk.cc
    Follow us:                  http://www.fb.com/blynkapp
                                http://twitter.com/blynk_app

  Blynk library is licensed under MIT license
  This example code is in public domain.

 *************************************************************
  WARNING!
    It's very tricky to get it working. Please read this article:
    http://help.blynk.cc/hardware-and-libraries/arduino/esp8266-with-at-firmware

  You’ll need:
   - Blynk App (download from AppStore or Google Play)
   - Arduino Uno board
   - Decide how to connect to Blynk
     (USB, Ethernet, Wi-Fi, Bluetooth, ...)

  There is a bunch of great example sketches included to show you how to get
  started. Think of them as LEGO bricks  and combine them as you wish.
  For example, take the Ethernet Shield sketch and combine it with the
  Servo example, or choose a USB sketch and add a code from SendData
  example.
 *************************************************************/

/* Comment this out to disable prints and save space */
#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[] = "*********************************";
char ssid[] = "******************";
char pass[] = "*****************";

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

// 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(115200);

  // 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, "192.168.1.6", 8442);
  Blynk.begin(auth, wifi, ssid, pass, IPAddress(192,168,1,6), 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!
}

and another problem is when i use local server setring uncomment in this example:

  Blynk.begin(auth, wifi, ssid, pass, IPAddress(192,168,1,6), 8442);

said

'IPAddress' was not declared in this scope 

No, I said you need to set the BAUD rate of 9600 in BOTH the ESP (via AT commands) and in your sketch: #define ESP8266_BAUD 9600

I don’t know why it is shown this way in the examples??

This is what works for me:

Blynk.begin(auth, wifi, ssid, pass, "10.10.3.13", 8442);

NOTE: The quotes and the use of periods instead of commas… might work with commas? but I haven’t bothered to test as this works just fine.

ok but it cofigured to " 115200 " as default firmware you mean i decrease it on both side ESP(Firmware) and Sketch(ESP_BAUDRATE) ?
so what is wrong with 115200?

i use this method but problem is IPAddress i ask about IPAddress.
Thank You.

@Gunner
what is this problem?

[14659] Failed to enable MUX
[15670] Failed to set STA mode

I don’t know… I see the Failed to enable MUX on mine as well (ESP-01 & MEGA) but it doesn’t seem to affect anything.