Serial communication confusion
Actually, there is a protocol, described here:



Technically, it should be possible to program such protocol manually, using GPIO pins, but you'll inevitably get issues at higher baud rates, as your program will fail to respect the timing properly.

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.