The signal to noise Ratio (SNR) and Received Signal Strength Indication(RSSI) for inbound messages required reading values from three registers
- RegPktSnrValue
- RegPktRssiValue
- RegRssiValue
I had to modify the EventArgs returned to the customer
public class OnDataReceivedEventArgs : EventArgs
{
public float PacketSnr { get; set; }
public int PacketRssi { get; set; }
public int Rssi { get; set; }
public byte[] Data { get; set; }
}
I was inspired by the RSSI adjustment approach used in the Arduino-LoRa library
// Get the RSSI HF vs. LF port adjustment section 5.5.5 RSSI and SNR in LoRa Mode
float packetSnr = this.RegisterManager.ReadByte((byte)Registers.RegPktSnrValue) * 0.25f;
int rssi = this.RegisterManager.ReadByte((byte)Registers.RegRssiValue);
if (Frequency < 868E6)
rssi = -164 - rssi; // LF output port
else
rssi = -157 + rssi; // HF output port
int packetRssi = this.RegisterManager.ReadByte((byte)Registers.RegPktRssiValue);
if (Frequency < 868E6)
packetRssi = -164 - rssi; // LF output port
else
packetRssi = -157 - rssi; // HF output port
OnDataReceivedEventArgs receiveArgs = new OnDataReceivedEventArgs
{
PacketSnr = packetSnr,
Rssi = rssi,
PacketRssi = packetRssi,
Data = messageBytes
};
The values displayed in the Rfm9xLoRaDeviceClient application looked reasonable, but will need further checking