Use hardware channel activity detection for checking interference#1727
Use hardware channel activity detection for checking interference#1727weebl2000 wants to merge 4 commits intomeshcore-dev:devfrom
Conversation
|
Ok now this is very interesting. My house has LOS to 4 high level repeaters. I'll test this when I get back from work and see what happens. reminds me of busy channel lockout in shared 2 way radio repeaters back in the day before LTR / trunking. Could be onto something here for sure. |
214a0a0 to
bc39bcc
Compare
75da5d5 to
8bd55b6
Compare
581e805 to
40ab8ea
Compare
|
I like your implementation. :-) Using hardware CAD instead of the broken RSSI approach is the right direction. One concern: repurposing interference_threshold as the CAD enable flag is a code smell. The field originally carried a numeric RSSI threshold, now it's overloaded as a boolean for a different feature. A threshold of 50 and 1 mean the same thing, which is surprising. Given that RSSI-based detection is effectively dead code at this point, why not just remove interference_threshold entirely and enable CAD unconditionally? That would simplify the config, eliminate the semantic confusion, and make the intent clear. |
|
Isn't this very like CSMA/CD, like on classic Ethernet? Or CSMA/CA, if a pre-calculated timer is used per node? |
40ab8ea to
acbc02f
Compare
|
Its running here. First feelings in a busy mesh is that access my repeater is smooth, also send a message in public is running smooth. I will try it longer and see if it stay the same Day 2 and still happy with this patch add to 1.14.1 |
acbc02f to
d7087bc
Compare
|
Thank you very much for implementing CAD! I tested simultaneous 2-node DM — sharing results & observations Test environment: ---Baseline (CAD disabled, default): Test 1-char DM, one-way 150-char DM, one-way 1-char channel msg, one-way 1-char channel msg, simultaneous 1-char DM, simultaneous 150-char DM, simultaneous ---With CAD enabled (this PR): Test 1-char DM, simultaneous (run 1) 1-char DM, simultaneous (run 2) 150-char DM, simultaneous (run 1) 150-char DM, simultaneous (run 2) Observations: CAD clearly helps for short messages. 1-char simultaneous DM improved dramatically — one side gets through quickly (~5s) while the other waits and eventually delivers (~27-52s). 150-char simultaneous DM fails consistently. The retry pattern is: 4 retries at ~1min 5sec intervals via direct path, then 5th retry switches to flood path. The flood path switch appears to make things worse, not better — both nodes fail at ~7min. Flood path collision. When direct path fails and falls back to flood, both nodes flood simultaneously — same collision pattern observed in channel message simultaneous test (never delivered). Suggestion: Adding a small random backoff (e.g. 0-500ms) before each retry attempt would break the synchronized collision loop. This is especially important for multi-packet messages where collision opportunities multiply with each packet fragment. Thank you for reading! |
Following up on the suggestion above about random backoff — I implemented it and tested with Japan LoRa settings (SF12/BW125/CR4/8). Long random backoff (8000-22000ms) when channel is busy These values are likely too large for US/EU regions with faster LoRa settings. But for Japan SF12, backoff must exceed single message air time to break the collision loop. |
|
Yeah, it seems to perform worse on long messages with this PR to me. We have a dense mesh at SF7, 62,5 kHz here, with lots of in-band noise from telemetry and whatnot. |
|
Every 6 to 12 hours over a three-day period, I divided the received packets on corrupted. The correlation is linear and evens out over time. Standard "int.thresh 6" based on RSSI, showed a received/damaged ratio of 5.8–6. With new "hardware" measurement system, the ratio was 3.7–4. I performed measurements on the same node and antenna. I don’t know if damaged packet ratio is a good indicator of how well the int.thresh function works, but my observations show that the RSSI measurement works better. |
d7087bc to
dc9e6ae
Compare
|
Updating my earlier comments in light of subsequent work. After testing CAD + random backoff (reported above), I went further and Key findings comparing the two approaches: CAD (this PR)
RSSI-based LBT (PR #2218 approach)
Note: the 150-char simultaneous DM result (91% success) reported in my @YSOFF's observation (RSSI ratio 5.8–6 vs CAD 3.7–4 favoring RSSI) is For Japan regulatory mode, I ended up removing CAD entirely — RSSI alone Jitter (0–500ms on free channel detection) prevents two nodes that For DMs, the picture is more nuanced. Direct DMs with a known path make Finally, the ACK timeout retry interval itself is not randomized — nodes |
Using RSSI isn't very reliable (it's disabled in the code for a reason). We might try hw channel activity detection. Since we are gonna TX anyway it shouldn't be too bad to listen for a few milliseconds first. Worst case we see there is a transmission and we wait a little while. Alternative is that we just TX anyway and intefere with others causing transmission collisions.
Would be great if people could test this on their repeaters & companions and see if TX becomes more reliable.
You can build firmware for you device using https://mcimages.weebl.me?commitId=use-hardware-channel-activity-detection
First impressions after flashing this on one of my repeaters that is high up & exposed to a lot of other repeaters is that it responds a little more consistently. Sometimes it's snappier, but often times it's slightly slower but it fails way less. I.e. less failed status requests & non-answered commands.