-->
Page 1 of 1

ESP01 Serial Read Problems

PostPosted: Thu Jul 02, 2015 6:38 am
by Zemzem Mehdi
Hello Everyone
I'm new to ESP01 developing and i'm facing a bit of a problem here .
I'm connecting my ESP to the PC through a USB/TTL 3v3 adapter without Reset and DTR but i'm sure i made the correct connections because i managed to get answer from the ESP and to upload my own code using the Arduino IDE.
My Problem is the following :
This Code Works
Code: Select allvoid setup() {
  // put your setup code here, to run once:
Serial.begin(115200);
}
void loop() {
Serial.write("hello");
delay(5000);
}


But this one shows nothing on the Serial Monitor :
Code: Select allvoid setup() {
  // put your setup code here, to run once:
Serial.begin(115200);
Serial.write("hello");
}
void loop() {
}


Also i tried the HelloServer Exemple , none of the Serial.write Works but i know that the code is working because i managed to find the webpage and see the message displayed.
Help me please and thank you

Re: ESP01 Serial Read Problems

PostPosted: Thu Jul 02, 2015 1:33 pm
by brutzler
Second code is working too. (on my ESP)

Perhaps you are starting the serial monitor too late?

BTW:
Why is this a "serial.read" problem?

Re: ESP01 Serial Read Problems

PostPosted: Fri Jul 03, 2015 2:39 am
by Zemzem Mehdi
The Thing is that sometimes i flash a code(mostly when flashing something with Wifi and Serial in it ) and leave bootloading mode(GPIO0 from GND to floating ) , the esp stops being detected by my pc so i can't even check the serial monitor.

for the name thing, i also have a serial read problem. Every time i try Serial.read() , the arduino IDE stops working and i have to kill the program.
Code: Select allvoid setup() {
  // put your setup code here, to run once:
Serial.begin(115200);
}
void loop() {
   if(Serial.available())
   {
    Serial.write(Serial.read());
delay(500);
   }
}
 

Re: ESP01 Serial Read Problems

PostPosted: Fri Jul 03, 2015 3:05 am
by Zemzem Mehdi
Problem Solved.
Power Source Problems , stoped using the 3v3 from the usb and got an external source
Thank you for your time