Skip to content

Instantly share code, notes, and snippets.

@probonopd
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save probonopd/b94a530d9677ee2ac4a8 to your computer and use it in GitHub Desktop.

Select an option

Save probonopd/b94a530d9677ee2ac4a8 to your computer and use it in GitHub Desktop.
ESP8266 experiments
I got cheap ESP8266.txt modules from China and was struggling to get them working electrically. It turns out they are very power hungry, in fact, when you use a serial adapter to power them, most likely they will crash the serial adapter due to their power draw. For this reason, I was not able to communicate with the device for a long time.
This setup works for me:
Solder VCC and CH_PD pin together (TODO: Check whether using a 1k pullup resistor changes the overall power consumption). Use a Prolific USB serial adapter to provide the 3.3V and GND, use another(!) serial adapter connected to the same USB hub (so that they share GND) to provide the RX and TX pins for the serial connection. This setup might not be the cleanest, but it was the quickest for me to get up and running.
According to my measurement with a cheap USB "Charger Doctor", the device draws 470 mA when hooked up to a Prolific serial adapter for providing the 3.3V.
My module had the following firmware pre-loaded:
[Vendor:www.ai-thinker.com Version:0.9.2.4]
I could communicate at 9600 baud with the device.
I am using the WiFiScan sketch to test. Uploading looks like this:
esptool v0.0.3a - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
setting board to none
setting baudrate from 115200 to 115200
setting port from /dev/tty.usbserial to /dev/cu.SLAB_USBtoUART
setting address from 0x00000000 to 0x00000000
espcomm_upload_file
stat /var/folders/h1/rsvk7j2568l73zfp2s80z9q80000gn/T/build71041253851688051.tmp/WiFiScan.cpp_00000.bin success
opening port /dev/cu.SLAB_USBtoUART at 115200
tcgetattr
tcsetattr
serial open
opening bootloader
resetting board
trying to connect
espcomm_cmd: sending command header
espcomm_cmd: sending command payload
serialport_receive_C0: 0C instead of C0
trying to connect
espcomm_cmd: sending command header
espcomm_cmd: sending command payload
espcomm cmd: receiving 2 bytes of data
espcomm_open
Uploading 32624 bytes from /var/folders/h1/rsvk7j2568l73zfp2s80z9q80000gn/T/build71041253851688051.tmp/WiFiScan.cpp_00000.bin to flash at 0x00000000
erasing flash
calculated erase delay: 596
espcomm_cmd: sending command header
espcomm_cmd: sending command payload
espcomm cmd: receiving 2 bytes of data
writing flash
................................
setting address from 0x00000000 to 0x00040000
espcomm_upload_file
stat /var/folders/h1/rsvk7j2568l73zfp2s80z9q80000gn/T/build71041253851688051.tmp/WiFiScan.cpp_40000.bin success
espcomm_open
Uploading 146132 bytes from /var/folders/h1/rsvk7j2568l73zfp2s80z9q80000gn/T/build71041253851688051.tmp/WiFiScan.cpp_40000.bin to flash at 0x00040000
erasing flash
calculated erase delay: 938
espcomm_cmd: sending command header
espcomm_cmd: sending command payload
espcomm cmd: receiving 2 bytes of data
writing flash
...............................................................................................................................................
starting app without reboot
espcomm_cmd: sending command header
espcomm_cmd: sending command payload
espcomm cmd: receiving 2 bytes of data
closing bootloader
And sure enough, I do see the access points in my vicinity! :-) WORKS!
MAC address starts with 18:fe:34 which belongs to Espressif Inc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment