Hi
I am having same strange issue, this issue appears on Arduino Mega family and code works fine with hardware serial on Leonardo.
I am posting simple code to reproduce the issue. Connecting any Serial device on Serial1 (I tested with SIM808) Sim800.
void setup()
{
while(!Serial);
Serial.begin(115200);
Serial1.begin(115200);
}
void loop() {
while(Serial.available())
{
Serial1.write(Serial.read());
}
while(Serial1.available())
{
Serial.write(Serial1.read());
}
// put your main code here, to run repeatedly:
}
Sending AT with echo enabled on GSM should output
AT <---- Coming to Arduino
OK <----
but it outputs
AT <---- This is data which was transmitted on TX but it is recieved on RX as well, (THIS IS ISSUE!)
AT <---- Coming to Arduino
OK <----
Also check other ports as well, same issue.