1) GET A VERY GOOD POWER SUPPLY (you can use a 5v power supply with a AMS1117 voltage regulator and a 100uF cap (or 470uF))
2) PULL CH_PD, RESET AND GPIO0 TO 3.3v (and probably GPIO2 too) WITH A 10Komh AT LEAST
3) BE SURE YOU HAVE THE LATEST FIRMWARE (both AT firmware or nodemcu firmware)!
4) IF YOU CAN, AVOID BREADBOARDS AND SOLDER ALL COMPONENTS ON A PCB
And this is a my fritzing diagram of connections!
OLD MESSAGE:
Hi all!
I'm going a little crazy
After days of work I'm very close to a working arduino + esp8266 setup.
This is what I have:
1) 5v 2A max main power supply
2) Voltage regulator (LM317, 1.5A max) set to provide 3.3V
3) 100uF decoupling cap between 3.3V and GND
4) Voltage divider (R1=476omh R2=1komh) on RX pin of esp8266 to connect with Arduino TX
5) 100omh resistor on TX pin of esp8266 to connect with Arduino RX (just for safety)
6) CH_PD tied on 3.3V
7) Voltage divider (R1=476omh R2=1komh) on RESET pin of esp8266 so I can reset the esp8266 from Arduino
8) Both GPIO floating
9) Firmware of esp8266: nodemcu-firmware 0.9.5
The problem is that almost 2 times out of 3 the esp8266 starts with garbage data and doesn't complete the boot.
For now i fixed the problem with this little hack running on Arduino:
Serial.setTimeout(1000);
for (int i=0; i <= 10; i++){
digitalWrite(pinres, LOW);
delay(1);
digitalWrite(pinres, HIGH);
if (Serial.find("> "))
break;
}
basically the Arduino resets the esp8266 until the prompt char ("> ") is found.
So......why the hell this damn thing can't boot fine EVERY time?
I tested with another esp8266 and i get the same behaviour, so unless i broken both of them i don't think that my esp8266s are broken...
Please, help me