Add WiFi to your Raspberry Pi for just $ 2
There are quite a lot of hacks for the Raspberry Pi Zero mini-PC, which was released a couple of weeks ago. True, so far the most part is simple tricks, such as soldering a WiFi module , which cannot be called a hack. Now more interesting things are starting to appear, among which is the use of SDIO to add a WiFi module. Moreover, USB is not used, the port remains functional.
The user Hackaday.io with the nickname ajlitt thought for a while about the possibility of adding a WiFi module to such boards as the Raspberry Pi A + and Raspberry Pi Zero. The fact is that the Raspberry Pi B +, for example, has several USB ports, and one of them can be easily occupied with the corresponding WiFi module. But Zero and A + have a minimum of ports, and connecting a WiFi module to them is not always possible. The decision of the craftsman was quite original. The fact is that the Raspberry Pi has a special GPIO connector with pins, and you can connect various devices to this connector, including SDIO devices. This feature of "raspberry" and it was decided to use.
SDIOIs a special extension of the SPI-like protocol, which is used to work with SD memory cards. The idea of SDIO is to connect a compatible device to the connector, for additional gadget functionality. This method was actively used, for example, in handhelds (PDAs). You could connect a GPS module to such a connector, or something else, having received a new function in your device.
An example of connecting a GPS module to a PDA
Ajlitt tried to find a driver for the ESP8089 chip, and found the specifications of the chip itself, which stated that the ESP8266 SPI bus can be freed by removing the flash memory chip. It only remained to connect the ESP8266 SPI contacts to the Raspberry Pi SDIO, and the driver was already completing the rest of the connection work.
In order for WiFi to work, it is necessary to unsolder the SPI memory from the ESP-03 module at the very beginning.
The pinout is as follows:
Next, connect 3.3V and GND. We connect CH_PD (CH_EN on the ESP8266 chip) to any free GPIO. It can be used, for example, GPIO4. This will allow you to connect power to the module, and the driver activates the chip correctly. After connecting, other GPIOs should no longer be used. Otherwise, the ESP8266 will want to boot from a flash drive that has already been deleted, and nothing will work.
After that, download 4.2 kernel from Raspberry Pi Github. Best of all is https://github.com/raspberrypi/linux.git , branch rpi-4.2.y.
After we create the esp8089 module:
git clone github.com/al177/esp8089.git
cd esp8089
make
And load the module:
modprobe mac80211
insmod esp8089.ko
Result - WiFi module without using USB. All work is quite simple, you need minimal soldering skills. The cost of the modification is only $ 2. But such methods are no longer needed. The channel in case of working with SDIO is not as fast as in the case of using a dedicated module, but it is quite acceptable.
Project page with technical details.