Frsky telemetry from iNav - mAh values not correct

ersky9xr is the port of the er9x firmware to the 9XRPRO radio.
Post Reply
rsilk49
Posts: 140
Joined: Wed Oct 26, 2016 10:33 am
Country: United Kingdom

Frsky telemetry from iNav - mAh values not correct

Post by rsilk49 »

I have recently installed a Matek 411-WSE in a sub 250gm wing which necessitated using iNav.
I am able to view most of the FC telemetry by setting the Telemetry protocol to Frsky, but the mAh values are way out and the refresh interval seems wrong too.
I tried clearing and adding the mAh sensor on the sensors page but again got weird numbers.
I am comparing the values with a Smartport telemetry viewer app (see attached screenshots).
Attachments
Screenshot_20200202_143435_crazydude.com.telemetry.jpg
IMG_20200202_150842.jpg
IMG_20200202_151145.jpg
S500 + Pixhawk 1 clone + Mauch PM + C&T Telemetry adapter + 9XR-Pro (Taranis gimbals)/XJT/X8R

User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Frsky telemetry from iNav - mAh values not correct

Post by MikeB »

The Mah value is usually calculated by erskyTx from the current, provided you have set the "Current source" correctly.
A quick look at Inav telemetry suggest it may be sending the mAh value in the "Fuel" item, unless you have set "smartport_fuel_unit = PERCENT".
In your log, the fuel value starts at 8 and rises to 15.
To start with, try seeing if the "Fuel" value gives the correct number for mAh.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
rsilk49
Posts: 140
Joined: Wed Oct 26, 2016 10:33 am
Country: United Kingdom

Re: Frsky telemetry from iNav - mAh values not correct

Post by rsilk49 »

Displaying Fuel does show the correct value, but the number is obscure since it flashes between 0 and the correct value.
Smartport_fuel_unit = mah
Attachments
IMG_20200209_183115_BURST001_COVER.jpg
S500 + Pixhawk 1 clone + Mauch PM + C&T Telemetry adapter + 9XR-Pro (Taranis gimbals)/XJT/X8R
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Frsky telemetry from iNav - mAh values not correct

Post by MikeB »

How quickly does it flash back to 0?
Two possibilities I can think of:
1. Something else is also setting the fuel value. Do you have a "Current Source" set?
2. The fuel update rate is low (more than 2.5 seconds). In the Telemetry|Logging menu, try increasing the "Data Timeouts" value from 2.5S to (say) 4.0S.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
rsilk49
Posts: 140
Joined: Wed Oct 26, 2016 10:33 am
Country: United Kingdom

Re: Frsky telemetry from iNav - mAh values not correct

Post by rsilk49 »

Fuel display is refreshed 2-3 times per second. The mAh value is barely visible behind the "0"
Telemetry:Current Source = null

FIXED: I cleared all sensors in Telemetry and now I get good mAh values via Fuel :)

It would be a nice feature to add a setting for fuel source : Fuel -> Fuel% (default), mAh

.rs
S500 + Pixhawk 1 clone + Mauch PM + C&T Telemetry adapter + 9XR-Pro (Taranis gimbals)/XJT/X8R

User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Frsky telemetry from iNav - mAh values not correct

Post by MikeB »

Create a Scaler with Source = Fuel, set the name to "mAh", and the units to mAh, then use that on the display.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
rsilk49
Posts: 140
Joined: Wed Oct 26, 2016 10:33 am
Country: United Kingdom

Re: Frsky telemetry from iNav - mAh values not correct

Post by rsilk49 »

That did the trick!
Many tx (again).

R
Attachments
IMG_20200210_140412.jpg
S500 + Pixhawk 1 clone + Mauch PM + C&T Telemetry adapter + 9XR-Pro (Taranis gimbals)/XJT/X8R
rsilk49
Posts: 140
Joined: Wed Oct 26, 2016 10:33 am
Country: United Kingdom

Re: Frsky telemetry from iNav - Fmd not displayed

Post by rsilk49 »

Having solved the mAh issue from iNav, I am hoping Mike can throw some light on why the Fmd value is always showing as zero on the radio telemetry page. Is it possible that iNav is using a non-standard Smartport datapacket?

I can see the defined PWM values are being sent to the rx in the Mixer page and also that they are received by iNav since they match the values displayed in the radio and modes pages in the iNav Configurator app.
S500 + Pixhawk 1 clone + Mauch PM + C&T Telemetry adapter + 9XR-Pro (Taranis gimbals)/XJT/X8R
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Frsky telemetry from iNav - mAh values not correct

