Chat freely about anything...

User avatar
By Raul
#22302 Hi every one, a couple of days ago I recieved my ESP8266 modules, I stated playing with them I everithing was OK until today,
the thing is when I connect a sensor to pin 2 it stops working, but it worked before, I realized that its when I connect the pin to GND, does any body knows how can I solve this?
User avatar
By kolban
#22461 Ive been studying these devices recently but am far from an expert. However, here is what I think I am seeing. The GPIO2 pin has two purposes on the device. The first is that it can act as a GPIO. The second, is that it is the TX line of a second UART (Serial connector). This means that if the device starts to communicate using the 2nd UART, the TX line will start receiving data. As such, you should not ground or set high this pin as if it should start sending data, that will be a "short" (if grounded and you transmit a "1", that will short the pin (me thinks)).

Now ... you may say that this does not apply to you since you may not be explicitly writing to the 2nd UART (known as UART1 - the first is UART0). However, the device writes to UART1 by itself in certain circumstances.

First, when you flash the device, the data received is apparently also written to the TX pin of UART1 (GPIO2).
Second, the "debug" code in the device writes its output to UART1.
User avatar
By tytower
#22517
kolban wrote: However, the device writes to UART1 by itself in certain circumstances.
First, when you flash the device, the data received is apparently also written to the TX pin of UART1 (GPIO2).
Second, the "debug" code in the device writes its output to UART1.


I did not know that kolban . Do you have a reference I can check it from please I'd like to put a note in the wiki?
User avatar
By kolban
#22524 Howdy tytower,
I know I found this by grunging through the low level docs but I don't have the references to hand and would have to re-walk my path to see how I got there ... however, there is a relatively easy way to see if what I am saying holds ...

What I do is add a second USB->Serial to my circuits. The first is connected to TX/RX of the ESP and is used for flashing and for UART0. Now, add a second USB->Serial and leave its TX pin unconnected. However, connect the RX pin of this second USB->Serial to GPIO2. Now start a serial terminal monitor (eg. putty) and connect that to the second COM port. Watch the traffic arrive. I now always wire this into my circuits and use this for debugging.