Optional data in the oxs telemetry fields

Development & General Chat for the superb openxvario project.

Moderator: rainer

bgbrik
Posts: 20
Joined: Wed Jan 22, 2014 8:53 pm
Country: -

Optional data in the oxs telemetry fields

Post by bgbrik »

I have just built an openXsensor (r194) and it works great with sPort on a X8R and a Taranis – thanks

Please help me with the optional data in the telemetry fields. I want to use the Voltage on pin A3. I have the following uncommented in oxs_config.h
#define SEND_DividerVoltageAsDist
#define SEND_VRefAsFuel
#define SEND_TEMP_T1
#define SEND_SensitivityAsT2
and hence thought I should see some data in the DIST, FUEL, T1 &T2 fields on the Taranis – but I just see “0”. Do I need to configure/enable something else?

Thanks

User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Optional data in the oxs telemetry fields

Post by Kilrah »

These aren't supported on SPORT as of yet, they're only valid for the "old" serial port.
bgbrik
Posts: 20
Joined: Wed Jan 22, 2014 8:53 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by bgbrik »

Thanks – I’ll try and be patiently!! Must add that only having had my Taranis a few weeks I am very impressed with it and the openX Vario. Thanks again to all concerned
guido
Posts: 1
Joined: Sun Feb 02, 2014 8:26 am
Country: -

Re: Optional data in the oxs telemetry fields

Post by guido »

I also try to get the openXsensor to work but without success until now :-(
I have a general question for the SPORT - what telemetry data are supported yet ? To my knowledge:
- ALT
- Vspd
- Vfas
- T1
- ALT+
others?
Does anybody knows where I can find the descriptions of what is behind the data? Some are obvious, most not - for example: What is ALT+ ( max measured altitude ? ) or ALT- ?
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Optional data in the oxs telemetry fields

Post by Kilrah »

On the oXs only ALT and VSPD are supported on S-port for now. The + and - are the min/max values, evaluated by the radio.

mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by mstrens »

I tried some days ago to implement some enhancements for the OpenXsensor.
You can find in attachment the program that I made.
This program have following characteristics:
- it works only with SPORT protocol ( so with X8R or X6R receivers); it does NOT work with the hub protocol.
- it can send more than Altitude, vertical speed : it transmits up to 6 voltages (e.g. from a lipo) and current and current consumption (if connected to a current sensor). Note : when combined with a vario sensor (MS5611), using a current sensor limits the number of voltages to 5 (this result from a limitation of Arduino).
- it uses different filters to provide a better vario functionality ( more sensitivity and less noise based on the tests I made)
- it is possible to set up some parameters for dynamic filtering of vertical speed; it can provide faster replies when vertical speed is more or less than a value) ; see explanation in config.h tab
- it calculates the vertical speed as fast as possible (50 X / second) allowing good sensitivity even with a lot of filtering even if oxs is used to measure voltages and/or a current
- it send the vertical speed as fast as possible (probably up to 40 X per second if there are no voltage/current to send)
- when powered by a 4.8 battery, it provides more accurate voltage measurements because they are based on the internal 1.1 voltage reference which has less variations than the battery voltage. Take care : this means that you have to connect each voltage to measure (and the current sensor) to a voltage divider (2 resistors) and that the resistors have to be calculated in order to get 1.1 volt at the mid point. See more explanation in the config.h tab.
- it allows you to chose freely which measurement has to be send in which telemetry field (e.g you can send a voltage as Temperature 1, another as VFAS, ...).
- it allows to multiply / divide each measurement by a parameter when transmitting it ; this can be useful because the number of decimals displayed depend on the chossen field.

Please note that this program is based on the official openxsensor but differs on several points.
I do not know if it will be supported by the responsible from Openxsensor forum.
It is not 100% developed and tested.
I tested as much as I could the functions that I use.
I use it myself for the altitude and vertical speed (vario) and it seems OK.
I made tests for the 6 voltages and it was OK.
I did not test the current sensor because I have no current sensor. Normally it should work.
I did not test the ability of changing the sensitivity of the vario on the transmitter. It requires to connect oxs to a channel from the receiver. Normally it should work.
I did not test loading/saving the data in EEPROM. It would require some minor changes in the program. I don't know if some people use this functionality.
I did not test the "push_button" function. Normally it should work.

