SX1278 LoRa exmples compiling. Transmitter emits signal but Receiver getting timeout in a loop #962
-
Doing simple test of library usability i tried a pair: |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 12 replies
-
Please fill in the information requested by the issue template.
Timeout is not an error, it just means that the receiver did not hear anything in the time window it was receiving, that's it. Did you try with interrupts?
I don't know what you are trying to say here - the library transmits the packets you provide, if you reqeust to send 15 bytes it will send a 15 byte packet + preamble/header/CRCc, which again is set by yourself. You have absolute control over the packet size being sent. |
Beta Was this translation helpful? Give feedback.
-
No I haven't tried with interrupts. I would like to stick with one interrupt (is it interrupt or poll ? ) line DIO0 which is required. Polling mode on the receiving side is fine for me. Data is being sent in the loop by the transmitter device every second and once it is received by the receiving side SX1278 it should be seen in the nearest receiver's loop . It isn't. It always ends up with continuous timeout regardless of trasmitter being on or off.
That is clear now. In other devices with UART like Ebyte E22 they use predefined packet length so i thought there is some distinction between stream and packet modes. As I now understand there are always packets of arbitrary length that can be different every transmission event. |
Beta Was this translation helpful? Give feedback.
-
In interrupt mode, it's an interrupt, as the name suggest. In blocking mode, the pin is polled.
Packet reception is signaled on DIO0. On the contrary, timeout is signaled on DIO1, or handled by software if you did not provide DIO1.
Then you will see timeouts. That's just what blocking mode is.
That's not how this works. If the receiver is not receiving while you are transmitting, then you will not get the packet. And when the receiver times out, it will no longer receive, until reception is restarted. That's the base of the blocking mode. With interrupts, the receiver is listening continuously and triggers an interrupt when it receives a packet. Also, this is not an issue in the library, but a generic question about usage, so I'm converting this thread to a discussion. |
Beta Was this translation helpful? Give feedback.
-
Looking and the code I can not agree with this statement. Timeout values are compared to microsecond clock in both cases and they are calculated in the same algorithm. There is just this 1000 factor outstanding. |
Beta Was this translation helpful? Give feedback.
-
I agree. To make it useful another mode could be done to name it Poll as oppoosed to Blocking. Basically Poll mode would be similar to interrupt with one exception. Instead of interrupt signal, 'Ready' condition would be determined by polling status. It could be useful in cases where interrupt line is not available. |
Beta Was this translation helpful? Give feedback.
@kocinski15 thanks for pointing this out, that is indeed incorrect. The bandwidth is in kHz for both SX127x and SX126x, so the resulting symbol time is in ms, hence the multiplication by 1000 in SX126x which is missing for SX127x. I pushed a fix addressing this.
I think the issue went unnoticed mostly because blocking mode is rarely used, since it does not offer any advantages over interrupts.