It depends on what you attempt to do.
The reason there are so many bad tutorials on the matter is unknown, but i agree there are. An the good ones get removed somehow. I should really create one here on the forum, that would save a lot of work.
To get a handle on what you want to do i suggest you first try to communicate directly to the ESP thru the UNO's USB to TTL converter.
For that you need to make sure the Serial port of the UNO is not in use itself.
You can simply upload a blank sketch onto it or blink or basically any sketch as long as it does not use Serial or GPIO 0 & 1, or alternately you can put the UNO in constant reset (not what i do)
i upload this little sketch
const byte ledpin=13;
uint16_t ms=100;
bool increase=true;
void setup() {
// initialize digital pin 13 as an output.
pinMode(ledpin, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(ledpin, HIGH);
delay(ms);
digitalWrite(ledpin, LOW);
delay(ms);
if (ms>250) increase=false;
if (ms<20) increase=true;
if (increase) ms=(ms*10)/9;
else ms=(ms*9)/10;
}
After this you need to make the connections such that the ESP's MCU replaces the MCU on the UNO.
For that you connect the TX to TX & RX to RX, but due to the logic level differences the ESP's RX pin needs to be protected. Using a converter works, though again i never use one. I use 3x 1k resistors to create a voltage divider which belongs to the ESP's RX-line. the schematic with the 2.2K & 1K works, but leaves you with a higher logic level (5 /3.2) * 2.2 = 3.4375 and 3x 1K end up at 3.33v Ideally it should be even less. Resistors with higher values like 3x 10K will get you the proper voltage as well but will add more capacitance to the circuit, and will probably not work at higher baud rates.
The reason you connect TX to TX & RX to RX is because the USB to TTL converter on the UNO (an Atmega 16u2 if it's an original) connects it's TX to the RX of the UNO's MCU (the Atmega 328P) and it's RX to the 328P's TX. The markings on the UNO refer to the pins on the 328P.
Make sure that at the time of boot, GPIOs 0, 1 & 2 are not pulled LOW or the ESP will go into the incorrect boot mode.
Set the Serial monitor Baud rate to 115200 and line-ending to both NL & CR
Now type 'AT' and you should get some response.
GPIO 0 is used to set the boot mode to 'flash-mode'. If pulled LOW at boot, the ESP will go into the mode that allows it to be programmed,
The connections for 'direct AT-commands' & 'programming the ESP-01' are the same with that exception.
Now if you would like to just upload a sketch onto the UNO that then makes use of the original AT-command firmware that is on the ESP, you need to change the RX & TX lines over (make sure you keep protecting the ESP's RX line !) and connect them crossed TX to RX & RX to TX.
But of course you would normally want to still use the Serial port of the UNO to tell that what to do (and for debugging) so a software Serial solution usually is better.
Unfortunately swSerial is not reliable at 115200 (for reception) which is the default baud-rate of the ESP, so you should tell the ESP to switch to 9600bps first up and then continue from there.
Now i don't really support this whole UNO + ESP-01 AT-commands thing, so i will not dive into it. The ESP-01 has a way more powerful processor, and to use it in that way is just to inefficient.
I suggest you program the ESP-01 directly, this will erase the AT-command firmware, which gets overwritten by your own, it can be re-uploaded afterwards, but seriously why bother ?! You can make much more efficient use of the ESP-01 if you program it directly.
Now to do this you connect GPIO 0 to GND and reset the ESP-01 to put it in 'flash' mode and afterwards you can remove that connection (i have a small shield with 2 buttons, 1 grounds out GPIO 0 and 1 grounds out RST, the shield also has the resistors of the voltage divider and connects to the UNO's 3.3 GND and RX & TX pins)
The UNO 3.3v regulator should be able to provide the current required for the ESP if it's an original UNO (like mine) but clones tend to not have enough heatsink, which will show up when trying to connect WiFi which is the moment of peak current requirement.
Now download the ESP8266 core, select 'generic ESP8266' and with the default settings, upload this sketch
const byte ledpin=1;
uint16_t ms=100;
bool increase=true;
void setup() {
pinMode(ledpin, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(ledpin, HIGH);
delay(ms);
digitalWrite(ledpin, LOW);
delay(ms);
if (ms>250) increase=false;
if (ms<20) increase=true;
if (increase) ms=(ms*10)/9;
else ms=(ms*9)/10;
}
The ESP-01 has a builtin LED on GPIO 1 (TX) which is active LOW
After upload the sketch will start running regardless of GPIO 0 being connected to GND or not, but if you reset it you will have to decide what boot mode you want.