Serial Monitor sending data weird 每

Hello :slight_smile:
i wanted to test if my ESP8266 WIFI module is working correctly. Because i dont have any usb-uart module, i used my leonardo to read what's receiving and send over serial monitor. Code:

void setup() {
聽 // put your setup code here, to run once:
聽 Serial.begin(115200);
聽 Serial1.begin(9600);
}

void loop() {
聽 // put your main code here, to run repeatedly:
聽 while(Serial.available()) Serial1.write(Serial.read());
聽 while(Serial1.available()) Serial.write(Serial1.read());
}

the Module is connected to the uart pins on the leonardo, with a voltage divider on rx. when i remove the power and apply it again, i get the normal boot text.

*weird characters 
[Vendor:www.ai-thinker.com Version:0.9.2.4]

ready

but if i enter "AT" and press send, i sends "AT媒". And both, rx and tx pin light up.

Whats the problem?

thanks

Straw

That funny y symbol often means that the baudrate of the Serial Monitor does not match the baud rate of the Arduino program.

...R

double checked, tripple checked, changed baudrate in sketch and in monitor. still same


Tested every baudrate, still same y.

~Straw

Looks like the ISO Latin 1 character for character code 0xFD.

If you use any other command does it also get echoed with that character after it?

What happens if you change the Serial.write() to Serial.print()?

聽 while(Serial.available()) Serial1.print(Serial.read());
聽 while(Serial1.available()) Serial.print(Serial1.read());

econjack:
What happens if you change the Serial.write() to Serial.print()?

聽 while(Serial.available()) Serial1.print(Serial.read());

while(Serial1.available()) Serial.print(Serial1.read());

with print im getting decimal code back

One more try, and tell me what decimal codes you are seeing:

聽 while(Serial.available()) Serial1.print((char) Serial.read());
聽 while(Serial1.available()) Serial.print((char) Serial1.read());

econjack:
One more try, and tell me what decimal codes you are seeing:

聽 while(Serial.available()) Serial1.print((char) Serial.read());

while(Serial1.available()) Serial.print((char) Serial1.read());

Well now it outputs normal characters. but somehow it now doesnt reports the last command i send. after sending "AT" nothing happens, there is no "AT" in the Serial monitor.

~Straw

OK went over to a friend and lend his uart module. when typing at it works. So it can only be a fault of my wiring, of the code or, lets hope not because its new, of my arduino

~Straw

OK, swapped out the resistors, now it works:)

The y with the dots on top has extended ASCII code 0xFF (255 in decimal) and indicates a value of -1 being read. That is either caused by a 'real' end of file condition or bad wiring.

kind regards,

Jos