If you have questions or want some improvements, you can contact me.
Michel
Attachments
openxsensor_Sport_Volt.rar
(26.95 KiB) Downloaded 285 times
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Optional data in the oxs telemetry fields

Post by jhsa »

I do use the push button to reset the mA when inserting a new battery. like that, if you use the same battery for multiple flights you will know the status of the battery as the previous value will be kept till you reset it..
But I can't use your version as it doesn't support the D series receivers.. Shame :(

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
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Optional data in the oxs telemetry fields

Post by MikeB »

Be carful using the internal 1.1V source. It is not very accurate. It is specified at a nominal 1.1V, but, at a supply voltage of 2.7V is only guaranteed to be between 1.0 and 1.2 volts.
Having said that, I thought the original code used the 1.1V source to "calibrate" the supply voltage when used for ADC reference. If so, then changing to using the 1.1V source directly won't improve things and just adds the requirement for extra resistors.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by mstrens »

Mike,

Thanks for you comment.
I made some tests and I saw that internal voltage was not always 100% stable.
Still I think that using it remains the best solution (except using an external voltage reference).

I try to explain here why.

When the raw voltage applied to the Arduino is more than about 5.2/5.3 volt, the 5 volt regulator will normally provide a good stable reference.
Measuring internal voltage based on VCC and using it to calculate a VCC for all voltage conversions is not the most accurate because it combines 2 measurements (and the errors on each of them) and still depend on the stability of the internal voltage.
It should then be better to measure directly the voltage (in 1/1023 of Vcc) and applying a correction based on a calibration done with a voltmeter.

The principle of measuring internal voltage reference with ADC seems useful when the power supply is less than 5.2 volt because Vcc is not stable.
E.g. if power supply drop down to 4.8 volt, Vcc will probably drop down to 4.5 volt.
Voltage conversions referring to Vcc become wrong by a factor 5/4.5 in such a case.
Calculating Vcc based on the internal reference allows in principle to correct this but :
- it supposes that the internal reference is stable.
- the errors made when measuring the internal reference have an impact on the final result; those errors result not only from the ADC but also from the variations on Vcc (there can be quite big variations when servos are moving).

It seems me easier and more accurate to measure the voltage based on the internal reference instead of based on Vcc.
I see 3 drawbacks with this:
- the ADC comparator from AVR have to react in steps of 1.1 volt instead of steps of 5 volt. I imagine that this does not have an impact on accuracy.
- we have to use dividers to bring the external voltages down to about 1 volt. Still in many cases (lipo with several cells), this is not a problem because the voltages to measure have to be reduce anyway. We just have to select the right resistors.
- when the hardware leads to a voltage based on a % of Vcc. This is e.g. the case for most of the current sensors. For zero amp, the voltage provided by the current sensor is Vcc / 2 ( and so not an absolute voltage = 2.5 volt).
In such a case it would be better to measure the voltage directly based on VCC (so variations on Vcc does not impact current measurements).
I could no do so in the program because it is not possible to switch between measurements based on Vcc and on Internal reference due to a quite big capacitor on the Aref pin.
Note : original oxs code for current sensor makes here a small mistake too because it takes care of calculated Vcc (via measurement of internal voltage) and this should not be the case.

Michel
bgbrik
Posts: 20
Joined: Wed Jan 22, 2014 8:53 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by bgbrik »

Michel,
sorry about this but I'm no software expert. When I try and compile opensensor_Sport_Volt I get the following errors. Note that I can sucessfully compite openxsensor. Can you help please
Thanks john h

C:\Program Files\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -IC:\Program Files\Arduino\hardware\arduino\cores\arduino -IC:\Program Files\Arduino\hardware\arduino\variants\standard -IC:\Program Files\Arduino\libraries\Wire -IC:\Users\John\Documents\Arduino\libraries\oxs_config -IC:\Users\John\Documents\Arduino\libraries\oxs_arduino -IC:\Users\John\Documents\Arduino\libraries\oxs_ms5611 -IC:\Users\John\Documents\Arduino\libraries\oxs_curr -IC:\Users\John\Documents\Arduino\libraries\oxs_out_frsky -IC:\Program Files\Arduino\libraries\EEPROM -IC:\Users\John\Documents\Arduino\libraries\EEPROMAnything -IC:\Users\John\Documents\Arduino\libraries\Aserial C:\Users\John\AppData\Local\Temp\build2622155751024475642.tmp\openxsensor_Sport_volt.cpp -o C:\Users\John\AppData\Local\Temp\build2622155751024475642.tmp\openxsensor_Sport_volt.cpp.o
openxsensor_Sport_Volt.ino: In function 'void setup()':
openxsensor_Sport_Volt:87: error: 'class OXS_CURRENT' has no member named 'setupCurrent'
openxsensor_Sport_Volt.ino: In function 'void readSensors()':
openxsensor_Sport_Volt:115: error: 'oxs_Arduino' was not declared in this scope
openxsensor_Sport_Volt:130: error: no matching function for call to 'OXS_CURRENT::readSensor()'
C:\Users\John\Documents\Arduino\libraries\oxs_curr/oxs_curr.h:27: note: candidates are: void OXS_CURRENT::readSensor(uint16_t)
openxsensor_Sport_Volt.ino: In function 'void loop()':
openxsensor_Sport_Volt:146: error: 'checkButton' was not declared in this scope
openxsensor_Sport_Volt:161: error: 'oxs_MS5611' was not declared in this scope
openxsensor_Sport_Volt:161: error: 'ProcessPPMSignal' was not declared in this scope
openxsensor_Sport_Volt.ino: In function 'void checkButton()':
openxsensor_Sport_Volt:217: error: 'Reset1SecButtonPress' was not declared in this scope
openxsensor_Sport_Volt:219: error: 'Reset3SecButtonPress' was not declared in this scope
openxsensor_Sport_Volt:222: error: 'Reset10SecButtonPress' was not declared in this scope
openxsensor_Sport_Volt.ino: In function 'void Reset1SecButtonPress()':
openxsensor_Sport_Volt:244: error: 'oxs_Arduino' was not declared in this scope
openxsensor_Sport_Volt.ino: In function 'void ProcessPPMSignal()':
openxsensor_Sport_Volt:373: error: 'ReadPPM' was not declared in this scope
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by mstrens »

bgbrik,

I will check.
I keep you inform.
Michel
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by mstrens »

bgbrik,

It seems that some functions in the ino file have to be declared before being used.
I don't know why because it is not always the case.

I think this can be solved adding 2 lines in the .ino file
I tested with this code

//#define DEBUG // this line already exists the ino file

void checkButton() ; // line 1 to add
void ProcessPPMSignal() ; // line 2 to add

#ifdef DEBUG // this line already exists the ino file

I made this test:
I copied all the files from the rar archive in a new directory.
I added the 2 lines
I change the set up in the config file (in order to try to reflect what you probably tried).
I got no compilation error.

Can you try and inform me?

Michel
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by mstrens »

bgbrik,

if adding 2 lines is not enough, you can also try adding all those lines (to declare first all functions)

int freeRam () ;
void checkButton() ;
void readSensors() ;
void Reset1SecButtonPress() ;
void Reset3SecButtonPress() ;
void Reset10SecButtonPress() ;
void SaveToEEProm() ;
void LoadFromEEProm() ;
void ProcessPPMSignal() ;
unsigned long ReadPPM() ;


Michel
bgbrik
Posts: 20
Joined: Wed Jan 22, 2014 8:53 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by bgbrik »

with all line added I get the following:

C:\Program Files\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -IC:\Program Files\Arduino\hardware\arduino\cores\arduino -IC:\Program Files\Arduino\hardware\arduino\variants\standard -IC:\Program Files\Arduino\libraries\Wire -IC:\Users\John\Documents\Arduino\libraries\oxs_config -IC:\Users\John\Documents\Arduino\libraries\oxs_arduino -IC:\Users\John\Documents\Arduino\libraries\oxs_ms5611 -IC:\Users\John\Documents\Arduino\libraries\oxs_curr -IC:\Users\John\Documents\Arduino\libraries\oxs_out_frsky -IC:\Program Files\Arduino\libraries\EEPROM -IC:\Users\John\Documents\Arduino\libraries\EEPROMAnything -IC:\Users\John\Documents\Arduino\libraries\Aserial C:\Users\John\AppData\Local\Temp\build2592984517493707899.tmp\openxsensor_Sport_volt.cpp -o C:\Users\John\AppData\Local\Temp\build2592984517493707899.tmp\openxsensor_Sport_volt.cpp.o
openxsensor_Sport_Volt.ino: In function 'void setup()':
openxsensor_Sport_Volt:106: error: 'class OXS_CURRENT' has no member named 'setupCurrent'
openxsensor_Sport_Volt.ino: In function 'void readSensors()':
openxsensor_Sport_Volt:134: error: 'oxs_Arduino' was not declared in this scope
openxsensor_Sport_Volt:149: error: no matching function for call to 'OXS_CURRENT::readSensor()'
C:\Users\John\Documents\Arduino\libraries\oxs_curr/oxs_curr.h:27: note: candidates are: void OXS_CURRENT::readSensor(uint16_t)
openxsensor_Sport_Volt.ino: In function 'void loop()':
openxsensor_Sport_Volt:180: error: 'oxs_MS5611' was not declared in this scope
openxsensor_Sport_Volt.ino: In function 'void Reset1SecButtonPress()':
openxsensor_Sport_Volt:263: error: 'oxs_Arduino' was not declared in this scope
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by mstrens »

bgbrik,

This is strange.
I expect it is an arduino IDE issue.
When I compile the program, I get a much longer report (with some warning but no error)

I put in attachment an example of report I receive.

Note : I am using version 1.0.5 from Arduino IDE (the version number is displayed on top left of the window.
As "preferences" (under File) I activate the option "Show verbose output during compilation.

Are you using the same version and the same set up.

For you information, when I install the openxsensor software, I did the following:
- I create a new (empty) directory with exactly the same name as the ino file (taking care of the caps) so the name is : "openxsensor_Sport_Volt"
- I download the archive (.rar) and I open it.
- I select all the files (ino, cpp and h) from the archive and make a copy past in the new directory.
- I dubbleclick on the file "openxsensor_Sport_Volt.ino" in the new directory
- this open Arduino IDE and I edit the config.h file.
- I add lines in the .ino file (see previous mail).
Attachments
compilation_report.txt
(14 KiB) Downloaded 336 times
bgbrik
Posts: 20
Joined: Wed Jan 22, 2014 8:53 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by bgbrik »

did as you suggested and started again, now compiles OK (with a few warnings). Prob now is down loading, I get "avrdude: stk500_getsync(): not in sync: resp=0x00" Unfortunately I have ran out of time now for a couple of days. Thanks for your help
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by mstrens »

bgbrik

You can search on the web about this error.
I think it means that there is a communication error between the PC, the usb device and the Arduino.
You must check in the arduino IDE in the menu tools:
- in item board : did you select the right type of arduino (it must be pro or pro mini 5 v 16 mhz ATmega 328)
- in programmer : you must select the one you are using (I select USBasp with a FTDI basic 232 device)
- in serial port : you must select a com port which appears when you insert the programmer device into your usb port. Please note that this com appears only after you insert you USB.
I hope this can help you.
bgbrik
Posts: 20
Joined: Wed Jan 22, 2014 8:53 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by bgbrik »

Michel,

Thanks for your help and encouragement, all is now working. The final straw was a faulty Arduino board!

What I don’t understand now are the sPort telemetry fields and their relationships to the Taranis display options. I assume that the “Telemetry Fields” in config.h align (approx.) to the telemetry fields that can be displayed on the Taranis, and I assume that the “Available measurements” are sub-fields within the “Telemetry Field” , if so how do I display more than one piece of data per “Telemetry Field”? or does “Available measurements” defile the units of the data? As you can tell I’m confused, can you help please? PS I am currently using T1_FIRST_ID,VOLT6 exactly as the example you give in config.h Thanks john h
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by mstrens »

bgbrik wrote:Michel,

Thanks for your help and encouragement, all is now working. The final straw was a faulty Arduino board!

What I don’t understand now are the sPort telemetry fields and their relationships to the Taranis display options. I assume that the “Telemetry Fields” in config.h align (approx.) to the telemetry fields that can be displayed on the Taranis, and I assume that the “Available measurements” are sub-fields within the “Telemetry Field” , if so how do I display more than one piece of data per “Telemetry Field”? or does “Available measurements” defile the units of the data? As you can tell I’m confused, can you help please? PS I am currently using T1_FIRST_ID,VOLT6 exactly as the example you give in config.h Thanks john h
On the taranis, there is a telemetry menu that allows you to select which fields are displayed on a screen (I think it is possible to set up up to 3 screens); each field is identified on taranis by a short name like Alt, T1, T2, Vfas, ...
For more information about this, please check the taranis manual.

This version of openxsensor allows you send the which data have to send to the Tx and for each data in which taranis field.
It should be logical to use a set up where :
- altitude from OXS is sent as "Alt" (if you have a vario so if you do not put the line #define VARIO as comment)
- vertical speed as VSpd (if you have a vario)
- current (in milliamp) as Curr (if you have a Current sensor)
- consumption (in milliamphour) as Cnsp (if you have a Current sensor)

For the up to 6 voltages, it depends on what is measured by the sensor.
E.G. if Voltage 1 measures a temperature, it should be logical to use a set up to send it as T1 or T2.
If a Voltage (says Voltage 2) is connected to the + from a lipo, you could use a set to send it as VFas.

Frsky has foreseen a special way to transmit the voltage of each cell when measuring a lipo with several cells; Frsky expect that the voltage should be send and the taranis would calculate:
- the lowest voltage and display it as "Cell"
- summarise the voltage of all cells and display it as "Cells".
Sending each cell voltage in such a way is not yet developped in my current version OXS.

To select which data has to be sent and in which taranis field you can edit some lines in the config.h file from OXS.

Here the text that I put in config.h in order to try to explain how to define the set up.
//*********************General set up to define wich measurements are transmitted *****************************************************
// You must specify here under ONE ROW for EACH FIELD to tranmit.
// Each row must contains:
// - 1 : the code of a field to transmit (e.g. "T1_FIRST_ID" )
// - 2 : a comma
// - 3 : the code of a measurement to transmit in this field (e.g. "VOLT1")
// - 4 : a comma
// - 5 : a multiplier factor to apply on the value to transmitted (set "1" to keep the original measurement, 10 to multiply by 10 , ...)
// - 6 : a comma
// - 7 : a divider factor to apply on the value to transmitted (set "1" to keep the original measurement, 10 to divide by 10 , ...)
// - 8 : a comma and "\" if there is least one next more (don't fill on the last row); take care that "\" must be the last caracter on the row (no space after)
// Notes : multiplier and divider must be integer (no decimal)
// The code of a measurement (e.g. VOLT1) may not appear on several rows
// The code of a field to transmit (e.g. "T1_FIRST_ID" ) may not appear on several rows
// Sequence of rows does not matter.
// Here an example of set up in order to transmit
// as altitude the altitude measurement,
// as vertical speed the vertical speed measurement
// as Temperature T1 the VOLT6 measurement divided by 100
// #define SETUP_DATA_TO_SEND \
// ALT_FIRST_ID , ALTIMETER , 1 , 1 ,\
// VARIO_FIRST_ID , VOLT4 , 1 , 1 ,\
// T1_FIRST_ID , VOLT6, 1 , 100
// *********************************************************************

Can you look at this.
If this is still not clear, I can try to explain more in details (or provide more examples)
bgbrik
Posts: 20
Joined: Wed Jan 22, 2014 8:53 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by bgbrik »

Thanks, not sure I understand fully but I understand enough for what I am doing. Next problem: Initially I was sending a voltage via T1 and it was displayed as mV (ie 4.8V was displayed on Taranus as 4800). I tried using the divide function in config.h but it didn’t work (T1_FIRST_ID , VOLT1, 1 , 1000). Now I have moved to Vfas (more appropriate as measuring LiPo). Taranus now displays 10xVolts, ie 48V for 4.8V and still the divide function does not work. All a bit confusing so once again I’m seeking your help please. Thankyou john h
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by mstrens »

Thanks for feedback.

I checked the program and I found a bug that explain why the divider (and multiplier) did not work at all.
I fixed it in this version (and I tested it).

Please note that the data sent by telemetry are always integers (they contains no comma).
It is always the taranis thatput a comma for some field.
The multiplier/divider that you can set up on XOS config file allows to change the value sent to taranis but the value it self does not contain a comma.
E.g. Voltage is normally measure by OXS in millivolt. So 4.8 volt has a value 4819.
If you use a divider 10, OXS will transmit 481 (4819 / 10).
Depending on the field you select on the taranis, you can get a different value on the screen.
I think that selecting T1 or T2 just display the value as transmitted.
In attachment, you will find a new version that fix the bug about multiplier/divider (and another bug related to adjusting vario sensitivity from the Tx).
Take care to adapt the config file based on your preferences because I changed some set up some time for tests and the current set up about fields to transmit is not the most logical.

If you still need help or find errors, you are welcome.
Attachments
openxsensor_Sport_Volt_10feb2013.rar
(27.08 KiB) Downloaded 179 times
bgbrik
Posts: 20
Joined: Wed Jan 22, 2014 8:53 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by bgbrik »

Great - it worked first go. I now have everything I was hoping for. A three position switch on Tx for the vario - off/speak height/vario, and a second switch that speaks the battery voltage. A friend and I have now flown our powered gliders probably 20 times with the openxsensor S/W and its performance is better than we could have hoped for, just waiting for the weather to improve to test this latest version - Thanks again.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by mstrens »

bgbrik wrote:Great - it worked first go. I now have everything I was hoping for. A three position switch on Tx for the vario - off/speak height/vario, and a second switch that speaks the battery voltage. A friend and I have now flown our powered gliders probably 20 times with the openxsensor S/W and its performance is better than we could have hoped for, just waiting for the weather to improve to test this latest version - Thanks again.
Thanks for feedback.
It is good that it reachs you expectations.
Feel free to play with the sensitivity parameter.
My default setting use 0.05 and 0.10 but you can change it according to your preferences.
You can even use the same value for both parameters (e.g 0.03 if you want that it becomes less reactive).

Please note that another user had some issues with the software (the vertical speed was sometime wrong ).
I do not know why.
Still another developper provides me some code that could perhaps solve this issue.
I integrated his code in a new version I put in attachment.

You can test it if you want.

I just made some tests (at home) and it seems OK but it is better if it would be tested by more users.
Do not forget to adapt the config file to your needs. I think you can reuse the one you already used with the version from this morning because there are no change about the setup.

You feedback is always welcome.
Attachments
openxsensor_Sport_Volt_10feb2013_2205.rar
(34.08 KiB) Downloaded 184 times
bgbrik
Posts: 20
Joined: Wed Jan 22, 2014 8:53 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by bgbrik »

above version working OK. Note I had to add #include "I2C.h" to .ino file to get it to compile
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by mstrens »

I am using a Taranis (so using internal XJT).
I made a version of OXS that allows to send any field ID as well over SPORT interface as over HUB protocol.
I can transmit fields like Altitude, Temp1, Temp2, ...
I created a new field in OXS to transmit the difference of altitude between 10 seconds.
The idea is to set up a custom function "play value" repeated every 10 seconds.
This will give a kind of averaging of vertical speed over 10 sec.
This is a feature that you find on some other varios (RC, paraglider,...).
I can transmit the value as Temp1, Temp2 and it works.
Still, when Taranis plays the value it adds automatically the units (here the degree).
I would like that Taranis adds "meters" so I tried to transmit the value using the field "Dist".

I did not find a code on 2 bytes (SPORT codes) for "Dist".
So I tried the code 0x3C for the field ID because I expected that it was the code for Hub protocol (I found in some source "#define FRSKY_USERDATA_GPS_DIST 0x3C").

Still it does not work. When I ask Taranis to display the field "Dist", the value remains 0.
I get the same issue using the Sport (with an X8R) or the Hub (with a D4R-II) protocol.

I suspect that the issue is on Taranis side because I do not find the code code for GPS_Dist.

I could implement a work around still using Temp1 copying/renaming the wav file for "meter" as "degree" but this is not a nice solution.

Can someone confirm my analysis?
Must I open an issue?
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Optional data in the oxs telemetry fields

Post by Kilrah »

Dist is calculated by the radio, not transmitted over the air. The radio computes the distance between the pilot's GPS position (stored on a telemetry reset) and the last received GPS position.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by mstrens »

Kilrah wrote:Dist is calculated by the radio, not transmitted over the air. The radio computes the distance between the pilot's GPS position (stored on a telemetry reset) and the last received GPS position.
Kilrah,
Thanks for this information.
I understand it.

It is strange that the official version of XOS allows to transmit different data in a field Dist.
Here an extract from the OXS config file.

//#define SEND_AltAsDIST 0 // 0 Altitude in DIST the numeric value (in cm) is an offset that will
// be subtracted from the actual height for higher display precision.
// e.g: Actual height is 456,78 Meters ( DIsplay in DIst would be 456 7)
// if we subtract 300 display will be 156 78
// This is due to the fact that the highest precission in this field
// will only be transmitted up to an altitude of 327.68 m
//#define SEND_SensitivityAsDist // sensitivity in DIST
//#define SEND_PressureAsDIST // pressure in DIST field
//#define SEND_mAhAsDist
//#define SEND_VRefAsDist // send the internal measured voltage as DIST
//#define SEND_DividerVoltageAsDist // send the calculated voltage on the voltage divider as DIST

I have 2 questions:
1) I presume that I can remove the code for all those options from XOS. It does not make sense to keep them.
2) Do you see the possibility to send to TX a field (other than Altitude) that could be selected in "play value" in a custom function and that would have an unit in meter?
I tried GAlt but it does not seems to work.
Do you know if release 2 will offer more possibilities (e.g. letting the user select the unit he want for a field, having more filed_id, ...) ?

Michel
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Optional data in the oxs telemetry fields

Post by jhsa »

On er9x/ersky9x that will be/is possible. At least the on the test version I can use a scaler to pick up any telemetry field, and give it a unit. So, for us keeping the "send as" option would be useful I guess.. the radio would just pick the value up, scale it, give it a unit (volts, meters, whatever), give it a name, and use it for an alarm, mix weight (not available yet I think), or wherever it can be used..

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
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Optional data in the oxs telemetry fields

Post by mstrens »

jhsa wrote:On er9x/ersky9x that will be/is possible. At least the on the test version I can use a scaler to pick up any telemetry field, and give it a unit. So, for us keeping the "send as" option would be useful I guess.. the radio would just pick the value up, scale it, give it a unit (volts, meters, whatever), give it a name, and use it for an alarm, mix weight (not available yet I think), or wherever it can be used..

João
Just FYI, in my version of OXS, it is already possible for nearly all fields to scale it (appling a multiplier/divider) but it would be better if this can be done on TX side (too) because not all sensors allows it.

Anyway, it does not make sense to keep on XOS some code to send a field_ID if TX do not process this field_ID because TX calculates them himself or must I understand that Taranis and er9x/ersky9x process the telemetry field in totally different ways? Then it could make sense to keep the code for "Dist".
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Optional data in the oxs telemetry fields

Post by jhsa »

As I said before, with the scalers, you can send whatever you want on any field as far as I understand.. obviously we are talking about different firmwares and different radios here.. but both can use the oXs.. So it would be nice that it would stay compatible with both.. ;)
Maybe Mike could explain better what the scalers are and what they can be used for.. :)

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

Post Reply

Return to “OpenXVario - an open source vario supported by the open source firmwares!!”