Post by MikeB »

The Fmd value is the "flight mode" as set in the Tx "MODES" page and takes the values from 0 to 6. It has nothing to do with a flight mode sent to iNAV.
It looks like the iNAV telemetry is sending a value in "Tmp1" to report the flight mode it is using. This appears to be a 5-digit number with each digit being a bitfield.
What do you want displayed, based on what you are sending as a PWM value?

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
rsilk49
Posts: 140
Joined: Wed Oct 26, 2016 10:33 am
Country: United Kingdom

Issues with Flight mode selection

Post by rsilk49 »

Didn't realize the flight mode number was coming directly from the radio. For my needs this is OK. So why is it always a zero?

I have 6 flight modes defined, but modes 4-6 do not get highlighted when I activate their switches (AIL, GEA, RUD) and the names are not shown on the main pages.
See pic: AIL switch ON (F4-Loiter) but F3 highlighted.
Attachments
IMG_20200215_122910.jpg
IMG_20200215_124548.jpg
IMG_20200215_124608.jpg
S500 + Pixhawk 1 clone + Mauch PM + C&T Telemetry adapter + 9XR-Pro (Taranis gimbals)/XJT/X8R
rsilk49
Posts: 140
Joined: Wed Oct 26, 2016 10:33 am
Country: United Kingdom

Post by rsilk49 »

When I rearrange the order of the flight modes so that the ID switches are in 4-6, then it highlights as expected and the names appear on the main pages!
Attachments
IMG_20200215_144743.jpg
S500 + Pixhawk 1 clone + Mauch PM + C&T Telemetry adapter + 9XR-Pro (Taranis gimbals)/XJT/X8R
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Frsky telemetry from iNav - mAh values not correct

Post by MikeB »

Not sure why Fmd is always showing a 0. I just checked on a X9D and it shows correctly, I'll check on a 'PRO when I've charged it!
The active flight mode is set by starting a flight mode 1 and searching for an active one. As soon as it finds one with the switch(es) on, that is the active mode. Since one of ID^, ID- and IDv is always true, you will never get to FM4, 5 or 6 with your original settings.
You may need to add a second switch, possibly a logical switch. e.g. if you set L1 to be !AIL AND !GEA with an AND switch of !RUD, then use L1 as the second switch to the three modes with the ID switch, these will all be disabled as soon as you turn one of AIR, GEA or RUD on.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
rsilk49
Posts: 140
Joined: Wed Oct 26, 2016 10:33 am
Country: United Kingdom

Re: Frsky telemetry from iNav - mAh values not correct

Post by rsilk49 »

Now I see the importance of the mode order.
Could you not add the flight mode names to the Mixer pages for the channel which controls the flight modes? Then it would be all in one place and this ordering would not be necessary.

BTW, "T1=" shows the flight mode number coming back from iNav. Is there a trick way to create a table of mode numbers/names?
S500 + Pixhawk 1 clone + Mauch PM + C&T Telemetry adapter + 9XR-Pro (Taranis gimbals)/XJT/X8R
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Frsky telemetry from iNav - mAh values not correct

Post by MikeB »

There does seem to be a problem displaying the Fmd value on Atmel based radios (SKY, 9XR-PRO, AR9X), I'll investigate.
In case you had not noticed, when on a telemetry display, the model name is replaced by the current fight mode name when on a flight mode other than FM0.

Please explain exactly what you mean by adding the flight mode names to the mixer pages.

What numbers are you seeing for T1? From something I saw about iNAV telemetry the flight mode is heavily encoded. You may need a script to decode it.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
rsilk49
Posts: 140
Joined: Wed Oct 26, 2016 10:33 am
Country: United Kingdom

Re: Frsky telemetry from iNav - mAh values not correct

Post by rsilk49 »

MikeB wrote: Sat Feb 15, 2020 6:54 pm
Please explain exactly what you mean by adding the flight mode names to the mixer pages.

What numbers are you seeing for T1? From something I saw about iNAV telemetry the flight mode is heavily encoded. You may need a script to decode it.

Mike
Numbers do agree with Inav wiki (see Tmp1)
https://github.com/iNavFlight/inav/blob ... lemetry.md

e.g. 41 (manual, not armed) , 11 (angle, not armed)

