ExpressLRS / ExpressLRS

STM32/ESP32/ESP8285-based High-Performance Radio Link for RC applications
GNU General Public License v3.0
3.38k stars 795 forks source link

ELRS 3.4.x not switching diversity antenna correctly...? #2815

Open AxelRed65 opened 3 days ago

AxelRed65 commented 3 days ago

Current Behavior

I have a BetaFPV Super D receiver 2.4 GHz, using it in Diversity mode. It appears the receiver always locks on Radio/Antenna 2 and never switches to the other antenna, whatever the level is ( the indication shows even full red -120 on the display )... If I revert back to ELRS version 3.3.2 the Antenna/Radio switching performs flawless

Steps to Reproduce

I have a drone with 2 horizontal dipoles oriented each one perpendicular to the other... On the radio I get back the RX received RSSI's, RSNR, ANT telemetries shown on a LUA page, also on Googles OSD I get the used radio and its RSSI value...

How to reproduce :

1) On the field, I fly the drone about 500-1000 meters from the radio, hover there and slowly yaw the drone 360° in place, so that both antennas get cross oriented with the radio in turn. On radio and OSD, the antenna indications remain always stuck on Receiver 2 ( sometime it flashes to receiver 1 for few tenths of a second ). Even if stopping the rotation to have antenna 2 the worst position in respect to the radio, nothing changes, it never switches to antenna 1. Reverting to ELRS 3.3.2, same place, same distance, during the rotation I can clearly see the indications of the receiver switching to the better oriented antenna, and the antenna 1 level is well above -60/50 dBm, so, no way that with 3.4.x it should have not switched antenna.

2) In the Lab, I am able to place the Radio ( Jumper T20S ) near under the drone in a way that the drone antenna aligned with the radio saturates, giving out a value around -120dBm, while the other one gets a good level ( about -10/-20 )... Orienting the radio correctly I can see the saturation of a single antenna while the other has a good signal, but the reported 'ANT' telemetry parameter is stuck to '1' ( Receiver 2 ), whichever antenna is receiving a good signal. This happens also on the Reported values on the OSD, with a '-120:2' red blinking RSSI value. If I revert to ELRS 3.3.2 I can clearly see the receiver switching to the unsaturated antenna, both on the Radio and on the OSD

Possible Solution (Not obligatory)

Check if this is really a bug, or some new feature I found nothing about... Could also be a wrong reported telemetry indication?

Details

The ELRS FW is always uploaded by ExpressLRS configurator via Passthrough or WiFi using 3.4.0, 3.4.2, 3.4.3 and 3.3.2 release versions. All versions >= 3.4.0 have the reported issue.

Your Environment

mha1 commented 3 days ago

This is not a bug, it's a feature.

3.4 changed the the meaning of ANT for true diversity (two independent receiver paths - radios). If a radio was successful in receiving and decoding an incoming OTA packet it pulls its dedicated interrupt line to tell the processor a packet is ready for further processing. If both radios were able to receive and decode the packet both will pull their interrupt lines. The higher priority radio will be used for further processing, the lower priority radio will be discarded. On the SuperP and SuperD radio2 (ANT1) is the higher priority radio.

With having the priorities in mind there are 4 cases: Both Radio1 and Radio2 were successful -> the higher priority radio's packet (Radio2) will be used -> ANT1 will be reported Only Radio1 was successful -> Radio1's packet will be used -> ANT0 will be reported Only Radio2 was successful -> Radio2's packet will be used -> ANT1 will be reported no radio was successful -> no packet is available -> ANT1 will be reported

So you'll see ANT1 most of the times, ANT0 only if Radio1 was the only successful radio

Takeaway:

see https://github.com/ExpressLRS/ExpressLRS/pull/2622

AxelRed65 commented 2 days ago

Thanks for the explanation, but, IMHO there may be a problem, at least with BF 4.5, flying LR FPV... What I get on the OSD ( Walksnail HD ) is the reported RSSI of Antenna 2 till it gets at least one valid packet, even if its RSSI level is very low, may be even red flashing... If I need to judge the level of RF reception reported by the drone via OSD, to check if I am reaching a too far low level, how could I...? In my Lab test ( and on the field ), it reports me always the RSSI Level of radio 2, and if I have only that value, how could I judge if I am reaching my real RF limit ( in diversity mode I mean )...? If I accept a so low RSSI from radio 2 and fly away waiting for Radio 1 and its RSSI to show up, I can not be sure if also Radio 1 is in the same situation as Radio 2, or it may be receiving a good signal... I think the shown RSSI at least on the OSD should be the better one, so that someone can judge the signal margin it still has, whichever radio is receiving the packets, especially in LR, where you can reach very low RSSI Levels and need to take care of them... Not sure however if this may depend on ELRS or BF... Sorry to bother you with my doubts...

pkendall64 commented 2 days ago

You say it should be the showing the better RSSI, other pilots say it should be the worse RSSI because they don't want to lose their craft. They would rather be safe than sorry. Ideally BF would allow the display of both RSSI values, then the user can make a fully informed decision.

AxelRed65 commented 2 days ago

Don't keep me wrong, I see the point in seeing the worst RSSI, and I would not object to it, even worst RSSI would be fine... My point is that you are not looking at best or worst RSSI here, you are looking at the RSSI of Radio 2 ( in this case ) if both radios receive a packet, whatever its level is, worst or best... Just to be clear, I am no one here, and I do not want to discuss about this feature, if this choice has been done I think it comes from already done discussions and evaluations in the ELRS group... I was looking into why the radio switching indication was behaving that way, as coming from ELRS release 3.3.x I started thinking that one of the radios of the Super D was having reception problems...

AxelRed65 commented 2 days ago

@mha1

About this

  • ANT should have 4 states to reflect what's going on but this would confuse even more users (what? I don't see 4 antennas)

Well, why not make the antenna indicator kinda like a 'ranking indicator'...?

'2' means full mode, both radios linked, and then show worst RSSI on OSD, so that one can then judge the signal distance to degraded mode...

'1' Degraded mode, only one radio is receiving packets, show the receiving radio RSSI on OSD, and you are warned that you are already in a non safe state, and you have numbers to decide what to do...

'0' ...FUBAR...

This would also respect the rule 'better safe than sorry', by pilot informed choice....

Just an idea...

mha1 commented 2 days ago

Regardless of content one more precious Link Stats Bit will be required. I don't know off hand if that'd lead to spending another byte. My request was frowned upon some time ago.