Skip to content

Conversation

@menschel
Copy link
Contributor

@menschel menschel commented Dec 21, 2024

This PR addresses Issue #3074 adding
Mavlink to Ardupilot Custom Telemetry CRSF translation for Yaapu Telemetry Lua script to work.

Tested on a 128x64 BW Radio:

  • Horizon Pitch Indication
  • Horizon Roll Indication
  • Horizon Compass Indication
  • Distance to Home Indication when home location was set, typically 6 Sats necessary.
  • Heading to Home when flying
  • Battery1 Voltage Indication
  • Battery1 Current Indication
  • Battery1 Capacity Indication (requires capacity override to be set by config)
  • GPS Number of Sats Indication
  • GPS Fix Indication
  • GPS HDOP Indication
  • Altitude MSL
  • Arming State Indication
  • Failsafe Indication
  • Control Mode Switching and Audio Indication (for Plane!)
  • Waypoint switching and Audio Indication
  • Control Mode Switching and Audio Indication ("Stabilize" for Copter)

Stuff that needs to be tested:

  • Functionality on Big Radios

Known Issue List:

  • When GPS Fix is lost, NO 2D is shown. It does seem to be an issue of the Yaapu script.
  • As by reports from testers, the big radios with color lcd seem to have problems for unknown reasons.

@menschel menschel marked this pull request as draft December 21, 2024 08:32
@menschel menschel force-pushed the pr-fix-ap-crsf-custom-telem branch from 1a46aa4 to 247729e Compare December 21, 2024 09:00
@menschel
Copy link
Contributor Author

menschel commented Dec 21, 2024

StatusText already works when cherry-pick'ed onto 3.5.3.
Note: Building the branch directly results in the branch name taken for version and consequently RX and TX don't bind.
The other message types will be handled in consecutive patches.

@menschel menschel force-pushed the pr-fix-ap-crsf-custom-telem branch from 98309e2 to 05b10f9 Compare December 21, 2024 17:03
@pkendall64
Copy link
Collaborator

Note: Building the branch directly results in the branch name taken for version and consequently RX and TX don't bind.

The master branch has a different OTA version and will not bind to a 3.x version. It's not to do with the branch name.

@menschel menschel force-pushed the pr-fix-ap-crsf-custom-telem branch from 05b10f9 to 9d76ad5 Compare December 21, 2024 20:35
@menschel
Copy link
Contributor Author

menschel commented Dec 21, 2024

Thanks for clarification, I just saw the name of my branch on the led display and thus assumed it was taken as version.

After some trial and error with the first value, endianess, shifting, ... , I think I'll divide the PR between ExpressLRS and Yaapu Script, as there are standard CRSF frames available for the values that Yaapu Script processes.

Means the frame grabbing
https://github.com/yaapu/FrskyTelemetryScript/blob/master/OTX_ETX/bw128x64/SRC/yaapu7.lua#L778
and the value extraction
https://github.com/yaapu/FrskyTelemetryScript/blob/master/OTX_ETX/bw128x64/SRC/yaapu7.lua#L640

It should be the same amount of work resulting in cleaner design.
As far as I see it, only the STATUS_TEXT is not available as a standard CRSF frame.

@menschel menschel force-pushed the pr-fix-ap-crsf-custom-telem branch 22 times, most recently from f0d5eb7 to 980dd72 Compare December 25, 2024 11:27
@ShreyFPV
Copy link

@raul-ortega any update on the performance of your setup?
I want to use mavlink with mission planner using Nomad Dual Xrossband ExpressLRS Module and XR4 receiver at K1000Hz packet rate. If anyone tested this setup, I really wanna know the performance you got and the range.

@raul-ortega
Copy link

@raul-ortega any update on the performance of your setup?
I want to use mavlink with mission planner using Nomad Dual Xrossband ExpressLRS Module and XR4 receiver at K1000Hz packet rate. If anyone tested this setup, I really wanna know the performance you got and the range.

Nothing, due to wheather conditions!

@menschel
Copy link
Contributor Author

menschel commented Mar 20, 2025 via email

@Allister779
Copy link

