Open Alain-Godo opened 10 months ago
Hi everyone!!! I have the following issue. When I receive the data in a sync way all is fine (using the loop for example) but the callback function is never triggered using the onReceive() method.
IDE: PlatformIO Board: ESP32 DOIT DEVKIT V1 Pin used: HSPI + 4 (Reset) + 2 (DIO0)
hspi = new SPIClass(HSPI); hspi->begin(); lora2.setSPI(*hspi);
lora2.setPins(15,4,2); Serial.println("Begining 2..."); Serial.println(lora2.begin(915E6)); lora2.onReceive(lora2Callback); lora2.receive();
void lora2Callback(int packet_size) { Serial.print("Received packet: '");
// read packet while (lora2.available()) { Serial.print((char)lora2.read()); } // print RSSI of packet Serial.print("' with RSSI "); Serial.println(lora2.packetRssi());
}
I tried changing the DIO0 pin that is related to the interrupt but still doesn't work.
Try to keep your callback extremely short. It's a system interrupt. This problem bugged me for days.
Read this issue to solve all your confusions: link
Hi everyone!!! I have the following issue. When I receive the data in a sync way all is fine (using the loop for example) but the callback function is never triggered using the onReceive() method.
IDE: PlatformIO Board: ESP32 DOIT DEVKIT V1 Pin used: HSPI + 4 (Reset) + 2 (DIO0)
Setup code:
hspi = new SPIClass(HSPI); hspi->begin(); lora2.setSPI(*hspi);
lora2.setPins(15,4,2); Serial.println("Begining 2..."); Serial.println(lora2.begin(915E6)); lora2.onReceive(lora2Callback); lora2.receive();
Callback function:
void lora2Callback(int packet_size) { Serial.print("Received packet: '");
}
Note:
I tried changing the DIO0 pin that is related to the interrupt but still doesn't work.