Hi
I am trying to setup a basic LoRa communication between two Arduino UNO boards and SX1278, 433MHz modules, one as RX and other as RX.
The wired settings are as follows
// LoRa-02 SX1278 module PINs:
// 3.3 V and ground : Connected to 3V3 and GND of Arduino UNO
// RST : Connected to PIN-9 of Arduino UNO
// NSS : Connected to PIN-10 of Arduino UNO
// MOSI : Connected to PIN-11 of Arduino UNO
// MISO : Connected to PIN-12 of Arduino UNO
// SCK : Connected to PIN-13 of Arduino UNO
// DIO0 : : Connected to PIN-2 of Arduino UNO
The connections are same for both RX and TX side.
I am using LoRa Library of Sandeep Mistry version 0.8.0 and used example programs LoRa Sender, which is as below
#include <SPI.h>
#include <LoRa.h>
int counter = 0;
void setup() {
Serial.begin(9600);
while (!Serial);
Serial.println("LoRa Sender");
if (!LoRa.begin(433E6)) {
Serial.println("Starting LoRa failed!");
while (1);
}
}
void loop() {
Serial.print("Sending packet: ");
Serial.println(counter);
// send packet
LoRa.beginPacket();
LoRa.print("hello ");
LoRa.print(counter);
LoRa.endPacket();
counter++;
delay(5000);
}
LoRA Receive:
#include <SPI.h>
#include <LoRa.h>
void setup() {
Serial.begin(9600);
while (!Serial);
Serial.println("LoRa Receiver");
if (!LoRa.begin(433E6)) {
Serial.println("Starting LoRa failed!");
while (1);
}
}
void loop() {
// try to parse packet
int packetSize = LoRa.parsePacket();
if (packetSize) {
// received a packet
Serial.print("Received packet '");
// read packet
while (LoRa.available()) {
Serial.print((char)LoRa.read());
}
// print RSSI of packet
Serial.print("' with RSSI ");
Serial.println(LoRa.packetRssi());
}
}
Except for the frequency, I have not changed any thing in code.
At the TX side, I see prints "Sending Packet" with counter incrementing
On the TX side, I do not see any packets coming.
Both TX and RX side, it does not say LoRa failed, so, I assume Lora is not failed, but the packets are not seen on RX side.
I do not know if there is issue in TX side or issue in RX side.
The LoRa Module which I use reads on case as
RA-02
ISM: 410-525MHz
PA: +18dBm
LoRa/FSK/00k