but when i upload on it i get bad characters on serial monitor ( here is the picture of bad chars ) i try other baud rates but not working.My settings are here
Welcome to the forum.
What happens, when you turn serial monitor off and switch it on again via the IDE after the sketch is running?
Maybe you have to insert a code line which waits a very little time before the serial monitor has to display something, which is e.g. required for the Leonardo.
During boot of the ESP8266 (before the welcome message is displayed) the baud rate is set to 76800 before being set to the default baud rate of your firmware (note I do not know what firmware you are running, there are many floating about right now). This is normal! You will know if your ESP8266 has successfully booted if you receive a welcome message (which varies with firmware).
Post #5: makes sense.
As I don't have an ESP8266 currently at hand: it would be interesting, if the code line for the Leonardo which waits for the serial monitor being ready, or a short delay until all power and boot conditions are stabile, would eliminate the garbage.
So I am waiting for the PO coming back with an answer if he was successful with one of these approaches.
rpt007:
Post #5: makes sense.
As I don't have an ESP8266 currently at hand: it would be interesting, if the code line for the Leonardo which waits for the serial monitor being ready, or a short delay until all power and boot conditions are stabile, would eliminate the garbage.
So I am waiting for the PO coming back with an answer if he was successful with one of these approaches.
rpt007:
Post #5: makes sense.
As I don't have an ESP8266 currently at hand: it would be interesting, if the code line for the Leonardo which waits for the serial monitor being ready, or a short delay until all power and boot conditions are stabile, would eliminate the garbage.
So I am waiting for the PO coming back with an answer if he was successful with one of these approaches.
I changed my code to:
void setup()
{
Serial.begin(9600);
while (! Serial);
Serial1.println("Hi My Name is Emad ");
}
void loop()
{
}
You can't prevent it form printing those bad characters. The module prints that as a part of its internally programed boot sequence. You would have to change the bootloader. Why is it such a problem, anyway? If you are sending serial data to a PC program, you would frame the data so that garbage is ignored as suggested by J-M-L.
rpt007:
Welcome to the forum.
What happens, when you turn serial monitor off and switch it on again via the IDE after the sketch is running?
Maybe you have to insert a code line which waits a very little time before the serial monitor has to display something, which is e.g. required for the Leonardo.
void setup()
{
Serial.begin(9600);
while (! Serial);
Serial.print("Hello World");
}