Problem transferring data between 2 arduinos using Serial

while (!Serial1);

This has no meaning on any Arduino. Remove it. It's only relevant to the Arduinos which have "native" USB serial and only on the USB serial port.

pinMode(rx, INPUT);
pinMode(tx, OUTPUT);

After you call Serial.begin() you should never touch the status of the serial pins. You told the serial subsystem that it could start and then you said "hang on, I have a different idea for those pins." Serial.begin() already knows which pin to make an input or output. (Actually, I think you are doing this before calling Serial1.begin() so these lines are useless.)

Serial1.readBytesUntil('\0', buffer, 64);

This is a relic of the early days of Arduino. It would be better if this function did not exist. Try to write your program not to use any of the readUntil, parseInt or related functions. See Serial Input Basics.

I don't know how you can know that a device is sending if the other one isn't receiving. Please describe in more detail exactly how you wired it up and what the result was on each end.

Did you connect the grounds?