Hi everyone,
I’m working with the Ebyte E220-900T33D LoRa module set up as a receiver, and I’m having trouble getting the RSSI (Received Signal Strength Indicator) to work properly. I’ve enabled the RSSI function on the receiver, but I’m not seeing any RSSI values in my output.
the code that I am using:
#include <SoftwareSerial.h>
// Pin definitions
#define LORA_RX 10
#define LORA_TX 11
#define LORA_M0 7
#define LORA_M1 8
char DataRSSI[10];
String command = "C0 C1 C2 C3";
// Initialize SoftwareSerial for communication with the LoRa module
SoftwareSerial loraSerial(LORA_RX, LORA_TX);
void setup() {
// Set pin modes
pinMode(LORA_M0, OUTPUT);
pinMode(LORA_M1, OUTPUT);
// Set M0 and M1 pins to receive mode
digitalWrite(LORA_M0, LOW);
digitalWrite(LORA_M1, LOW);
// Initialize serial communication
Serial.begin(9600);
loraSerial.begin(9600);
Serial.println("LoRa Receiver is ready.");
}
void loop() {
// Check if data is available for reading
if (loraSerial.available()) {
String message = "";
// Read data
while (loraSerial.available()) {
char c = loraSerial.read();
message += c;
delay(10); // Small delay for stable reception
}
// Send command (if necessary)
loraSerial.println(command);
// Read RSSI (if RSSI is sent as 4 bytes)
if (loraSerial.available() >= 4) { // Check if at least 4 bytes are available
loraSerial.readBytes(DataRSSI, 4);
Serial.print("RSSI: ");
Serial.println(String(DataRSSI)); // Convert char array to String
}
// Display the received message
Serial.println("Received message: " + message);
}
}
Here’s the situation:
- RSSI Value Not Showing:
- The code should be reading RSSI values when at least 4 bytes are available. Despite enabling RSSI on the receiver, I’m not seeing any RSSI values in the output.
- Transmitter Details:
- I have a transmitter sending a simple "hello" message. The receiver successfully receives this message, but it doesn’t provide the RSSI.
- Configuration Check:
- I’ve set the M0 and M1 pins for receive mode based on the module's documentation, but I’m not sure if this is correct.
- Communication Confirmation:
- The receiver does get the transmitted message, so it seems like communication is working fine otherwise.
Can anyone help figure out why I’m not getting the RSSI values? Any suggestions on what might be wrong with the setup or code would be really appreciated.
Thanks a lot!