Chat freely about anything...

User avatar
By chamuco
#44622 For anyone still having issues and comes across this thread,

One of the main troubles when flashing or communicating with the ESP8266 ESP-01 is providing adequate power. Not only does the ESP8266 ESP-01 require 3.3v, I have found that it requires power to BOTH the VCC pin along with the CH_PD pin for it to function properly regardless of the firmware. I have been using the black ESP8266 ESP-01 branded "AI-Cloud inside" and have successfully flashed the firmware on 3 modules using a raspberry pi. I ordered a USB to TTL converter and did not have luck with the cable alone as it does not provide the adequate power.

To connect via serial using a raspberry pi:
The raspberry pi has 2 3.3v pins which is perfect to power up the ESP8266. In order to communicate with the ESP8266, you would first need to disable the login shell via serial by running 'raspi-config' on the raspberry pi and going to Advanced Options -> Serial -> and choosing "No" followed by rebooting the raspberry pi.
Connect the ESP8266 VCC and CH_PD pins to pins 1 and 17 on the raspberry pi to provide 3.3v to each.
Connect the ground pin on the ESP8266 to pin 6 on the raspberry pi for ground.
Connect the RX and TX pins on the ESP8266 to pin 8 (RX) and 10 (TX) on the raspberry pi.
At this point you should now be able to get a serial connection to the ESP8266 using a terminal emulator such as picocom or minicom. If using picocom you would connect with the following command
Code: Select allsudo picocom -b 9600 /dev/ttyAMA0

Please note you may have to change the baud rate from 9600 to 115200. I have found that after connecting to the serial, you may have to restart the ESP8266 by removing the VCC cable and reattaching it. If connected correctly, you should be prompted with the firmware information.

To flash the firmware using a raspberry pi:
In order to flash the firmware on the ESP8266, you would need to use a firmware flashing tool. I have found that the esptool works really well and can be obtained on github at https://github.com/themadinventor/esptool.
Follow the above cabling steps to connect the ESP8266 to the raspberry pi but also connect the GPIO0 pin on the ESP8266 to a ground pin on the pi.
You will then need to download the firmware of your choice. I chose to flash the NodeMCU firmware which can be found at
https://github.com/nodemcu/nodemcu-firmware/releases
You will then need to run the following command
Code: Select allsudo python esptool.py --port /dev/ttyAMA0 write_flash 0x00000 PATH_TO_BIN_FILE.bin

If you get a fatal error message that it could not connect to the device, remove the cable from the ESP8266 VCC pin and reattach it and rerun the command. You should then be able to flash the device.