I've got a nomad module, a Quad-plane w/XR4 on AP4.6b4+, and quad w/DBR4 on AC4.5.7. Both on K1000. I'm willing to at least ground test this if it will help the cause. Please tell me what Git commit hash to use because I see a few bounced around here and I'm not sure what's best/safest. Or can I just build from the Git pull request?

@menschel
Copy link
Contributor Author

menschel commented Mar 26, 2025 via email

@Allister779
Copy link

I'm not familiar with Git commands so I first tried to use the Git Pull Request function in configurator to build for this PR. The build went okay for the nomad, but it wouldn't connect to any of my receivers (I didn't update them). Verified UID, etc. Admittedly didn't fight too long.

Next I used the commit hash for your latest commit in the test353 branch (940fb5) and let Configurator build it for me. That seemed to work. Again, only changed the nomad.

Good news, at least so far on the bench it's all working!
The Nomad is on build 940fb5 (TX16s Edge 2.10.2)
DBR4 is on 3.5.3 (AC4.5.7)
XR4 is on 3.5.2-pr3035 (AP4.6.0B4+ Tridge's test B5)

The yaapu script did crash on me once in all the excitment, but it was just the script. The radio and other telem pages still worked fine.

Any concerns about flying this configuration?

@menschel
Copy link
Contributor Author

menschel commented Mar 26, 2025 via email

@robustini
Copy link

robustini commented Mar 27, 2025

@Allister779 update EdgeTX to 2.16 and use the DEV version of Yaapu.
No crashes here for ages.
It is normal that if you use the branch indicated 353 and the current master you can't do the bind, there are differences.
Remember to flash the rxes as well.

@Allister779
Copy link

Got a chance to finally fly it today. On AC4.6 beta5, and EdgeTX 2.10.6 (Yaapu on Dev).

Good: It worked in flight.
Bad:

  • Yaapu crashed once before I took off. Error in refresh(): CPU Limit. Power cycled everything and it worked.
  • On both flights I got a voice warning "motors disarmed" followed quickly by "motors armed" and my flight mode. You'll excuse me for not looking down at the screen at that moment.... It only happened once per flight.
  • After the second flight the radio seemed to have totally locked up. Based on the messages on the screen everything was working until the point I landed and disarmed. I couldn't seem to do anything on the radio, none of the buttons did anything.

If you need any more info let me know.

@raul-ortega
Copy link

raul-ortega commented Apr 10, 2025 via email

@menschel
Copy link
Contributor Author

menschel commented Apr 11, 2025 via email

@Allister779
Copy link

Mine is a Mk1 Max. I can't remember when I got it, but it's got some good miles on it.

The sequence was just as you described, except one time rather than saying "Manual Flight Mode" it said "Position Hold".

I don't know about the RF Mode. I was less than 40m away each time it happened. When I did look down the only thing I noticed was my dynamic power was still down at 10mw so I'm assuming it was happy with the connection.

@menschel
Copy link
Contributor Author

menschel commented Apr 11, 2025 via email

@raul-ortega
Copy link

raul-ortega commented Apr 11, 2025

Mine was one of the firsts Radiomaster TX16S, without touch screen. This has been working for a long time, without any issues using yaapu lua script, working with CRSF protocol. Now I'm using K1000 and this is the first time I see this issue in the yaapu lua script.

This information is irrelevant: In my case I was not using dynamic power, TX was configure at 500mw and Rx at 100mw. SRx params were set by default by Mission Planner. I was flying at a very short distance, no more than 180 meters.

Some info about my setup:

  • Yaapu Telemetry Widget: 2.0.x dev (1997425)
  • Handset: Radiomaster TX16S
  • EdgeTX 2.10.5 (Centurion)
  • TX: Radiomaster Nomad TX 2.4/900Hz
  • RX: Radiomaster XR4
  • RF Band: 868 EU
  • TX Power: 500 mw
  • RX Power: 100 mw
  • Paket rate: K1000 Full(-101 dBm)
  • Telem ratio: 1:2(39891bps)
  • Switch mode: 16ch Rate/2.
  • Antenna mode: Gemini
  • Link mode: Mavlink
  • Flight Controller: Speedybee F405 Wing
  • Flight Firmware: Arduplane 4.4.4

@menschel
Copy link
Contributor Author

menschel commented Apr 11, 2025 via email

@Allister779
Copy link

I was on K1000 as well.

Just so I understand, are you in favor of the mLRS approach?

@menschel
Copy link
Contributor Author

menschel commented Apr 12, 2025 via email

@raul-ortega
Copy link

raul-ortega commented Apr 12, 2025 via email

@robustini
Copy link

robustini commented Apr 12, 2025

My RM Bandit Micro is supported but only as a SiK Radio

mLRS pre release v1.3.06: full support of RadioMaster Bandit, Bandit Micro, "big" Ranger and BetaFPV 1W Micro ELRS Tx modules
allows JrBay pin5 use, no limit to only SiK anymore.
Support of wireless bridge functionality (using the "backpack").

Instead, it seems to me that your module now would not work only as SiK.
I own both RadioMaster Ranger and BetaFPV 1W Micro, some testing I will definitely do if only out of curiosity.

@MUSTARDTIGERFPV
Copy link
Member

If ELRS project would drop the fixed package:telemetry
rate, it would yield equal performance. It is the bottleneck for MAVftp
operations for example.

This is absolutely something we want to support, but we can't with the packet format in 3.0 - we'll hope to get this possible in 4.0

handset->sendTelemetryToTX((uint8_t *)&crsfbatt);

// send the batt1 message to Yaapu Telemetry Script
ap_send_crsf_passthrough_single(0x5003, format_batt1(battery_status.voltages[0], battery_status.current_battery, battery_status.current_consumed));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity, why are you only passing one cell of battery info out of CRSF? Is this a part of the AP CRSF standard? The Yaapu script I'm using seems to expect all the cells, not just 1

* Helper function to send an ardupilot specific CRSF passthrough frame
* with a single data item appid is the function that produces the data.
*/
static void ap_send_crsf_passthrough_single(uint16_t appid, uint32_t data);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary duplicate line.

* Helper function to send an ardupilot specific CRSF passthrough frame
* with a text payload.
*/
static void ap_send_crsf_passthrough_text(const char *text, uint8_t severity);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary duplicate line.

* Helper function to send an ardupilot specific CRSF passthrough frame
* with 2 data item appid is the function that produces the data.
*/
static void ap_send_crsf_passthrough_multi(uint16_t appid, uint32_t data, uint16_t appid2, uint32_t data2);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary duplicate line.


CRSF::SetHeaderAndCrc((uint8_t *)&crsftext, CRSF_FRAMETYPE_ARDUPILOT_RESP, CRSF_FRAME_SIZE(sizeof(crsftext)), CRSF_ADDRESS_FLIGHT_CONTROLLER);
handset->sendTelemetryToTX((uint8_t *)&crsftext);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove blank line

// send the gps_status message to Yaapu Telemetry Script
ap_send_crsf_passthrough_single(0x5002, format_gps_status(gps_int.fix_type, gps_int.alt, gps_int.eph, gps_int.satellites_visible));


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One blank line is enough

for Yaapu Telemetry Lua script to work.

Uses CORDIC algo to calculate bearing
and distance to home.

Based on Ardupilot Code but reworked to integer operations.
@menschel menschel force-pushed the pr-fix-ap-crsf-custom-telem branch from 512dd07 to d37431a Compare April 23, 2025 06:47
@menschel
Copy link
Contributor Author

menschel commented Apr 23, 2025 via email

@menschel
Copy link
Contributor Author

menschel commented Apr 23, 2025 via email

@pkendall64 pkendall64 merged commit 4763c8a into ExpressLRS:master Apr 23, 2025
22 checks passed
@menschel menschel deleted the pr-fix-ap-crsf-custom-telem branch April 23, 2025 09:41
@edombek
Copy link

edombek commented Sep 6, 2025

This is not on 3.6.0 (((

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement 🪄 New feature or request V4.0 🍔

Projects

None yet

Development

Successfully merging this pull request may close these issues.