EEVblog Electronics Community Forum
Electronics => Beginners => Topic started by: ashwinbr on September 29, 2017, 06:56:15 pm
-
Hi All,
I'm a newbie in electronics and just getting into Arduino/RaspPi type projects.
I'm working on a project to add some ESP8266 MCU based IoT devices at my home (switches, dimmers etc).
In trying to upload a firmware on to ESP-01, I've repeatedly failed to even get an AT command to work and I'm desperate.
I'd be grateful for any help/advice/pointers towards this.
So far here's my setup.
Power supply: 3.3v breadboard P/S module
USB Serial adapter: FTDI based USB to Serial adapter. Connected to a Windows 10 PC using FTDI 2.12.28.0 drivers with a 8/16/17 timestamp.
I've tried 3 different adapters all based on FTDI chip, including one that says genuine FTDI chip. :-)
ESP-01 connections as follows:
Normal Working mode:
FVCC --> +3.3v
GND -> Ground
CH_PD --> +3.3v
GPIO 0 --> Open
GPIO 2 --> Open
RX pin --> TX of FTDI
TX pin --> RX of FTDI
Firmware Upload mode:
VCC --> +3.3v
GND -> Ground
CH_PD --> +3.3v
GPIO 0 --> GND
GPIO 2 --> Open
RX pin --> RX of FTDI
TX pin --> TX of FTDI
Software:
ArduinoIDE (All the appropriate boards' libraries updated)
ESPEasy
ESPlorer
Putty terminal emulator
Normal working mode:
When I hook up everything all the right lights are on (power indicator on FTDI, power indicator on ESP-01)
Blue light flickers initially as the module is coming up and shuts off.
When I connect the terminal emulator (9600 and 115200 baud), I get a constant stream of junk characters.
Most of the time it doesn't respond to any AT commands I type and rarely it responds back with garbage characters.
Firmware Flashing mode:
GPIO-0 conected to ground
RX to RX of USB module
TX to TX of USB Module.
Does not respond to any AT commands, terminal is quiet/blank.
When I run ESPEasy flash command I get the following error about 9 times:
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
warning: espcomm_sync failed
error: espcomm_open failed
I would be very grateful if you could kindly give me any pointers on what I'm doing wrong and how to get this working.
Thank you so much!
-Ash.
PS: I have other ESP-01 based switches like Sonoff switch and Sonoff S20. I've not had any luck with these either.
-
On a fee modules I played with many months ago I had to add a pull-up on one of the GPIO pins to enable programming. Sorry I can't be more specific - it was a while ago!
-
Found a link regarding pullups.... https://www.forward.com.au/pfod/ESP8266/GPIOpins/ESP8266_01_pin_magic.html (https://www.forward.com.au/pfod/ESP8266/GPIOpins/ESP8266_01_pin_magic.html)
There is a table indicating a pull-down on gpio0 and a pull-up on gpio2
-
Not sure what module you are using but for Nodemcu use ESPFLASHER
to restore firmware.
https://github.com/nodemcu/nodemcu-flasher
Regards, Dana.
-
Hi All,
Thanks so much for the input.
I will definitely check out the URL for pullup resistors (I've not used it in my setup, so it could be something I possibly need).
Also thanks for the new flasher tool. Will check it out.
THank you.
Ashwin.
-
RX pin --> TX of FTDI
TX pin --> RX of FTDI
This should be the case for both programming mode and normal operating mode - always.
Other than that, check that your 3.3V supply can supply sufficient current.
Check that your FTDI (or similar) device works by sending characters in a serial terminal, and then just connect the TX back to the RX with a wire, and confirm that you now get an "echo" from the serial port.
Generally, I would not recommend the ESP-01 as a worthwhile beginner's device.
It's hard to set up for beginners, you have to provide the serial comms and 3.3V supply, you can't use it on a breadboard, and you only get a couple of GPIO pins.
An ESP-12 is about the same price, or a Wemos D1 board, or a NodeMCU Amica board, are all much easier to use.
Something like an Amica is slightly more expensive but gives you the 3.3V and serial already sorted easily for you.
GPIO15 is already tied to ground on the ESP-01. There are already internal pull-ups on GPIO0 and GPIO2, but you can try adding some yourself, like 10k or 4k7, and see if there's a difference.
Maybe try adding a decoupling capacitor on the 3.3V supply too.