Hello.
I am using MKWAN1310 and receiving data via LoRa,
In rare cases, multiple receive messages are output.
The receiver program is as follows.It is the same as the sample.
// try to parse packet
int packetSize = LoRa.parsePacket();
if (packetSize) {
// received a packet
Serial.print("Received packet '"); // read packet
// read packet
while (LoRa.available()) {
contents += (char)LoRa.read(); }
}
// print RSSI of packet
Serial.print("' with RSSI ");
Serial.println(LoRa.packetRssi());
Serial.println(contents); Serial.println(contents);
The received LOG at that time shows
20230801_155211 : b "Received packet '' with RSSI -123\r\n"
20230801_155211 : b'Lora SEnd:241\r\n
20230801_155211 : b "Received packet '' with RSSI -123\r\n"
20230801_155211 : b'Lora SEnd:241\r\n'
The form will be something like this. (date and time, b"" is given by python for serial reception)
The sender is sending while incrementing Lora SEnd:XXX and the timestamps are the same time, so I think the receiver is receiving more than one message.
The LoRa setting is SF12/Band125kHz.
Well LoRa.parsePacket(); should return 0 if there is no packet ready, there should be no need to use interrupts. If there was an inherrent problem here you would not expect the apparent double receipt of packets to be just 'rare'.
I would add a print of millis() just before the print of "Received packet" this would tell you the time gap between these apparent duplicate packets.
You have marked the issue as solved, did the solution suggested in post #5 solve the 'rare' double receipt of packets ?