# Serial communication confusion

I'm trying to understand how to talk to ESP8266, but I'm very confused. I don't understand how to connect ESP8266 to serial, so I can send it commands from terminal, as far as I understood I need special hardware to do this which I don't have.

I have raspberry Pi and want to use it's GPIO pins to send the 'AT+GMR' command and read the response from the ESP8266.

I want to do this at low level, but I don't know what to look for, because I don't understand the process.

If I set one GPIO as output and connect it to ESP8266 RX and other GPIO as input and connect it to ESP8266 TX, what's next? I would simply write my command byte by byte and new line at the end and ESP8266 should give out singnal from TX to GPIO input? There is no 'protocol' in between or some kind of timing? Thanks

• Why are you not using the serial pins? Sep 20 '16 at 14:47
• @IgnacioVazquez-Abrams What would be the benefit? Sep 20 '16 at 14:48
• Serial is an asynchronous (i.e. without clock) protocol, where the timing between transitions is important. You can't simply write a byte to a single pin - it doesn't fit. Sep 20 '16 at 14:52
• Other than the fact that you can use the serial peripheral on the RPi's SoC instead of bitbanging out serial? Sep 20 '16 at 14:52
• If you are a beginner I recommend getting a NodeMCU instead of bare-ESP modules. NodeMCU is still dirty cheap but has everything needed to get started.
– filo
Sep 20 '16 at 16:18

It's much better to use UART hardware which is available on all the RPi boards. Locate Tx and Rx pins on your board, disable linux login console on UART device and connect your ESP8266 to these pins (Rx of ESP8266 to Tx of RPi and vice versa). Then you'll be able to simply write your AT strings to /dev/ttyAMA0 file and read responses from it.
• 1. Why did you have to try, don't you know which one it is? Did this device come with documentation of some kind? 2. How do you "connect" to the serial device exactly? Do you use a tool like putty, minicom or screen, or do you open it programmatically? Add the command line or the source code to your question. Sep 20 '16 at 16:33