My idea would be to extend the mixer settings page to add a label adjacent to the switch for the mode name or maybe use the existing "MODES" control?
Attachments
IMG_20200215_204655.jpg
IMG_20200215_204743.jpg
S500 + Pixhawk 1 clone + Mauch PM + C&T Telemetry adapter + 9XR-Pro (Taranis gimbals)/XJT/X8R
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Frsky telemetry from iNav - mAh values not correct

Post by MikeB »

I've found the bug causing Fmd not to display. It is on all radios with a screen only 128 pixels wide.
I think what you are asking for is specific to using iNAV, and is not relevant for anything else.

Are you using CH5 to send the required flight mode to the aircraft? You may be doing more than you need to. It looks like you have L1 selecting the required output, and, I assume, you have this selecting the same switch conditions as you have to select FM1, and you are just using the flight modes to get the name displayed.

However, you may use flight modes to enable mixes, without using a switch in the mix. You currently have the mix enabled in all flight modes. You could just leave one flight mode enabling each mix.

What I might be able to do is if a mix is only active for a single flight mode, then display the mode name on the blank line under the list of flight modes.

To handle the T1 value, and then display names, I think you will need to use a telemetry script.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
rsilk49
Posts: 140
Joined: Wed Oct 26, 2016 10:33 am
Country: United Kingdom

Re: Frsky telemetry from iNav - mAh values not correct

Post by rsilk49 »

Yes CH5 is my channel for flight modes in this model.

I have always assigned the switches in the mix, since I didn't realize it was possible to do otherwise. And yes, I only use the Fl.Modes page to get the display name and the VoiceAudio to select the voice file from the same switch. It is a bit cumbersome, but it does seem logical -- to me at least.

Is there any "best practices" doc or video where others explain their methods for setting up flight modes with erskyTx?
S500 + Pixhawk 1 clone + Mauch PM + C&T Telemetry adapter + 9XR-Pro (Taranis gimbals)/XJT/X8R
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Frsky telemetry from iNav - mAh values not correct

Post by MikeB »

No doc or video to my knowledge. My idea is you set up the flight modes, selected by switches (2 available for each mode), then use the flight modes to enable mixes etc.
I'll try to post an update with the Fmd bug fixed later today.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
rsilk49
Posts: 140
Joined: Wed Oct 26, 2016 10:33 am
Country: United Kingdom

Re: Frsky telemetry from iNav - mAh values not correct

Post by rsilk49 »

While debugging the iNav flight mode and GPS telemetry, I have a custom page set up showing T1= and T2=.
Can you pls confirm the maximum number of digits that can be displayed for these 2 variables? I am concerned that the numbers coming through may be truncated.
.r
S500 + Pixhawk 1 clone + Mauch PM + C&T Telemetry adapter + 9XR-Pro (Taranis gimbals)/XJT/X8R
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Frsky telemetry from iNav - mAh values not correct

Post by MikeB »

The temperature values (since they are expected to be temperatures) are treated as 16-bit signed integers, so range from -32768 to + 32767.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: RE: Re: Frsky telemetry from iNav - mAh values not correct

Post by jhsa »


MikeB wrote:No doc or video to my knowledge.

Mike
Are you sure Mike? ;) :D
What about the Er9x manual? It should explain the basics of setting the flight modes. :) But I am not at my PC now, so I can't post a link to it. I believe it can also be downloaded from www.er9x.com

Also below all my posts there are a couple links. One of them points to some videos I made a few years ago. While they might not be up to date with the current version of the firmware, they might help. :)

João


My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
rsilk49
Posts: 140
Joined: Wed Oct 26, 2016 10:33 am
Country: United Kingdom

Re: Frsky telemetry from iNav - mAh values not correct

Post by rsilk49 »

MikeB wrote: Sun Feb 16, 2020 11:38 pm The temperature values (since they are expected to be temperatures) are treated as 16-bit signed integers, so range from -32768 to + 32767.

Mike
Big enough for me.
I also created a big scaler to see how it displayed 5 digits.
S500 + Pixhawk 1 clone + Mauch PM + C&T Telemetry adapter + 9XR-Pro (Taranis gimbals)/XJT/X8R
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Frsky telemetry from iNav - mAh values not correct

Post by MikeB »

I've just posted an updated version for the 'PRO with the Fmd display bug fixed.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

Post Reply

Return to “ersky9xr”