Program ESP8266 ESP-01S or use AT commands with Arduino

Hi,

Hoping for some help with ESP8266 / general Arduino help.

Basically I want to read temperature and humidity from an Si7021 and send it to my web server so I can make some pretty graphs.

I am using an Arduino Uno R3 and bought an ESP8266 ESP-01S to add wifi capabilities.

From my understanding the Uno R3 can only talk to the ESP8266 through AT commands, so I could use AT commands to connect to my WiFi, make the Arduino read the temp/humid, then send the data with AT+CIPSEND or whatever the command is.

I've seen a lot of tutorials for ESP8266 and they all seem to be about programming the board directly. This is interesting to me because using the ESP8266WiFi library seems easier than talking with AT commands from the Arduino.

I wanted to know the following:

Does setting a board in the Arduino IDE mean that you intend to program the board, e.g. I select Generic ESP8266 - does this mean I want to program the ESP8266 and I am just using the Arduino to send information to the chip?

When programming the ESP8266 could I use the 2 GPIO pins that I have access to (GPIO0 and GPIO2) to read temperature / humidity from my Si7021 directly?
Or would it be better to use AT commands with the Arduino and do everything from there?

Failing that, is there a hybrid solution where I program the ESP8266 to connect to my WIFI, and then use AT commands to send data. Can I manage the connection on the ESP directly, then just use AT commands to check if I am connected and send data?

It is generally better to program and use the ESP by itself if one can.

This person is using an ESP8266-01 and a Si7021. Maybe you can use parts if this.

#define SDA 0 // GPIO0 on ESP-01 module
#define SCL 2 // GPIO2 on ESP-01 module

You will need a way to ground pin 0 to program the ESP8266.

I have found this ESP8266 beginner's guide to be helpful.

2 Likes

Why? Do you like doing things the hard way?

There is a reason that you don't see a lot of people on the forums using an ESP8266-01 as a WiFi shield for an Uno. There are far, far better ways to send sensor data over WiFi.

AT = Ancient Technology.

Read the guide linked by @groundFungus

Thanks, I will check the guide attached.

If you program with the IDE there is no need (nor is it desirable) to use AT commands. The Guide will get you started.

An ESP-01 has four GPIO pins readily available for your use. You have to be careful with GPIO0 and GPIO2 that your circuit pulls them to the correct logic levels by default in order to boot properly.

To program the ESP-01, you use a purpose-built USB programming adapter which works perfectly with the Arduino IDE:
Aliexpress item
At least, that is the manual switching version; I would recommend in preference the automatic version which while it does include the reset button, initiates the programming directly from the Arduino IDE:
Aliexpress item
Similarly, to actually use the ESP-01 in a project, a very convenient way is with the cheaper adapter board, plugged into a USB "phone charger" so you have both the 5 V and 3.3 V conveniently and adequately supplied.
Aliexpress item
You have three GPIO conveniently available by soldering to the adapter, and the fourth - serial Rx - can be separated from the USB chip if necessary by cutting a track. Using those I/O you can connect port expanders for many more I/O connections and a variety of sensors.

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.