-
1Step 1
HARDWARE
(WiFi Pants owners skip to SOFTWARE below)
You'll need 6x 33 ohm resistors (either through-hole or SMT), some wire, and an ESP-12F module.
Some variants of the ESP-12E should work as well, but there are some that do not have the GPIO9 and GPIO10 pins connected to the edge, and others that have a different pinout than listed here. From what I can tell there is only one variant of the ESP-12F (labeled "ESP-12-F QIO L4" on the back) so that is a safer bet. ESP-12F also has an onboard 10uF capacitor across the input supply, which saves you from having to add one yourself.
You probably want something to mount the ESP-12F on. Perfboard is fine, as would be cardboard or just double-sided foam tape on the back of the Pi. No matter what you use, make sure that nothing is under the antenna or range will be greatly reduced. The ESP-12F LED is a good mark for the start of this keepout region.
I use outdoor double-sided foam tape on my hand-built boards since it's tough but not hard to reposition, and raises the module enough to not short against the board. Creative application of hot glue or epoxy putty might work fine as well.
-
2Step 2
Make the connections between the ESP-12F or -12E and the Raspberry Pi HAT. Keep wires short as possible, and minimize the number of times they cross over each other. If you're using magnet wire or Kynar (standard issue blue wire) you might want to use a heavier gauge for the 3.3V and GND. Ideally the wire lengths of the 6 SDIO signals should be identical, but even a couple of inches of difference shouldn't matter. If you can, keep SD_CLK close to the average length of the other wires.
The SDIO signals (names beginning "SD_") should have 33 ohm resistors in series (in between the Pi and ESP-12F connections). It may work with other slightly larger values, or with no resistor at all.
If using 1-bit SDIO instead of 4-bit, omit D2 and D3. There's not much of a good reason for this though.
A capacitor of 10uF or more may be needed between 3.3V and GND near the module, though a legit ESP-12F already has a 10uF supply cap onboard.
Wire it like this:
SDIO signal RPi HAT ESP-12F pin / signal ESP-03 pin / signal CLK 15 / GPIO22 14 / SCLK Flash pin 6 (CLK) CMD 16 / GPIO23 9 / CS0 Flash pin 1 (/CS) D0 18 / GPIO24 10 / MISO Flash pin 2 (DO) D1 22 / GPIO25 13 / MOSI Flash pin 5 (DI) D2 (optional for 1-bit) 37 / GPIO26 11 / GPIO9 Flash pin 7 (HOLD) D3 (optional for 1-bit) 13 / GPIO27 12 / GPIO10 Flash pin 3 (WP) - 1 or 17 / 3.3V 8 / VCC Module 1 / VCC - 2, 4, 14, or 20 / GND 15 / GND Module 8 / GND - 27 / ID_SD 3 / CH_PD Module 13 / CH_PD Note that the CH_PD signal is connected to the ID_SD signal. This must be mapped as a GPIO (GPIO0) and switched to an output and driven low then switched to an input again before the driver is loaded in order to reset the module. This will be added in the near future in the driver.
The ESP-03 column above is for people who want to use an ESP-03 module instead. This requires soldering to the pins of the SPI flash chip for some of the signals. The SPI flash may be desoldered first, or left in place.
-
3Step 3
SOFTWARE
Start with a fresh 32-bit Raspberry Pi OS SD image of 2023-05-03 or later.
A network connection to the Pi is required for the initial installation for the OS to fetch dependencies to build the driver module. This could be the onboard Ethernet of a model B Pi, a supported USB-Ethernet or USB-WiFi adapter, or the Pi Zero connected through another PC over USB.
-
4Step 4
Log in as "pi" or your user with sudo privs and Install prerequisite packages to build the driver.
#make sure everything is up to date sudo apt update && sudo apt -y upgrade #install module build dependencies sudo apt -y install dkms raspberrypi-kernel-headers
-
5Step 5
Add the line "dtoverlay=sdio,poll_once=off" to /boot/config.txt, or replace any existing "dtoverlay=sdio" line.
If you're using 4-bit SDIO, which you likely are, run this to set up the boot configuration:
#4-bit SDIO setup (for WiFi Pants board) #Note: substitute /boot/firmware/config.txt for /boot/config.txt with Bookworm or later sudo sed -i -e "/^dtoverlay.*sdio/d" /boot/config.txt sudo sh -c 'echo "dtoverlay=sdio,poll_once=off" >> /boot/config.txt'
If you're using 1-bit SDIO, use this instead (or the WiFi driver will crash when you load it):
#1-bit SDIO setup (NOT for WiFi Pants board) #Note: substitute /boot/firmware/config.txt for /boot/config.txt with Bookworm or later sudo sed -i -e "/^dtoverlay.*sdio/d" /boot/config.txt sudo sh -c 'echo "dtoverlay=sdio,poll_once=off,bus_width=1" >> /boot/config.txt'
-
6Step 6
If you didn't use ID_SD (GPIO0, HAT pin 27) as the CH_PD GPIO, provide the kernel module with the right one via a modprobe.d conf file. Replace "5" below with the correct GPIO number.
Skip this step if you are using a WiFi Pants board as it uses the default of GPIO0.
sudo sh -c 'echo "options esp8089 esp_reset_gpio=5" > /etc/modprobe.d/esp.conf'
-
7Step 7
Reboot to load the updated kernel and activate SDIO
sudo reboot
-
8Step 8
After the reboot, log in and fetch the DKMS package for esp8089:
wget https://github.com/al177/esp8089/releases/download/1.9.20230804/esp8089-dkms_1.9.20230804_all.deb.gz gunzip esp8089-dkms_1.9.20230804_all.deb.gz
Check https://github.com/al177/esp8089 for the latest release in case I forget to update these instructions
-
9Step 9
Install the package (sub the filename from the wget above if different):
sudo dpkg -i esp8089-dkms_1.9.20230804_all.deb
This package will be automatically rebuilt and installed every time Raspbian installs a new kernel.
-
10Step 10
Load the driver.
sudo modprobe esp8089
If the ESP8089/8266 is found, you should see these lines spread through dmesg:
[ 2.253368] mmc1: new high speed SDIO card at address 0001
[ 5.416128] ***** EAGLE DRIVER VER:bdf5087c3deb***** [ 5.618948] esp_sdio_init power up OK [ 6.140907] first normal exit [ 6.141112] esp_sdio_remove enter [ 6.249295] eagle_sdio: probe of mmc1:0001:1 failed with error -123 [ 6.249485] mmc1: card 0001 removed [ 6.333036] mmc1: new high speed SDIO card at address 0001 [ 6.716629] esp_host:bdf5087c3deb [ 7.126350] esp_op_add_interface STAThe probe error is expected when the ESP restarts after the firmware is loaded.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
Hi! thank You for this great hack-) I have an issue described "The probe error is expected when the ESP restarts after the firmware is loaded". What I should do about it?-)
Are you sure? yes | no
Ok. I've upgraded the firmware and kernel of raspberry and now I have this error:
***** EAGLE DRIVER VER:bdf5087c3deb*****
[ 84.245414] ESP8089 reset via GPIO 0
[ 95.853031] esp_sdio_init ------ RETRY ------ [ 95.853219] ESP8089 reset via GPIO 0
[ 96.071252] ESP8089 reset via GPIO 0
[ 107.364734] esp_sdio_init ------ RETRY ------ [ 107.364928] ESP8089 reset via GPIO 0
[ 107.584713] ESP8089 reset via GPIO 0
[ 118.883153] esp_sdio_init ------ RETRY ------ [ 118.883352] ESP8089 reset via GPIO 0
[ 119.101664] ESP8089 reset via GPIO 0
[ 130.400238] esp_sdio_init ------ RETRY ------ [ 130.400432] ESP8089 reset via GPIO 0
[ 130.620197] eagle sdio can not power up!
Can anyone help? What am I doing wrong?
Are you sure? yes | no
I'm running Raspbian Stretch Lite, clean install. I have a custom PCB with an ESP-12F configured in the same was as above but I'm not able to get it working. I've followed all of the above steps but the final line "sudo modprobe esp8089" returns the following error:
"modprobe: ERROR: could not insert 'esp8089': Unknown symbol in module, or unknown parameter (see dmesg)"
Any pointers so I can get this working?
Are you sure? yes | no
Greetings from the future! Sorry for the very late response, but I wanted to point out that the 20190603 DKMS package is tested compatible with kernels all the way up through 5.4 in January 2021 Raspbian Buster Lite.
The symbol mismatch may be caused by not rebooting between doing apt upgrade and installing the esp8089 package.
Are you sure? yes | no
Greetings, I had everything running nicely. Unfortunately I did an apt-get update and apt-get dist-upgrade. This forces the Wi-Fi to be reinstalled. Since I didn't expect this, I am providing a heads-up to others.
Are you sure? yes | no
I am not getting good results with the 2017-03-02 Jessie-lite. Has anyone else given this a try?
Are you sure? yes | no
It seems like this no longer works (situationally). I just set up a new OctoPi image, and its latest release as of today comes with kernel 4.4.19. But the raspberrypi-kernel-headers version that gets installed today is 4.4.38. So I had to also
sudo apt-get install --reinstall raspberrypi-bootloader
and then after a reboot I was on kernel 4.4.38, matching the installed headers, so the dkms compile would succeed.
Are you sure? yes | no
Thanks for the heads-up. I haven't updated any of my boards to this kernel, but I'll try tonight.
Are you sure? yes | no
I ran into similar trouble with 4.4.38 on a plain raspbian install.
What worked for me was to reboot after apt-get upgrade finished, then force DKMS to build manually:
sudo dkms autoinstall; sudo depmod -a
Then reboot.
Are you sure? yes | no
Where in the steps was this done? Thanks!
Are you sure? yes | no
Hi I'm comepletely new to this but I have worked around with esp8266.
My question is about the firmware of esp8266? Do you simply flash it with esp8089 firmware on that GitHub or something?
Are you sure? yes | no
Hello ajlitt, thank you for this awesome hack.
I had no success with an ESP-12-E QIO L2. I didn't had an F-L4 revision at home, but I still had a spare ESP-03 available.
You can have a look at my proto-board here: http://imgur.com/a/kmXUr
I have tested my bandwidth with this method: http://lifehacker.com/how-to-test-your-internet-speed-with-a-terminal-command-1364123567
# wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip
In my case, the wifi speed is not very great. I got a mean speed of 1824 kbps for downloading this 11MB test file. I wonder if there could be a problem with my wiring, because the red wires are close to the ceramic antenna of the ESP-03.
Are you sure? yes | no
From my experience the ESP-03 antenna is very sensitive to nearby metal. The best speed I saw from an ESP-03 was when I had the groundplane cutout for the antenna on the module hanging entirely off of the PCB. Look through my early project logs to see the two implementations I have with the ESP-03. The first had the antenna near a groundplane and I saw throughput much like you describe. my second attempt is what I described above and worked much better (though not as well as my chip-on-board WiFi HAT and ESP12F Pants designs).
Also I recommend using a local endpoint for testing throughput to eliminate throttling from an internet endpoint. I find iperf to be a reliable and repeatable test.
Are you sure? yes | no
(...was when I had the groundplane cutout for the antenna on the module hanging entirely off of the PCB...)
Seems very interresting but I need to see photos to understand clearly.
I looked on hackaday, and did not find the early project you mention. Could you help me finding it please?
Are you sure? yes | no
Specifically these two logs: https://hackaday.io/project/8678-rpi-wifi/log/29965-good-news-bad-news https://hackaday.io/project/8678-rpi-wifi/log/30112-the-hairball-is-alive
Note how I have the antenna portion of the module off the edge of the board?
Are you sure? yes | no
In my realization, the antenna portion is already outside of the proto-board. Look here, in the second picture: http://imgur.com/a/kmXUr
Are you sure? yes | no
How does it work when it's very close to your wifi AP? My top speeds were with the router sitting on the same desk as the ESP.
Are you sure? yes | no
I put rpi0-0 50cm away from the AP.
Same wget command as before. The bandwidth is 1912 kbps.
Are you sure? yes | no
I just received my ordered ESP-12F QIO L4.
I first got it to work with aerial wiring, and it works very well, definitely more reliable than with my ESP-03 with unsoldered Flash chip.
I got very good transfer speed now:
# wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip
# (3,33 MB/s) — « /dev/null » sauvegardé [11536384/11536384]
which is about 26 Mbps. I think that this is the Rpi-0 which is the limitation now.
BTW, I would like to understand why there is such difference of speed between both ESP. This is the same ESP8266EX core, no?
The only difference I see is that resistors on my ESP-03 breadboard are 50 Ohm, and on ESP-12F it is 22 Ohm. I tried on both setup without resistors, but the WiFi connection was failing or not stable in both cases.
Do you see another reason that could explain such data rate difference?
Are you sure? yes | no
I don't know. I haven't dug into the design differences between the two besides the greater attention to detail in the ESP-12F. My guess is that it has something to do with the routing and bypassing of the power to the ESP8266 on the ESP-03, which IIRC didn't obey the recommendations in the Espressif docs for caps and routing.
Are you sure? yes | no
I have a raspberrypi B rev 2 and it has no gpio 26 what can I do now ?
Are you sure? yes | no
@guyf2010 attempted this below. Not sure if he got it working. All the pins except SD_D2 and SD_D3 are within the rev 1 Pi 26 pin header, which means it may work in 1-bit SDIO mode. Follow the above instructions to run the interface in 1-bit mode and let us know if it works for you.
Are you sure? yes | no
I did get it working in the end. You are restricted to 1-bit SDIO. Only issue I ran into was solved by taking everything apart and doing it again, I suspect a bad connection to have been the problem.
Are you sure? yes | no
Thanks for this! I did my own version ( https://making.arantius.com/wifi-add-on-for-rapberry-pi-zero-zero-pants ) and it turned out great, with one caveat, mentioned there: I have to unload the module before I reset the ESP as in step 10 of the instructions.
Are you sure? yes | no
and thank you for the patch for the recent kernels.
I made the decision to use GPIO0 (ID_SD) as the reset signal on my board a while back in order to minimize pin utilization. I have noticed that relying on ID_SD to reset the ESP by way of the Pi's initialization code is unreliable. So I made this design choice with the intention that I'd add the reset twiddle in the driver. This would not only give a chance to reset GPIO0 before downloading firmware, but it would allow for the driver to clear the ESP's state on a warm reboot.
I still haven't implemented this, and honestly I forgot about it as I got bogged down in the hardware.
Are you sure? yes | no
@Anthony Lieuallen : correction, it's now implemented. The driver twiddles GPIO0 (ID_SD) on load and on unload, with a module parameter to change the gpio#. Works great!
Are you sure? yes | no
Confirmed, it works great. Awesome work!
Are you sure? yes | no
I've been following this thread and now built up my own board. I'm trying kernel 4.4 branch and did the required #include change. Module compiles and installs ok.
But ESP8266 is not detected, there are no mmc1 in the boot message, toggle CH_PD gives nothing. ESP does issue "boot mode: (7, 6) waiting for host" from its own serial output though.
I measured SD_CLK and SD_CMD line, SD_CLK gives 125kHz clock and SD_CMD toggles occasionally. SD_D0 stays high.
Here is /sys/kernel/debug/mmc1/ios:
root@raspberrypi:~# dmesg | grep mmc1
root@raspberrypi:~# cd /sys/kernel/debug
root@raspberrypi:/sys/kernel/debug/mmc1# cat ios
clock: 0 Hz
vdd: 0 (invalid)
bus mode: 2 (push-pull)
chip select: 0 (don't care)
power mode: 0 (off)
bus width: 0 (1 bits)
timing spec: 0 (legacy)
signal voltage: 0 (3.30 V)
driver type: 0 (driver type B)
root@raspberrypi:/sys/kernel/debug/mmc1# cat clock
0
Any clue please?
Are you sure? yes | no
What esp8266 module are you using?
That symptom means that the two aren't doing their handshake. Any chance that SD_CLK or SD_CMD are going to the wrong pins on the module?
Are you sure? yes | no
It has ESP-12-F QIO L4 written on the module. I go replace the module and try again.
Are you sure? yes | no
Are you sure? yes | no
I haven't tried. I have used it successfully with hostapd so there's that.
Are you sure? yes | no
hi,
i installed kernel on new sdcard (followed above steps)
am facing new problem now.
please check dmesg.
[ 115.117299] ERROR::dwc_otg_hcd_urb_enqueue:505: Not connected
[ 115.117299]
[ 115.195098] mmc1: queuing unknown CIS tuple 0x01 (3 bytes)
[ 115.203501] mmc1: queuing unknown CIS tuple 0x1a (5 bytes)
[ 115.206877] mmc1: queuing unknown CIS tuple 0x1b (8 bytes)
[ 115.211181] mmc1: queuing unknown CIS tuple 0x80 (1 bytes)
[ 115.211327] mmc1: queuing unknown CIS tuple 0x81 (1 bytes)
[ 115.211453] mmc1: queuing unknown CIS tuple 0x82 (1 bytes)
[ 115.211528] mmc1: new high speed SDIO card at address 0001
[ 115.280354] usb 1-1: USB disconnect, device number 2
[ 115.280400] usb 1-1.1: USB disconnect, device number 3
[ 115.280807] smsc95xx 1-1.1:1.0 eth0: unregister 'smsc95xx' usb-20980000.usb-1.1, smsc95xx USB 2.0 Ethernet
[ 115.280904] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[ 115.292461] fib_del_ifaddr: bug: prim == NULL
[ 115.297041] usb 1-1.4: USB disconnect, device number 4
[ 115.306156] usb 1-1.5: USB disconnect, device number 5
[ 115.333821] Unable to handle kernel paging request at virtual address 99945138
[ 115.341337] pgd = da554000
[ 115.344126] [99945138] *pgd=00000000
[ 115.347812] Internal error: Oops: 5 [#1] ARM
[ 115.352174] Modules linked in: esp8089(O+) mac80211 cfg80211 rfkill snd_bcm2835 snd_pcm snd_seq snd_seq_device snd_timer snd joydev evdev bcm2835_gpiomem bcm2835_wdt uio_pdrv_genirq uio
[ 115.369347] CPU: 0 PID: 2380 Comm: modprobe Tainted: G O 4.4.8+ #880
[ 115.376967] Hardware name: BCM2708
[ 115.380440] task: da58df60 ti: d9470000 task.ti: d9470000
[ 115.385960] PC is at load_module+0x19e8/0x1ef4
[ 115.390502] LR is at mutex_lock+0x1c/0x48
[ 115.394598] pc : [] lr : [] psr: 20000113
[ 115.394598] sp : d9471e88 ip : d9471e70 fp : d9471f34
[ 115.406265] r10: c0577174 r9 : 00000000 r8 : bf24e7c8
[ 115.411588] r7 : bf24e780 r6 : bf24e78c r5 : 99945124 r4 : d9471f3c
[ 115.418231] r3 : bf24e93c r2 : 00000000 r1 : 00000000 r0 : 00000000
[ 115.424876] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 115.432140] Control: 00c5387d Table: 1a554008 DAC: 00000055
[ 115.437997] Process modprobe (pid: 2380, stack limit = 0xd9470188)
[ 115.444294] Stack: (0xd9471e88 to 0xd9472000)
[ 115.448745] 1e80: bf24e78c 00007fff bf24e780 c007bc08 00000000 bf24e78c
[ 115.457074] 1ea0: bf24e93c bf24e78c bf24ea14 bf24e878 bf2214fc 00000000 00000000 00000000
[ 115.465400] 1ec0: de8de000 c05702cc d9471eec bf21f090 00000002 00000000 00000000 00000000
[ 115.473723] 1ee0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 115.482050] 1f00: 00000000 00000000 b6ec6948 0000566d 00000000 b6c7e66d b6ec6948 d9470000
[ 115.490376] 1f20: de8e366d 00000000 d9471fa4 d9471f38 c007ea34 c007ca70 00000000 de89e000
[ 115.498703] 1f40: 0004566d de8d9ab8 de8d9993 de8e1728 00039a14 0003c1f4 00000000 00000000
[ 115.507028] 1f60: 00000000 00005178 0000001e 0000001f 00000014 00000018 0000000d 00000000
[ 115.515352] 1f80: 00000000 00060000 7fc9f560 00000080 c000f9e8 d9470000 00000000 d9471fa8
[ 115.523679] 1fa0: c000f820 c007e964 00000000 00060000 b6c39000 0004566d b6ec6948 b6c39000
[ 115.532007] 1fc0: 00000000 00060000 7fc9f560 00000080 7fc9f508 0004566d b6ec6948 00000000
[ 115.540335] 1fe0: 00000000 be8c596c b6ebdfb4 b6e28534 60000010 b6c39000 e3510000 0a00007b
[ 115.548687] [] (load_module) from [] (SyS_init_module+0xdc/0x134)
[ 115.556688] [] (SyS_init_module) from [] (ret_fast_syscall+0x0/0x1c)
[ 115.564936] Code: e51b3094 e1530005 e2455008 0a000009 (e5953014)
[ 115.571301] ---[ end trace 3d97829848ad5363 ]---
[ 115.690115] Indeed it is in host mode hprt0 = 00021501
[ 115.990018] usb 1-1: new high-speed USB device number 6 using dwc_otg
[ 115.990242] Indeed it is in host mode hprt0 = 00001101
[ 116.370511] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
[ 116.370545] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 116.372002] hub 1-1:1.0: USB hub found
[ 116.372172] hub 1-1:1.0: 5 ports detected
[ 116.660038] usb 1-1.1: new high-speed USB device number 7 using dwc_otg
[ 116.760699] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[ 116.772930] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 116.853312] smsc95xx v1.0.4
[ 116.969132] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-20980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:e6:83:61
[ 117.049833] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[ 117.120068] usb 1-1.4: new low-speed USB device number 8 using dwc_otg
[ 117.267170] usb 1-1.4: New USB device found, idVendor=0458, idProduct=003a
[ 117.279465] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 117.291971] usb 1-1.4: Product: USB Optical Mouse
[ 117.301792] usb 1-1.4: Manufacturer: Genius
[ 117.372506] input: Genius USB Optical Mouse as /devices/platform/soc/20980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/0003:0458:003A.0004/input/input3
[ 117.414064] hid-generic 0003:0458:003A.0004: input,hidraw0: USB HID v1.11 Mouse [Genius USB Optical Mouse] on usb-20980000.usb-1.4/input0
[ 117.550066] usb 1-1.5: new low-speed USB device number 9 using dwc_otg
[ 117.703408] usb 1-1.5: New USB device found, idVendor=1c4f, idProduct=0026
[ 117.715635] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 117.728130] usb 1-1.5: Product: USB Keyboard
[ 117.737616] usb 1-1.5: Manufacturer: SIGMACHIP
[ 117.811489] input: SIGMACHIP USB Keyboard as /devices/platform/soc/20980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/0003:1C4F:0026.0005/input/input4
[ 117.913647] hid-generic 0003:1C4F:0026.0005: input,hidraw1: USB HID v1.10 Keyboard [SIGMACHIP USB Keyboard] on usb-20980000.usb-1.5/input0
[ 117.971602] input: SIGMACHIP USB Keyboard as /devices/platform/soc/20980000.usb/usb1/1-1/1-1.5/1-1.5:1.1/0003:1C4F:0026.0006/input/input5
[ 118.071605] hid-generic 0003:1C4F:0026.0006: input,hidraw2: USB HID v1.10 Device [SIGMACHIP USB Keyboard] on usb-20980000.usb-1.5/input1
[ 118.476422] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0x4DE1
Are you sure? yes | no
Did you toggle CH_PD before loading the driver? I see this if the Pi is warmbooted and the ESP is not reset before loading the driver.
If you're doing that, does it oops if you load the esp8089 module when the ESP8266 is not plugged into the Pi? I'm wondering if your kernel and module are out of sync.
Are you sure? yes | no
i installed driver in kernel and it is loading automatically.
Changed CH_PD to other gpios, but no use.
Are you sure? yes | no
this error because of OS version(wheezy).
with jessy it is working fine.
Are you sure? yes | no
It only works with Jessie because the wheezy kernel doesn't have proper sdio support
Are you sure? yes | no
Enabled 4bit mode SDIO.
i have done four
add-on boards for all my raspberrypi's. all boards are working in 1 bit
mode. But in 4bit SDIO mode only one board is working. In remaining
boards am getting following error :
"esp_sdio_dummy_probe
esp_sdio_init power ok
resetting event timeout
esp_init_all failed : -110
first error exit.
(after this if i toggle the CH_PD, system is hanging)
what
is the exact seqence?(wrt CH_PD). i connected CH_PD to PI_GPIO6. mmc1
is detecting on boot itself(i am not toggling gpio6).
there is no capacitor across power(3.3V) on add-on board. really required? what is preferred value?
and what about series termination resistors? (values? and how to choose value?)
Are you sure? yes | no
Espressif recommends a 10uF capacitor across the power rails, close to the chip. ESP-03 doesn't have this for some reason (cheapness?), but adding 10uF or more near the module across 3.3V seems to work fine.
I use 33 ohm resistors in my production design. I chose this by trial and error using a scope to determine which value resulted in the cleanest signals at each end of the bus. I've used values between 33 and 200 ohms.
I would try the capacitor first.
Are you sure? yes | no
tried cap across the power rails, still facing same issue. i have to try resistors.
Are you sure? yes | no
Enabled 4bit mode SDIO.
i have done four add-on boards for all my raspberrypi's. all boards are working in 1 bit mode. But in 4bit SDIO mode only one board is working. In remaining boards am getting following error :
"esp_sdio_dummy_probe
esp_sdio_init power ok
resetting event timeout
esp_init_all failed : -110
first error exit.
(after this if i toggle the CH_PD, system is hanging)
what is the exact seqence?(wrt CH_PD). i connected CH_PD to PI_GPIO6. mmc1 is detecting on boot itself(i am toggling gpio anymore).
there is no capacitor across power(3.3V) on add-on board. really required? what is preferred value?
and what about series termination resistors? (values? and how to choose value?)
Are you sure? yes | no
ESP-03 & RPI B+ board connections
--------------------------------------
SD SPI RPI_gpio
--------------------------------------
sd_clk sck 22
sd_cmd cs 23
sd_d0 so 24
sd_d1 si 25
sd_d2 hold 26
sd_d3 wp 27
--------------------------------------
CH_PD connected to GPIO_6.
esp gpio 0, 2 and 15 are not connected.
Are you sure? yes | no
pi@raspberrypi:~/esp8089 $ sudo dmesg -c
[ 708.380468]
***** EAGLE DRIVER VER:bdf5087c3deb*****
[ 719.380012] esp_sdio_init ------ RETRY ------
[ 730.380143] esp_sdio_init ------ RETRY ------
[ 741.380252] esp_sdio_init ------ RETRY ------
[ 752.380418] esp_sdio_init ------ RETRY ------
[ 752.380600] eagle sdio can not power up!
I am toggling CH_PD also.
help me?
Are you sure? yes | no
Do you see the "mmc1: new high speed SDIO card..." message in dmesg at all in step 9? If so, then sd_clk and sd_cmd are working, but the sd_dN lines may not be.
Make sure that you're not overclocking the SD card in your config.txt. Ideally you should be using a stock config.txt from Raspbian with only the changes in the instructions.
Do you have a cap across the supply going to the ESP-03? The ESP-12F has a 10uF cap onboard, but the ESP-03 only has 0.1uF bypass.
Finally, I recommend scoping each of the signals. You should see a constant clock on sd_clk, periodic data on sd_cmd, and traffic on each of the sd_dN lines when the driver loads.
Are you sure? yes | no
now changed sdio to 1bit mode it is working fine (in config.txt)
I have to check my board.
Are you sure? yes | no
I'm having issues getting the SDIO interface working on one of the earlier Pi models. I'm trying to use one of the 26 pin Pi 1Bs, but I am unable to get the mmc1 device to init. I've been trying to use 1-bit SDIO, as this Pi doesn't have D2 broken out. Attempting to run 'sudo modprobe esp8089' results in an error followed by the system hanging. (The error says "Unable to handle paging request at virtual address 904edc38"). Are there any modifications required to get the RPi 1 connected to an ESP8266?
On an important but unrelated note, the pin table suggests HAT pins 2 and 4 as ground pins, but aren't they 5V?
Thanks
Are you sure? yes | no
Looks like the mmc1 device is being created. But running cat /sys/kernel/debug/mmc1/ios says the clock speed is 0Hz.
Any ideas on a fix?
Are you sure? yes | no
It's very likely the blobs for the 1st gen Pis didn't get the same treatment as the rest for enabling SDIO.
Are you sure? yes | no
Looking at some of the info online, it may be possible to wire up an ESP-03 module without removing/soldering onto the flash chip. The table under the ESP-03 at http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family has CLK, MOSI, MISO and CS0 listed as alternate functions for GPIO pins that are exposed. I don't currently have any ESP-03 modules, nor the know-how on accessing the alternate functions. But it may well be the easiest way to get a module with ceramic antenna hooked up to a Pi.
Another thing I noticed is the mention of using GPIO0, GPIO2 and MTDO as a 3-bit SDIO connection in the GitHub documentation at https://github.com/espressif/ESP8266_AT/wiki/Pin-definition. It's unclear to me whether it would be usable as an interface, or simply used for configuring the SDIO interface used here already.
Are you sure? yes | no
Yes, I expect after all that just like the ESP-12E/F modules, the flash on the ESP-03 & ESP-04 can be left soldered in place. ESP-03 is where @ajlitt started all of this...
3-bit SDIO - that must be a typo! No idea what interface they might be hinting at.
Are you sure? yes | no
Is it possible it's a 3-cable SDIO interface? Maybe SD_CLK, SD_CMD and SD_D0. Which makes me wonder, is SD_D1 required in these instructions for 1-bit mode?
Are you sure? yes | no
Unfortunately only the pins I'm using are able to boot as SDIO.
Those GPIOs aren't part of the SDIO bus. They are sampled by the ESP on reset to determine how to boot. There's a table on the 4th tab ("strapping") of Espressif's pinlist spreadsheet (http://bbs.espressif.com/download/file.php?id=442) that shows the enumeration. This is why we use GPIO0 to select between booting from flash (001) and from UART (011) for most ESP8266 projects.
For this usage, we want the ESP to boot from an SDIO host. When MTDO(GPIO15) is high, the ESP boots from SDIO, while GPIO0 and GPIO2 choose the bus speed and protocol rev. I leave all three of these unconnected because the ESP8266 has internal pull-ups which configures it to boot in SDIO high speed v2 mode.
Are you sure? yes | no
I see. I had wondered if the reference was more to controlling the SDIO bus rather than being an SDIO bus. Looking further into the CLK/MOSI/MISO/CS0 pins available on the ESP-03 as alt functions, it turns out that the controller for that SPI bus is entirely separate from the one used to access the flash, so the SDIO signals would not be readable on that bus. (TL;DR: ajlitt, you were right)
On a side note, I don't know the SDIO bus very well, but if four Dn pins are required for 4-bit mode, wouldn't it be possible to use one Dn pin for 1-bit mode? Or are two pins required for bi-directional connections?
Are you sure? yes | no
Thanks for your great instructions. I am having trouble with number 10. When I toggle the gpio, the led light on the ESP12F flashes and the system seems to become unresponsive. I am on the pi2. Thanks for your help.
Are you sure? yes | no
Does it eventually come back? This is what I usually see when the driver is having trouble loading firmware to the module. Are you attempting to overclock the SDIO bus? Have you checked the wiring on the SDIO_Dn signals?
Are you sure? yes | no
You should only do step 10 if the module does not show up ie driver not loaded. If the driver has loaded already & you do this, the system will hang. Precede it with "sudo modprobe -r esp8089" to avoid that happening.
Are you sure? yes | no
Great! I have stopped the system hang but now I am getting this error:
***** EAGLE DRIVER VER:bdf5087c3deb*****
[ 65.861546] esp_sdio_dummy_probe enter
[ 66.064687] esp_sdio_init power up OK
[ 76.324728] resetting event timeout
[ 76.324753] esp_init_all failed: -110
[ 76.324760] first error exit
Any ideas?
*******EDIT******
I was able to fix it by re-wiring with 33 ohm resistors. Thanks for the advice and the great project! I am getting about 25mb/s.
Are you sure? yes | no
I'd re-check the connections between Pi & module, both wiring-wise & for good contact.
Are you sure? yes | no
It is ALIVE! I had it wired wrong the first and second time! (my screenshot of the old instructions still had D3 and VCC swapped - oops) - thanks for helping me through! (it would be cool if you could re-add the esp03-table to the instructions)
ifconfig detects a wlan0 and iwlist has found my access point!
To recap for everyone having problems compiling the driver on 4.4.x:
- in 'sdio_stub.c' change the line "#include <mach/gpio.h>" to "#include <linux/gpio.h>"
- make sure the esp is wired correctly
Are you sure? yes | no
Congrats! Good point, I forgot that some people might still want to work with the ESP-03.
Are you sure? yes | no
Well done for battling through! Table 8, page 14 of the ESP8266EX Datasheet Version 4.4 is a solid reference for the pin mapping.
Are you sure? yes | no
It seems to fit here better: i can't compile esp8089 - it can't find <mach/gpio.h>
what am i doing wrong? i followed your instructions and am hanging on number (8)
In file included from /home/pi/esp8089/sdio_sif_esp.c:58:0:
/home/pi/esp8089/sdio_stub.c:7:23: fatal error: mach/gpio.h: No such file or directory
#include <mach/gpio.h>
thanks
Are you sure? yes | no
It's been a while since I went through the instructions on a fresh install. I'll do that tonight. I don't want to hold your password manager up, it looks slick!
Are you sure? yes | no
Thanks! i forgot to mention that i run Kernel 4.4.2 (installed via rpi-update), because the USB gadget driver isn't available on 4.1
on another note: what resistor value do you recommend for the esp-03 with the flash desoldered? (currently i have forgotten to install them)
Are you sure? yes | no
Ah, your problem is due to kernel differences. 4.4.1 has no include/mach/gpio.h for bcm2708. Try changing the path to <linux/gpio.h>.
Are you sure? yes | no
It compiled now. But I can't get it to work. when I do `insmod esp8089.ko` it says:
insmod: ERROR: could not insert module esp8089.ko: Unknown symbol in module
dmesg output: https://gist.github.com/girst/9655e9ba3767ac1f2f82
Are you sure? yes | no
Oh, and using no resistors is OK as long as it's working. If you see instability start with 33 ohms and go up from there. You may need that if you want to try for 62.5MHz SDIO.
Are you sure? yes | no
ah, do "sudo modprobe mac80211" first
Are you sure? yes | no
sorry for taking up your time, but it still doesn't work.
now, `modprobe esp8089` takes a lot longer, but still fails with this message:
modprobe: ERROR: could not insert 'esp8089': No such device
dmesg:
***** EAGLE DRIVER VER:bdf5087c3deb*****
[ 105.312618] esp_sdio_init ------ RETRY ------
[ 116.313184] esp_sdio_init ------ RETRY ------
[ 127.312652] esp_sdio_init ------ RETRY ------
[ 138.312617] esp_sdio_init ------ RETRY ------
[ 138.312742] eagle sdio can not power up!
Are you sure? yes | no
do you have by chance the pinout for the esp-03 still at hand? i figure, i might have swapped a signal or two
Are you sure? yes | no
That's progress. Did you wire CH_PD on the ESP-03 to a GPIO? Try toggling it low and then high, then try loading the module
Are you sure? yes | no
i have. it is on the pi's pin 7 (GPIO4?) and i did:
root@hardpass:/home/pi# echo 4 > /sys/class/gpio/export
root@hardpass:/home/pi# echo low > /sys/class/gpio/gpio4/direction
root@hardpass:/home/pi# echo in > /sys/class/gpio/gpio4/direction
and then modprobe again. but same result
EDIT:
SO....i found a screenshot of the old instructions for the esp03 - and i managed to flip the pinout (pin1 to pin5, etc). I'll rewire it and then it will hopefully work. thanks for helping me get it compiled!
Are you sure? yes | no
so, i rewired it, but it still doesn't work. its getting rather late now here so i'll try again tomorrow. thanks anyways ;)
Are you sure? yes | no