Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About tx failed #104

Open
JenkinTu opened this issue Apr 29, 2023 · 3 comments
Open

About tx failed #104

JenkinTu opened this issue Apr 29, 2023 · 3 comments

Comments

@JenkinTu
Copy link

SX1302 has certain propability less than 10% failed to tx packets. As the following log, the packet should be transmitted when 9:18:11, but it had been replaced by the packet should be transmitted when 9:18:22. This packet had been written into SX1302 registers ahead of 38ms before transmission. Why hadn't this packet been transmitted?


4-29 9:18:10 [/usrdata/log/pktfwd] INF thread_down:3219 JSON down: {"txpk":{"imme":false,"rfch":0,"powe":17,"ant":0,"brd":0,"tmst":3624665456,"freq":475.5,"modu":"LORA","datr":"SF7BW125","codr":"4/5","ipol":true,"size":25,"data":"YDQAACSA+U8CytoOJOBBIHsN/Eyouzmo8w=="}}
4-29 9:18:11 [/usrdata/log/pktfwd] INF thread_jit:3764 lgw_send done on rf_chain 0: count_us=3624665456, contractor_time= 3624627141
...

4-29 9:18:22 [/usrdata/log/pktfwd] INF thread_down:3219 JSON down: {"txpk":{"imme":false,"rfch":0,"powe":17,"ant":0,"brd":0,"tmst":3636165503,"freq":476.7,"modu":"LORA","datr":"SF7BW125","codr":"4/5","ipol":true,"size":25,"data":"YCAAACSAGFUC9QccIlsmFO2gTAba26fXSQ=="}}
4-29 9:18:22 [/usrdata/log/pktfwd] INF thread_jit:3737 WARNING: a downlink was already scheduled on rf_chain 0, overwritting it...
4-29 9:18:22 [/usrdata/log/pktfwd] INF print_tx_status:3674 INFO: [jit] lgw_status returned TX_SCHEDULED
4-29 9:18:22 [/usrdata/log/pktfwd] INF thread_jit:3764 lgw_send done on rf_chain 0: count_us=3636165503, contractor_time= 3636126593
......

@mcoracin
Copy link
Contributor

mcoracin commented May 2, 2023

If the packet has not been transmitted, it is probably because it has not been programmed in the sx1302 tx buffer fast enough.
I'm surprised that you dodn't get an error from the JIT mechanism of the packet forwarder, because the minimum TX delay is set to 40ms.

#define TX_JIT_DELAY 40000 /* Pre-delay to program packet for TX in microseconds */

Anyway with 38ms, you are very close from the limit we have set.

Which LoRaWAN Network Server are you using ? The TX request should arrive sooner than this.

@JenkinTu
Copy link
Author

JenkinTu commented May 3, 2023

We are using ChirpStack. The TX packet had already been sent from ChirpStack to gateway, and properly been enqueued into jit queue.
Ahead of 38ms the TX packet had been written into SX1302 tx buffer before transmission. Should we use TX_JIT_DELAY some bigger value than 40ms?

if ((queue->nodes[idx_highest_priority].pkt.count_us - time_us) < TX_JIT_DELAY) {
*pkt_idx = idx_highest_priority;
MSG_DEBUG(DEBUG_JIT, "peek packet with count_us=%u at index %d\n",
queue->nodes[idx_highest_priority].pkt.count_us, idx_highest_priority);
} else {
*pkt_idx = -1;
}

@mcoracin
Copy link
Contributor

mcoracin commented May 3, 2023

Yes, you can try to increase the TX_JIT_DELAY to better match with your system latencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants