Closed aowi7280 closed 1 year ago
Are you using wide channels on ELRS? The power is not sent to the receiver if you don’t have wide channels set.
Using hybrid.
Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Tom Alperin @.> Sent: Wednesday, January 25, 2023 9:13:10 AM To: betaflight/betaflight @.> Cc: aowi7280 @.>; Author @.> Subject: Re: [betaflight/betaflight] BF 4.4.0 RC4 & RC5 ELRS dynamic power always reads 0mW on OSD (Issue #12205)
Are you using wide channels on ELRS? The power is not sent to the receiver if you don’t have wide channels set.
— Reply to this email directly, view it on GitHubhttps://github.com/betaflight/betaflight/issues/12205#issuecomment-1403863300, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AF7XKG4YDKIVB33YY4X4XF3WUFGJNANCNFSM6AAAAAAT5PFJXA. You are receiving this because you authored the thread.Message ID: @.***>
But it comes to the radio. I can see it on the display, just not on the OSD.
Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Andrew Henrichs @.> Sent: Wednesday, January 25, 2023 9:39:32 AM To: betaflight/betaflight @.> Subject: Re: [betaflight/betaflight] BF 4.4.0 RC4 & RC5 ELRS dynamic power always reads 0mW on OSD (Issue #12205)
Using hybrid.
Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Tom Alperin @.> Sent: Wednesday, January 25, 2023 9:13:10 AM To: betaflight/betaflight @.> Cc: aowi7280 @.>; Author @.> Subject: Re: [betaflight/betaflight] BF 4.4.0 RC4 & RC5 ELRS dynamic power always reads 0mW on OSD (Issue #12205)
Are you using wide channels on ELRS? The power is not sent to the receiver if you don’t have wide channels set.
— Reply to this email directly, view it on GitHubhttps://github.com/betaflight/betaflight/issues/12205#issuecomment-1403863300, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AF7XKG4YDKIVB33YY4X4XF3WUFGJNANCNFSM6AAAAAAT5PFJXA. You are receiving this because you authored the thread.Message ID: @.***>
@aowi7280 In CLI tab try set expresslrs_switch_mode = WIDE
and save
.
(Using CLI you can use the Submit Support Data
button. Please insert the ID
here).
/**
* HybridWide switches decoding of over the air data
*
* Hybrid switches uses 10 bits for each analog channel,
* 1 bits for the low latency switch[0]
* 6 or 7 bits for the round-robin switch
* 1 bit for the TelemetryStatus, which may be in every packet or just idx 7
* depending on TelemetryRatio
*
* Output: crsf.PackedRCdataOut, crsf.LinkStatistics.uplink_TX_Power
* Returns: TelemetryStatus bit
*/
static void unpackChannelDataHybridWide(uint16_t *rcData, volatile elrsOtaPacket_t const * const otaPktPtr)
{
unpackAnalogChannelData(rcData, otaPktPtr);
const uint8_t switchByte = otaPktPtr->rc.switches;
// The round-robin switch, 6-7 bits with the switch index implied by the nonce. Some logic moved to processRFPacket
if (wideSwitchIndex >= 7) {
txPower = switchByte & 0x3F;
} else {
uint8_t bins;
uint16_t switchValue;
if (currTlmDenom < 8) {
bins = 63;
switchValue = switchByte & 0x3F; // 6-bit
} else {
bins = 127;
switchValue = switchByte & 0x7F; // 7-bit
}
rcData[5 + wideSwitchIndex] = convertSwitchNb(switchValue, bins);
}
setRssiChannelData(rcData);
}
Is called from
void expressLrsSetRcDataFromPayload(uint16_t *rcData, const uint8_t *payload)
{
if (rcData && payload) {
volatile elrsOtaPacket_t * const otaPktPtr = (elrsOtaPacket_t * const) payload;
rxExpressLrsSpiConfig()->switchMode == SM_WIDE ? unpackChannelDataHybridWide(rcData, otaPktPtr) : unpackChannelDataHybridSwitch8(rcData, otaPktPtr);
}
}
In HYBRID mode we call
/**
* Hybrid switches uses 10 bits for each analog channel,
* 2 bits for the low latency switch[0]
* 3 bits for the round-robin switch index and 2 bits for the value
* 4 analog channels, 1 low latency switch and round robin switch data = 47 bits (1 free)
*
* sets telemetry status bit
*/
static void unpackChannelDataHybridSwitch8(uint16_t *rcData, volatile elrsOtaPacket_t const * const otaPktPtr)
{
unpackAnalogChannelData(rcData, otaPktPtr);
const uint8_t switchByte = otaPktPtr->rc.switches;
// The round-robin switch, switchIndex is actually index-1
// to leave the low bit open for switch 7 (sent as 0b11x)
// where x is the high bit of switch 7
uint8_t switchIndex = (switchByte & 0x38) >> 3;
if (switchIndex >= 6) {
// Because AUX1 (index 0) is the low latency switch, the low bit
// of the switchIndex can be used as data, and arrives as index "6"
rcData[11] = convertSwitchNb(switchByte & 0x0F, 15); //4-bit
} else {
rcData[5 + switchIndex] = convertSwitch3b(switchByte & 0x07);
}
setRssiChannelData(rcData);
}
But it comes to the radio. I can see it on the display, just not on the OSD. Get Outlook for Androidhttps://aka.ms/AAb9ysg …
The value originates at the transmitter module, not the receiver. If you use hybrid channels, it’s in the telemetry coming from the module but it does not get sent to the receiver.
@TomAlperin OK, I get that. The OSD shows the Tx power in wide mode. What is the downside of using wide versus hybrid? I am flying a quad, using standard telemetry rate. I don't see much difference (by looking at how often the * comes through in the Telemetry screen). Is it going to affect my packet rate (200Hz) or the rate telemetry comes back (1:64)? As an add on question, If I delete unused sensors from the telemetry, will that speed anything up? I appreciate all the work you guys do. Its pretty cool. @haslinghuis 23f20e15-2b10-46dc-bf1b-5a3e9854bf45 The set expresslrs_switch_mode = WIDE came back with an error message.
Using CRSF protocol and telemetry Seems not enough.
We need to add RX_EXPRESSLRS RX_EXPRESSLRS_TELEMETRY
to custom defines to be able to use that.
@aowi7280 please check
@aowi7280 you now can choose ERLS (SERIAL) as Radio Protocol. Please check.
OK, I finally figured it out. I set ExpressLRS as radio protocol with no custom defines. But It does not seem to behave any differently. I still have to set it to Wide in the ELRS lua. So I don't know what this does in the CLI.
expresslrs_switch_mode = WIDE Allowed values: WIDE, HYBRID
BTW, I get this error when reloading my backup configuration.
Yes thank you for reporting. This issue made us change radio protocol options to include WIDE option to be available for UART ELRS users as it's encoded in the SPI part of the code.
To enable you have to set expresslrs_switch_mode = WIDE
and save & reboot.
OSD should now display TX Power.
I am using UART ELRS and the Tx power was displayed before. I just had to set to wide in the ELRS lua. I don't see any difference in the betaflight function.
Difference is we are forced to removed features from firmware for ongoing development due to firmware overflow issues as radio protocol, options and motor protocols together with custom defines is a means to configure your build with the options you need.
I am using UART ELRS and the Tx power was displayed before. I just had to set to wide in the ELRS lua. I don't see any difference in the betaflight function.
Setting wide mode in ELRS Lua enables ELRS to pack the TX power telemetry item into the packets being sent to the RX and on to Betaflight.
Using the ELRS (SERIAL)
build option includes the ELRS drivers in the build, which enables Betaflight to pick the TX power telemetry out of the packets and make it available to the OSD.
The ELRS drivers used to be included with the CRSF
option (or by default in some targets), but has been trimmed back, that's why it used to work with just the CRSF
build option. Now we need to use ELRS (SERIAL)
to get the drivers, and apparently set expresslrs_switch_mode = WIDE
to turn on wide mode parsing. This setting is default for all the targets I'm using, so I haven't needed to set it myself and haven't tried setting it to something else to verify it's needed (too lazy).
Thanks, I appreciate all the info. and fixing the issues.
Yes thank you for reporting. This issue made us change radio protocol options to include WIDE option to be available for UART ELRS users as it's encoded in the SPI part of the code.
To enable you have to
set expresslrs_switch_mode = WIDE
and save & reboot.OSD should now display TX Power.
Thanks for this information. I believe that expresslrs_switch_mode
setting in BetaFlight and controller's (Lua script) "Switch Mode" value should be in sync?
Also in my case “Tx uplink power” OSD option started to work only when I set both settings to "Wide" (telemetry ratio is 1:4). "Hybrid" does not work for some reason 😪 (ELRS protocol limitations?)
Would it be also useful to add any information about the expresslrs_switch_mode
setting in “Tx uplink power” OSD option popup hint?
Describe the bug
No dynamic power reading on the OSD (analog). Using latest ELRS and Dyn power. I selected Vx uplink power to show on the OSD, but it always shows 0mW. The correct power shows on myQX7 Tx screen and changes correctly, so the telemetry is coming back for TPW2. Same problem in BF 4.3.2
To Reproduce
Flash, set OSD to show Tx uplink power. connect battery.
Expected behavior
Correct Vtx power shows on analog OSD
Support ID
Diff configuration
Resources configuration
Flight controller
Airbot OmnibusF4SD F405
Other components
FC: Airbot OmnibusF4SD F405 Tx: Frsky QX7 w_HappyModel 915MHz ES900TX ExpressLRS V3.1.2 Rx: R9MM w/ExpressLRS V3.1.2 Vtx: RDQ Mach 3 25-1000mW
How are the different components wired up
No response
Add any other context about the problem that you think might be relevant here
No response