Conflict with different data with 2 arduino

I have two arduino(A and B). In the arduino A, I put a rfid reader and the other a gps module. And both connected in TX-RX pins.

But when I pass the card, the data from of both make a mix, impossible to read.

It’s possible to make a other way to resolve?

Code of receive arduino

#include <SoftwareSerial.h>//incluimos SoftwareSerial
#include <TinyGPS.h>//incluimos TinyGPS

char ID;
char ComID;
int cout = 0;
char lonlat;
char hora;

string dados[4];

TinyGPS gps;//Declaramos el objeto gps
SoftwareSerial serialgps(4, 3); //Declaramos el pin 4 Tx y 3 Rx
//Declaramos la variables para la obtención de datos
int year;
byte month, day, hour, minute, second, hundredths;
unsigned long chars;
unsigned short sentences, failed_checksum;

void setup() {
  // Habilita comunicação serial
  Serial.begin(115200);

  // declara pin 11 como output, este é o LED
  Serial.begin(115200);//Iniciamos el puerto serie
  serialgps.begin(9600);//Iniciamos el puerto serie del gps
  //Imprimimos:
  Serial.println("");
  Serial.println("GPS GY-GPS6MV2 Leantec");
  Serial.println(" ---Buscando senal--- ");
  Serial.println("");

}

void gps_leitor()
{
  if (serialgps.available())
  {
   int c=serialgps.read();
    if (gps.encode(c))
    {
      float latitude, longitude;
      gps.f_get_position(&latitude, &longitude);
      Serial.print("Latitud/Longitud: ");
      Serial.print(latitude, 5);
      Serial.print(", ");
      Serial.println(longitude, 5);
      gps.crack_datetime(&year, &month, &day, &hour, &minute, &second, &hundredths);
      Serial.print("Fecha: "); Serial.print(day, DEC); Serial.print("/");
      Serial.print(month, DEC); Serial.print("/"); Serial.print(year);
      Serial.print(" Hora: "); Serial.print((hour, DEC) + 3); Serial.print(":");
      Serial.print(minute, DEC); Serial.print(":"); Serial.print(second, DEC);
      Serial.print("."); Serial.println(hundredths, DEC);
      Serial.print("Altitud (metros): "); Serial.println(gps.f_altitude());
      Serial.print("Rumbo (grados): "); Serial.println(gps.f_course());
      Serial.print("Velocidad(kmph): "); Serial.println(gps.f_speed_kmph());
      Serial.print("Satelites: "); Serial.println(gps.satellites());
      Serial.println();
      gps.stats(&chars, &sentences, &failed_checksum);
    }
    
  }
  
}
void rfid_leitor()
{
  int i;  
  // Se há bytes livres vindo da porta serial
  if (Serial.available())
  {

    ID = Serial.read();
    Serial.print(ID);
    ComID = ID;      
  }

}


void loop() 
{
  rfid_leitor();
  
  gps_leitor();
}

Code of slever arduino

#include <MFRC522.h>
#include <SPI.h>
#include <Wire.h>

#define SAD 10
#define RST 5

int led_liberado = 2;

MFRC522 nfc(SAD, RST);

void setup() {
  SPI.begin();
  byte status;
  byte data[MAX_LEN];
  byte serial[5];
  int i, j, pos;
  // Read a fast as possible. There is a limit for how long we are
  // allowed to read from the tags.
  Wire.begin(8);                // join i2c bus with address #8
  Wire.onRequest(requestEvent); // register event
  Serial.begin(115200);

  Serial.println("Looking for MFRC522.");
  nfc.begin();

  // Get the firmware version of the RFID chip
  byte version = nfc.getFirmwareVersion();
  if (! version) {
    Serial.print("Didn't find MFRC522 board.");
    while(1); //halt
  }

  Serial.print("Found chip MFRC522 ");
  Serial.print("Firmware ver. 0x");
  Serial.print(version, HEX);
  Serial.println(".");
}

byte keyA[6] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, };
byte keyB[6] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, };

void loop() {
  byte status;
  byte data[MAX_LEN];
  byte serial[5];
  int i, j, pos;

  // Send a general request out into the aether. If there is a tag in
  // the area it will respond and the status will be MI_OK.
  status = nfc.requestTag(MF1_REQIDL, data);

  if (status == MI_OK) {
       // calculate the anti-collision value for the currently detected
    // tag and write the serial into the data array.
    status = nfc.antiCollision(data);
    memcpy(serial, data, 5);
  while(j<=1)
 { 
    for (i = 0; i < 3; i++) {
      Serial.print(serial[i], HEX);
      Serial.print(", ");
      j++;
      
    }
    Serial.println(serial[3], HEX);
    digitalWrite(led_liberado, HIGH);
       
 }
  }
  if(status !=MI_OK)
  {
    digitalWrite(led_liberado, LOW);
  }
}
void requestEvent() {
  byte status;
  byte data[MAX_LEN];
  byte serial[5];
  int i, j, pos;
  char ID;
   


  // Send a general request out into the aether. If there is a tag in
  // the area it will respond and the status will be MI_OK.
  status = nfc.requestTag(MF1_REQIDL, data);


  if (status == MI_OK) {
       // calculate the anti-collision value for the currently detected
    // tag and write the serial into the data array.
    status = nfc.antiCollision(data);
    
  while(j<=1)
 { 
    for (i = 0; i < 3; i++) {
      Serial.print(serial[i], HEX);
      Serial.print(", ");
      
      
    }
    Serial.println(serial[3], HEX);
    ID = (serial[3],HEX);
    digitalWrite(led_liberado, HIGH);
    
       
 }
  }
  if(status !=MI_OK)
  {
    digitalWrite(led_liberado, LOW);
  }
}

(I removed the position for privacity.

A schematic of your project would be helpful so that we know what and how everything is connected. Also, please post your code. Please read the how to use the forum stickies to see how to format and post code properly. A sample of the program (serial monitor) output would be nice, as well.

groundFungus:
A schematic of your project would be helpful so that we know what and how everything is connected. Also, please post your code. Please read the how to use the forum stickies to see how to format and post code properly. A sample of the program (serial monitor) output would be nice, as well.

I put. I hope you understand better

Very similar question here.