Hi. I have developed a network based on Arduino101-LoRa(SX1276) and have been successfully using SX1272 library. In the receiver side node, I have a rare packet loss problem. Somewhere in my main loop, the system waits for an upcoming packet for 2 (sec) executing the following command: sx1272.receivepackettimeout(2000).
If it catches something, it goes to execute the respective subroutines where it may lose the next packet in the meantime. I guess, I have to be able to either use hardware interrupt or read FIFO where the lost packet is stored. However, I don’t know how to do this? My proposed command (sx1272.receive…) just reads the upcoming packet, not already stored packet in FIFO.
Then, I have three brief questions:
How to implement hardware interrupt in SX1276?
How to check and read the buffer before receiving the next packet?
You have looked at the data sheet where the use if the FIFO is described ?
As for interrupts see the ‘DIO mapping in LoRa’ part of the datasheet which tells you that DIO0 is the hardware pin that goes active when a packet RX receipt is done, assuming you have set the IRQ mask as decribed in the list of LoRa registers.
If you leave the LoRa device alone, once its setup for receive mode it will sit there as long as you like waiting for a packet to arrive. Although there is a the possibility of false packet detection that you need to deal with.
If you have issues with a particular LoRa library, you could raise it with the author of that library, is this a TTN library you are using ?
Thanks LoRaTracker!
Yes, I use the datasheet frequently. However, I find it a bit complicated in some cases like CAD mode and FIFO usage in my application as I discussed.
I am still working on the hardware interrupt to see if I can bypass my FIFO read issue.
Well … this is a forum for the support of TTN stuff, perhaps better to raise issues with your point to point library at the GITHUB location where the library is.
Hi again,
I implemented the hardware interrupt in the receiver side of my node-node platform (Arduino101 + SX1276) by the following instruction in my Arduino code: attachInterrupt(digitalPinToInterrupt(2), RunInterrupt, FALLING );
The receiver issues interrupt in 99% of cases whenever a data packet receives. The LoRa shield connected to Arduino is in RX continuous mode. But, I am not sure if I need to set a specific register for LoRa or Arduino to make sure the receiver is sensitive enough to get 100% of receiving signals?