ESP01 and Arduino - Serial port confusion I'm trying to understand how to think about ESP01 devices and arduino connectivity

I purchased one of the USB programmers from Ebay to program the ESP01 - this works nicely, I can see the ESP doing things (I have it pinging a server sending data back and forth)

Obviously, the ESP01 has very few GPIO pins, so I'm interested in connecting to an arduino so I can combine the Arduino's IO with the Wifi on the ESP, and this is where I'm getting a little stuck. I'm assuming I have to connect the RX pin on the Uno to the TX on the ESP and the TX on the Uno to the ESP RX to set up the connection, but I'm confused as to which serial port to use on the Uno.

Specifically:


are the TX/RX pins on the arduino actually the same serial port as the USB connector - i.e if my intent is to plug the arduino into a computer to talk to it over USB, should I not then re-use the TX/RX pins to talk to the ESP
if so, should I look to software serial or something similar and use other IO pins on the arduino to connect to the ESP01


... Also, as an aside, if I get this all working, do I still need the USB programmer, or can I then program directly from the arduino?
The Arduino UNO only has one serial port. That is pins 0/1 (RX and TX), which is mapped to the Serial object.

Those pins and that object are also used for communication with the PC through the USB connection. That means you can't easily use them for both PC communication and ESP8266 communication. It's possible, but it gets messy.

That is why many people use SoftwareSerial because that can work on any combination of pins on the Arduino that you like.


  ... Also, as an aside, if I get this all working, do I still need the USB programmer, or can I then program directly from the arduino?


Again, that is possible, but very messy. You could possibly get things to pass through from Serial to a SoftwareSerial instance, but it's not reliable (SoftwareSerial in general is not reliable for sustained transfers of data), and using the Arduino as a dumb UART interface would entail changing the wiring to pins 0/1 when you wanted to program.

So it's far simple to just use your USB interface for programming. Either that or set up OTA programming for the ESP8266 so you don't even have to use wires.