Use ESP8266 Wifi library with arduino pro mini

I want to use esp wifi library

#include<ESP8266WiFi.h>

My esp is attached with arduino pro mini. Previously i was using this library on same esp8266-01 module with arduino UNO and it was working good. Now i have changed the board and using PRO mini esp8266-01 is attached to arduino pro mini. How i can do this on pro mini? Gpio0 is also grounded. I’m using TTL to connect pro mini or powering up with laptop usb port.
Please help me

Please see this tutorial that shows everything on how to get it all set up.

androidfanboy: Please see this tutorial that shows everything on how to get it all set up.

That doesn't apply to the Pro Mini, it doesn't have an on-board USB-to-Serial adapter.

You need a 3.3V USB-to-Serial adapter to program the ESP.

A Beginner's Guide to the ESP8266

Pieter

What is the need for the Arduino? A glorified USB-to-serial converter? The tutorial seems to be about flashing the sketch directly to the ESP module after (possibly futilely) exercising the ESP's AT commands. The method would wipe the AT software from the ESP and require it to be reflashed if it is needed.

PieterP: That doesn't apply to the Pro Mini, it doesn't have an on-board USB-to-Serial adapter.

You need a 3.3V USB-to-Serial adapter to program the ESP.

A Beginner's Guide to the ESP8266

Pieter

I'm using TTL for arduino pro mini and esp is attached with pro mini

Is it possible that first u program ESP8266-01 with arduino UNO and after programming ESP8266 i reattach it with arduino pro mini? Will it work? Will all the other peripherals work that are attached to arduino pro mini?

izj99: Is it possible that first u program ESP8266-01 with arduino UNO and after programming ESP8266 i reattach it with arduino pro mini? Will it work? Will all the other peripherals work that are attached to arduino pro mini?

With the method in that tutorial, the ESP will run all the code and the Arduino will not be able to communicate with it unless you program the ESP to provide a custom interface to the Arduino through the serial port. You will have to design all that. It's way beyond what is covered in the tutorial.

But my sensors and Bluetooth hc-05 is attached with pro mini. If i upload my whole code to ESP8266 and then attach it with arduino pro mini will it work then? i mean all sensors and bluetooth will work or not?

izj99: But my sensors and Bluetooth hc-05 is attached with pro mini. If i upload my whole code to ESP8266 and then attach it with arduino pro mini will it work then? i mean all sensors and bluetooth will work or not?

Of course not. How does the code in the ESP know that an Arduino is connected to it, unless you provide the means for that? If you program and communicate with the Arduino, it will work independently of the ESP, but you can not share a serial connection to both the ESP and the Arduino to the same host through the Arduinos USB to serial connection.

In the tutorial, the Arduino is a "dummy" and just functions as a USB to serial converter. As I explained in reply #3.

The ESP is not a shield or a sensor for your Arduino. It is a stand alone MCU.

If you use a module like the NodeMCU there's no need for the whole Arduino, that one has all the GPIO pins broken out. Unless you have lots of devices that's the more convenient solution. You also get the extra processing power of the ESP8266 to play with.

For connecting your Arduino to the ESP-01, make sure you have the correct voltage levels. The ESP-01 needs 3.3V signals. You may need a level shifter.

You can use a USB to TTL converter (3.3V level) to program the ESP-01 directly. No need for Arduino in between. After that the ESP-01 becomes just an external device from the Arduino's POV.

wvmarle: If you use a module like the NodeMCU there's no need for the whole Arduino, that one has all the GPIO pins broken out. Unless you have lots of devices that's the more convenient solution. You also get the extra processing power of the ESP8266 to play with.

For connecting your Arduino to the ESP-01, make sure you have the correct voltage levels. The ESP-01 needs 3.3V signals. You may need a level shifter.

You can use a USB to TTL converter (3.3V level) to program the ESP-01 directly. No need for Arduino in between. After that the ESP-01 becomes just an external device from the Arduino's POV.

Ok if i program ESP8266-01 with TTL it will become an external device but what will happen to those sensors or bluetooth module hc-05 that is attached to Arduino Pro mini?

izj99: Ok if i program ESP8266-01 with TTL it will become an external device

Which is just as it is now, nothing changes there.

but what will happen to those sensors or bluetooth module hc-05 that is attached to Arduino Pro mini?

Also nothing.

is your goal to (1) get sensor data using the pro mini and then (2) send it to the internet using the ESP? i've done this because the esp is much more limited than what the arduino can do in terms of sensors.

You're 2 1/2 years late to the party...

The only limitation of the ESP, is the number of available I/O pins, but using I2C-based expanders this is easily overcome for the vast majority of applications. Using an Arduino with an ESP8266 rarely makes sense. :astonished: