Mega 2560 serial communication problem

problem looks like:
software serial rx on pin 2 , receiving data from another arduino (eq: “2 24 18 24 16”), it perfectly works on arduino UNO (tested on 2 different boards from robotdyn and arduino.cc) but on arduino mega this is not working (also tested on 2 boards), only zeros are received. Does anybody know why?

#include <SoftwareSerial.h>
#include <Thread.h>
SoftwareSerial mySerial(19, 20); // RX(TX of the module should be connected), TX(not used)
Thread EXTboard = Thread();
int input_pin = 5;
int output_pin = 6;
int someData [5];
int sombodysId, sombodysOldId, tempIn, humIn, tempOut, humOut;
bool shouldbeignored = false;
unsigned long long mytime;
void setup() {
  Serial.begin(9600);
  mySerial.begin(9600);
  mySerial.setTimeout(1000);
  pinMode(output_pin, OUTPUT); digitalWrite(output_pin, HIGH);
  EXTboard.onRun(getSomeInfo);
  EXTboard.setInterval(30000);
}

void loop() {
  if (EXTboard.shouldRun())EXTboard.run();
  if (digitalRead(input_pin))shouldbeignored = false; getSomeInfo(); shouldbeignored = true;

}
void getSomeInfo() {
  if (shouldbeignored) {
    shouldbeignored = false;
  } else {
    mytime = millis();
    digitalWrite(output_pin, LOW);
    delay(500);
    if (mySerial.available()) {
      someData[0] = mySerial.parseInt(); someData[1] = mySerial.parseInt();
      someData[2] = mySerial.parseInt(); someData[3] = mySerial.parseInt();
      someData[4] = mySerial.parseInt();
    }
    sombodysId = someData[0], tempIn = someData[1], humIn = someData[2], tempOut = someData[3], humOut = someData[4];
    shouldbeignored = false;
    digitalWrite(output_pin, HIGH);
    Serial.print(someData[0]);
    Serial.print(' ');
    Serial.print(someData[1]);
    Serial.print(' ');
    Serial.print(someData[2]);
    Serial.print(' ');
    Serial.print(someData[3]);
    Serial.print(' ');
    Serial.println(someData[4]);
  }
}

There is no need to use SoftwareSerial on a Mega as it has 3 spare Hardware Serial ports. Use pin 18 and 19 as Serial1

...R Serial Input Basics - simple reliable ways to receive data.

already tried Serial1 , 2 and 3, no result

Thank you :) , dont know why but this time serial1 working, but on 2nd mega board is not :/ thank you anyway

Robin2’s advice to use hardware serial is the best but just in case you’re curious why software serial didn’t work, here’s the explanation from the SoftwareSerial library’s documentation:
https://www.arduino.cc/en/Reference/SoftwareSerial

Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69).

denspie: already tried Serial1 , 2 and 3, no result

Can we see this program?

You are using the hardware serial pin and applying SoftwareSerial to it? Seems like the long hard way to do this. Not to mention you will run into problems with SoftwareSerial at some point, beyond the fact you have already not used an applicable pin on the MEGA.