A better ESP8266 solution is to connect it as a SDIO device on the GPIO port.
This is inexpensive and can get you ~40Mb/s over wifi
A little history. The ESP8266 IC (if you haven’t heard of it) is an extremely popular Wifi microcontroller with many cheap modules on the market. It was originally used as a UART serial interface for microcontrollers, but has since been ported over to work as a standalone microcontroller using LUA or Arduino. It is a very fast microcontroller that runs at 80mhz. This is one of my favorite microcontrollers to use for projects because it is fast, cheap, and has wifi.
A few versions of the module have come out including the ESP-12E and ESP-12F (both around $2-$3) that break out the SDIO interface. This was largely pointless, because the SDIO interface is used for the flash memory.
However, it turns out that the ESP8266 is actually a ESP8089 IC just rebranded. The ESP8089 is a SDIO wifi chip for small tablets. If you do not pull down GPIO 15 on boot, as you would when running it as a microcontroller, it runs in SDIO mode and is basically an ESP8089 IC at that point.
This project is based on Hackaday.io RPi WiFi project. I have made some modifications to work with the new linux kernel in the new Raspbian and I have written a script to completely automate the process. To use this, you need an ESP-12E or ESP-12F module. The ESP-12F is recommended.
First, wire up the ESP-12F like this.
The 33 ohm resistors are necessary to achieve the SDIO speeds required, so please to not leave them out. It is also better to pull from the 5v rail and have a separate LDO for the ESP8266 module, but pulling directly from a 3.3v rail on the Raspberry pi should work fine.
SSH into your Raspberry Pi and enter the following commands. You might want to expand the filesystem first using raspi-config.
git clone https://github.com/oshlab/esp8089.git
sudo sh install
This is going to take a while. So just sit and wait, or go grab a coffee.
When that is done, reboot your Pi.
After reboot, the ESP8266 module should activate. You can do a quick scan to make sure it is working.
sudo iwlist scan
It should scan for wireless networks and show you what is available.
Now it will work just like any other WIFI module. Cheers.