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

Initial implementation of MSP RC stats and info messages #10451

Merged
merged 23 commits into from
Nov 10, 2024

Conversation

MrD-RC
Copy link
Collaborator

@MrD-RC MrD-RC commented Nov 3, 2024

This work is to kick off the changes asked for in #10363

Requires configurator iNavFlight/inav-configurator#2230

We are adding two new common MSP V2 messages:

  • MSP2_COMMON_SET_MSP_RC_LINK_STATS 0x100D
  • MSP2_COMMON_SET_MSP_RC_INFO 0x100E

They are called to update the firmware of changes on the MSP RC receiver/transceiver. MSP2_COMMON_SET_MSP_RC_LINK_STATS is sent with every packet and MSP2_COMMON_SET_MSP_RC_INFO is sent periodically and when changes are made. Payload size checking has been set so that the payload must at least meet the current defined payload. Future updates to payload would need to be accounted for in updated versions of INAV. But at least, this base data will still be able to be processed.

MSP2_COMMON_SET_MSP_RC_LINK_STATS

Parameter Size (Bytes) Datatype Min Max Units Notes
Sublink ID 1 uint8 0 7 Used to distinguish particular antennae or transceiver chips on the module
Valid Link 1 uint8 0 1 Used to show if the module has a valid link or is in failsafe
RSSI % 1 uint8 0 100 The RSSI as a 0-100%
Uplink RSSI dB 1 uint8 0 127 dBm The RSSI in dBm. The value is inverted, so always reads negative or 0. Set to 127 if not used.
Downlink LQ 1 uint8 0 100 LQ for the downlink
Uplink LQ 1 uint8 0 100 LQ for the uplink
Uplink SNR 1 int8 -128 127 dB SNR for the uplink

MSP2_COMMON_SET_MSP_RC_INFO

Parameter Size (Bytes) Datatype Min Max Units Notes
Sublink ID 1 uint8 0 7 Used to distinguish particular antennae or transceiver chips on the module
Uplink TX Power 2 uint16 0 mW Uplink power in mW
Downlink TX Power 2 uint16 0 mW Downlink power in mW
Band 4 char[] Band - For example: 868M, 915M, 2.4G, DUAL
Mode 6 char[] Mode - For example: 19Hz, 31Hz, 50Hz. FSK, FLRC, 150Hz, F333Hz, 1000Hz

Changes

  • Added MSP commands to store the data from the transceiver
  • Added missing OSD elements
  • Opened up OSD elements that were previously only used by CRSF
  • Added downlink LQ and uplink RSSI to the programming framework

Limitations of current implementation

Due to time constraints. This initial implementation is not a full implementation.

  • Currently, only sublink ID 0 will store any data. This will need expanding to allow for up to 8 sublinks.
  • Failsafe in the link stats is not used. There is already a failsafe defined in MSP OVERRIDE. We should look at the options and decide the best route to take with this.
  • There are no current OSD elements (I will try to add these before the 15th of November deadline) for:
    • Downlink LQ
    • Downlink TX Power
    • Band
    • Mode
  • RSSI %, Uplink RSSI, Uplink LQ, Uplink SNR, and Uplink TX Power work with already existing OSD elements. Some are only active when CRSF is selected. So a change will need to be made to open these up for other systems.

This is an initial, basic implementation. This can be expanded in the future to deal with multiple sublinks etc.
- Add RSSI
- Allow extended versions of future MSP2_COMMON_SET_MSP_RC_LINK_STATS and MSP2_COMMON_SET_MSP_RC_INFO still work with older (from now) INAV versions. Except for the new data.
- Set base sublink ID to 0
- changed RSSI dB to uint8 as 16 is not needed
- Added constraint to ensure that RSSI % is between 0 and 100
@MrD-RC MrD-RC added this to the 8.0 milestone Nov 3, 2024
@MrD-RC MrD-RC marked this pull request as ready for review November 3, 2024 19:53
- Added new RX operands to programming framework
- Added new OSD elements
- Updated CRSF elements that are no longer exclusive to CRSF
@MrD-RC MrD-RC marked this pull request as ready for review November 5, 2024 20:58
- Force band and mode to uppercase
- Fix bug with band and mode not finalising the string output to the OSD
- Changed RSSI dBm and SNR display outputs slightly. So that the OSD is more consistent
- Show mW symbol for power elements when no data is present. Again, more consistency and doesn't make people wonder why the elements are not showing up.
@b14ckyy
Copy link
Collaborator

b14ckyy commented Nov 9, 2024

Happy on my end. All elements work. Logic triggers also tested and work as intended. Digital fonts will need an Update but if not updated, just 2 icons missing. String text for Mode and Band is clear and up to the RC Link Developer.

image
image
image
image

@MrD-RC MrD-RC requested a review from mmosca November 9, 2024 13:05
@MrD-RC MrD-RC merged commit ef35225 into master Nov 10, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants