mstrens / expressLRS_relay

GNU General Public License v3.0
16 stars 1 forks source link

Telemetry with ELRS 3.3.x #3

Open Target0815 opened 1 year ago

Target0815 commented 1 year ago

Hi Michel,

I have tested the latest version (https://github.com/mstrens/expressLRS_relay/blob/test-without-wizio/Frsky_Elrs_Relay.uf2).

Relay operation with X9D+ => X8R => BetaFPV 2G4 TX with Firmware 3.3x

screen-2023-06-27-172338 screen-2023-06-27-172351 screen-2023-06-27-172403 screen-2023-06-27-172413 screen-2023-06-27-172425

Many "OC0?" values, implausible values like CURR etc.

X9D+ => BetaFPV 2G4 TX with Firmware 3.3x

screen-2023-06-27-173205 screen-2023-06-27-173214 screen-2023-06-27-173223 screen-2023-06-27-173234

With the TX module in the module slot, the telemetry info fits.

mstrens commented 1 year ago

I do not find directly the bug and I have no hardware to test it myself. So, I made some changes in order to add debugging messages. I put this new version on github. Could yo test it? To do so, please:

Your pc should now display 2 types of lines (when the chain FRsky TX - Frsky Rx - Relay - ELRS TX - ELSRS-RX - sensors is active): -one line should give the content of each telemetry frames received by the RP2040 from the ELRS Tx module

mstrens commented 1 year ago

I forgot to say that the new version is in the branch "test-without-wizio"

Target0815 commented 1 year ago

The test log:

relay_log.txt

mstrens commented 1 year ago

Thanks. I think I found the bug about the wrong value for the current. The fields with an ID like OCxx are fields that refers to the quality of the link between ELRS TX and ELRS RX. The relay get those data from ELRS but there is no predefined Frsky fields to transmit them over Sport. So I created special codes for them. Here the list:

define UPLINK_RSSI_1_ID 0x0c00 // to check if this range is valid

define UPLINK_RSSI_2_ID 0x0c01

define UPLINK_LINK_QUALITY_ID 0x0c02

define UPLINK_SNR_ID 0x0c03

define ACTIVE_ANTENNA_ID 0x0c04

define RF_MODE_ID 0x0c05

define UPLINK_TX_POWER_ID 0x0c06

define DOWNLINK_RSSI_ID 0x0c07

define DOWNLINK_LINK_QUALITY_ID 0x0c08

define DOWNLINK_SNR_ID 0x0c09

Those codes does not have predefined name but I think that you can assign them a meaningful name in openTx/edge once they are discovered.

There are 2 other fields that ELRS transmit but that do no exist in Sport protocol. It is Number of sat and Capacity. Those 2 fields are put in frsky standard Temp1 and Temp2.

I put a new version on github (test-without-wizio branch). This version still contains the debug messages as in previous version. Let me know if it is OK and I can make a version where I remove those debug messages.

Target0815 commented 1 year ago

Thanks!

I will do another test later.

Target0815 commented 1 year ago

I think I found the bug about the wrong value for the current.

No. Currently 70A are displayed, although it may be 700 mA. But I still have to measure or look at the OSD on the FC.

Those codes does not have predefined name but I think that you can assign them a meaningful name in openTx/edge once they are discovered.

There are 2 other fields that ELRS transmit but that do no exist in Sport protocol. It is Number of sat and Capacity. Those 2 fields are put in frsky standard Temp1 and Temp2.

Almost all data fields are defined in the FrSky Passthrough protocol ... no need for crutches like Tmp1/2. Have a look there: S.Port Passthrough protocol specs: https://docs.google.com/spreadsheets/d/1oFv5zSl10wyR0LOcCChDdy9peIRNkbaEBrsHDQ0ZdmE/edit#gid=0

Passthrough over CRSF: https://github.com/yaapu/FrskyTelemetryScript/wiki/Passthrough-over-CRSF-and-ExpressLRS

I will do further tests later to see if the values are correct ...

Target0815 commented 1 year ago

This already looks quite good ...

GSpd is given in kts, should be km/h Curr is 70A, in reality only 0,7A

Questions: Tmp2 = Capacity = the capacity of the battery? I have here 12 as value, but can't assign it

0C00 to 0C09: UPLINK* = Relay => Plane, DOWNLINK* = Relay => Handset?

mstrens commented 1 year ago

I do not know how you analyse the data. When I look at the specification of Sport, it seems that:

Target0815 commented 1 year ago

I do not know how you analyse the data.

I take the ELRS TX I use for the relay and put it directly into the transmitter and re-read the telemetry. The FC and the ELRS RX in the plane are always the same.

So I can compare very well which telemetry data is delivered via ELRS CRSF and what your converter makes out of it. And there you can see that Curr can't be right.

If I understood correctly, you don't have an ELRS system for testing? May I donate one to you, so that you do not have to handle the data blindly?

mstrens commented 1 year ago

Thanks for testing. The way you use is for sure the best one. I checked the doc of EdgeTx once more and I saw that in Sport Current is in 0.1A (and not in 0.001A as I expected). So, there is no reason to multiply by 100 in the relay project. I made the change in a new version I put on github now.

I got once an ELRS system that I used when I developed the code. In the mean time, I does not have it anymore for testing. So currently I make blind tests and corrections. I also do not have a flight controller to get data. Usually I use only Frsky system (RX8) with openXsensor to get telemetry data. I am flying only F5J gliders.

About S.Port Passthrough protocol I would have to look further more to the specs. It is not yet 100% clear for me.

Target0815 commented 1 year ago

So currently I make blind tests and corrections. I also do not have a flight controller to get data.

I consider the condition unsatisfactory ... I can provide you with ELRS TX and RX as well as a flight controller with ArduPlane, or donate the equivalent value. You just have to tell me how you want it.

About S.Port Passthrough protocol I would have to look further more to the specs. It is not yet 100% clear for me.

Alessandro can explain this to you in detail: https://github.com/yaapu I am only a user but very satisfied.