To test the hardware first, I uploaded a sender code to the first setup (which sends the message 'HELLO 1, HELLO 2, ...') and a receiver code to the second setup, as shown above.
you appear to have missed the call to setpins(), e.g.
void setup() {
Serial.begin(115200);
while (!Serial);
Serial.println("LoRa Sender ");
//void setPins(int ss = LORA_DEFAULT_SS_PIN, int reset = LORA_DEFAULT_RESET_PIN, int dio0 = LORA_DEFAULT_DIO0_PIN);
LoRa.setPins(10, 9, 2); // 10 for UNO and Nano, 53 for Mega
if (!LoRa.begin(433E6)) {
.......
looking at the receiver serial monitor output in post 1 you are receiving parts of transmitted messages then corrupted information
are there any other 433mhz devices in the area which could be corrupting transmissions?
how far apart are the RA-02 modules?
maybe worth printing the value of packetSize
@mikb55 - Are you sure that we need Level shifters for 3.3V ??
I ask this question because, in number of forums and Youtube videos, none of them recommend to use a Level shifter between Arduino Uno / Nano and Lora SX-1278 modules !!
Connecting 5V logic level pins direct to the LoRa module can cause also cause phantom power feeding to the LoRa module and raise the VCC level to 4V, which exceeds the maximum Semtech specify. Read here;
Been using LoRa modules since they were first released in 2014, never used a 5V logic level Arduino with them. I did maybe try once in 2015, but quickly gave up on the idea.
Lots of info out there on 'Arduino Logic Level Conversion'
Link works for me, maybe you have been caught up in the Microsoft moves to 'enhance security' on Github.
on a device which uses 3.3V logic unless pins are specified as 5volt tolerant the device can be damaged if 5V logic is applied
in practice 3.3V devices may work with 5V logic for an minute, an hour, a day, for ever or fail immediately - you don't know - use level converters or even better switch to a microcontroller which uses 3.3V logic
this applies not only to LoRa modules but other WiFi modules, displays, sensors, etc
even if you power the RA-02 from 3.3V if you are using a 5V logic device (e.g. UNO, classic Nano, etc) any output signal (e.g. MOSI, SCLK, CS) which you input to the RA--02 will be at 5Volts and may damage the 3.3V logic RA-02