Weird number output on Serial

Hello I'm trying to send some data from my NodeMcu ESP8266 to my Arduino Mega. However I only receive some weird number output. (255,254, 101,115,116,...)

The goal is to send a simple String.

I've already tried to change the baudrate, but that doesn't seem to help.

Arduino Code

void setup() {

Serial.begin(9600);
Serial1.begin(9600);
}

void loop() {

   if(Serial1.available() > 0){
     Serial.println(Serial1.read());
  }
}

ESP code

#include "SoftwareSerial.h"

SoftwareSerial ArduinoMega(D7,D8); 

void setup() {

Serial.begin(9600);
ArduinoMega.begin(9600);

//pinMode(D7, INPUT);
//pinMode(D8, OUTPUT);

}

void loop() {

  ArduinoMega.print("test");
  delay(100);

}

Nevermind, I had to convert the bytes to char

JasperJP:
Hello I'm trying to send some data from my NodeMcu ESP8266 to my Arduino Mega. However I only receive some weird number output. (255,254, 101,115,116,...)

The goal is to send a simple String.

I've already tried to change the baudrate, but that doesn't seem to help.

Happy that your Arduino receives something !

Your Aduino print the code ASCII of the characters ent by the ESP, but in decimal.

codes ASCII of "test" , in decimal, are :

116 t
101 e
115 s
116 t

I had to convert the bytes to char

Just for completeness' sake, and the next member with the same problem, how about posting the working code?

This is a working example:

char ch;
void setup() {

Serial.begin(9600);
Serial1.begin(9600);
}

void loop() {

   if(Serial1.available() > 0){
       ch = Serial1.read();
     Serial.println(ch);
  }
}