Prevent going to 1:2 ratio when disconnected and entering Lua#1092
Merged
JyeSmith merged 5 commits intoExpressLRS:2.0.x-maintenancefrom Nov 12, 2021
Merged
Prevent going to 1:2 ratio when disconnected and entering Lua#1092JyeSmith merged 5 commits intoExpressLRS:2.0.x-maintenancefrom
JyeSmith merged 5 commits intoExpressLRS:2.0.x-maintenancefrom
Conversation
pkendall64
approved these changes
Nov 11, 2021
schugabe
approved these changes
Nov 11, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Block sending DEVICE_PING messages OTA when not connected. This prevents the TX from going to telemetry boost mode (1:2) on entering Lua and confusing users with OLED display. The operative flag is the
CRSF::ForwardDevicePingsmember.Details
Users with the OLED display that actually shows what TLM ratio the TX is actually running at are a bit confused when they configure the TX to be at 1:128 (or any ratio, including Off) and seeing that the OLED is showing the TX is in 1:2 mode. The issue is that when the user enters the Lua, a DEVICE_PING is queued to see what other connected devices are out there. In normal operation this is fine, but when disconnected the TX will stay in 1:2 mode until a receiver connects and the PING is able to be forwarded.
However, there are circumstances when we want to go into 1:2 mode even when disconnected. This allows BF.lua and SendVTX to work even when TLM Ratio is set to Off. A receiver is out there, the user has just elected to prevent us from knowing it is out there and switching to 1:2 will create the bidirectional tunnel we need to transfer MSP packets.
Therefore, DEVICE_PING is unique in that it is not sent by user request and thus the confusion about why the radio is in 1:2. This PR modifies the TX behavior so that DEVICE_PINGs are not queued if disconnected. Wow. That's the longest PR details I've ever had before I got to what the actual PR is about.
Other Fixes
currentOffsetat the end of receiving the MSP transfer). The receiving side always ignored the extra bytes. I've modified the code to only send as much MSP data as we have, 10 bytes for DEVICE_PING, 15 for BF.lua Init, etc. You'd think this would result in a massive speed boost especially at 50Hz where max MSP bandwidth is 62.5 bytes/sec, but it is barely noticeable in practice as I switched back and forth between the two transfer lengths. In any case this increases our upstream MSP bandwidth significantly (400%-600%).