-->
Page 1 of 1

Lost connection to my esp-01

PostPosted: Sat Jun 27, 2020 12:57 pm
by ajaymccollum
I was trying to get input from pin 1 (tx) on the esp-01 using in code: pinMode(1, INPUT). This didn't seem to get me anything. After some research, I found someone suggest there needed to be this under void setup(): pinMode(1, FUNCTION_3) to get the pin to stop trying to print to serial. Now, directly after compiling the code, it tries to connect to the board, but says there's no board to be found. Doesn't even try to upload anything.
Now I can't upload any code at all no matter what to this board. I even tried it on another, thinking I fried the board with my input wiring from the previous code attempt, and blocked that one out too. Interestingly, it will still run the program that was previously on it, I just can't connect to it and make changes. Thanks for the help!

Re: Lost connection to my esp-01

PostPosted: Tue Jun 30, 2020 10:30 am
by DIRR70
Hi ajaymccollum,

I guess, when you say you are trying to upload your code to the board you are using some kind of external programmer? Probably some sort of USB2UART adapter?
Then it depends on what you have done with the TX pin. What is it connected to? If you have connected it with a very low resistance to ground or maybe connected it to an output of a different chip it may be, that it gets 'short curcuit' to ground. But because the TX pin is pin that the chip sends serial data back to the PC (respectively the programmer) you are told that there is no ESP-01 present.
Using the pins RX and TX on the ESP-01 is very tricky, because they need to work as a normal serial RS232 interface to upload the code. If you just need 1 single IO pin I would suggest to use GPIO0 or GPIO1!
Those two pins can be inputs 'pinMode (0, INPUT);' or 'pinMode (1, INPUT);' respectively and the state can be read with 'digitalRead (0)' or 'digitalRead (1)' respectively. But be careful! The ESP8266 (that is the chip on the ESP-01) does enter the boot loader after RESET if one of the 2 pins GPIO0 or GPIO1 is tied to ground! So you have to ensure, that both pins are pulled up (or left empty) when the chip 'starts'.