XR8 rx telemetary sensors

General Help and support for the Taranis Radio.
andrewju
Posts: 773
Joined: Tue Aug 21, 2012 7:29 am
Country: Russian Federation
Location: Moscow

Re: XR8 rx telemetary sensors

Post by andrewju » Tue Jan 31, 2017 10:30 pm

Ok, thanks!!!


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

Re: XR8 rx telemetary sensors

Post by Kilrah » Wed Feb 01, 2017 9:49 pm

Scripts updated to use ID 0x17 which is the ground node as per FrSky doc (smart dashboard or radio), was also mentioned in discussions back in 2013.

User avatar
bob195558
Posts: 2114
Joined: Sun Dec 16, 2012 7:24 pm
Country: United States
Location: New England, Vermont
Contact:

Re: X8R "XR8" rx telemetry sensors

Post by bob195558 » Wed Feb 01, 2017 10:39 pm

Should the title be X8R receiver telemetry sensors, the "XR8" looks to be a miss-print ? :?:
Not a big deal, but could be a help for someone searching for X8R help.

Bob B.
Er9x on 9x radio, with Smartieparts Programmer and TelemetrEZ Board.
ErSky9x on Taranis, Sky9x, 9Xtreme radios.

3D Printing upgrades with (CR10 3D Printer): (http://openrcforums.com/forum/viewforum.php?f=85).

andrewju
Posts: 773
Joined: Tue Aug 21, 2012 7:29 am
Country: Russian Federation
Location: Moscow

Re: XR8 rx telemetary sensors

Post by andrewju » Tue Feb 28, 2017 10:09 am

Mike,

I'm sorry to raise this thread again. I think I found a small bug and I need some help...

As I understand, if there's a voltage on Pin 2 (i.e. coming from a battery through a voltage divider), corresponding telemetry value is transmitted as Temp2. Also, when Pin 3 of the Attiny is short to GND, the telemetry value is transmitted as A1 instead of Temp2.

BUT: when Pin 3 of the Attiny is short to GND, the A1 telemetry value gets "overwritten" by the voltage sensor even if there's no voltage on Pin 2.

Is there a way to fix this?

I made a few of these sensor PCBs with dual inputs (both dividers are already in place). On these PCBs, the Pin3 is always connected to GND (I thought I would never need that jumper!). As soon as this sensor is connected to a receiver, A1 disappears (even if there's no battery connected to the sensor at all). This is not a big deal in general (the receiver voltage is still there as RxBatt or something similar), but it changes the default behavior and could cause some confusion...

I looked into the source code trying to fix it myself, but unfortunately my coding knowledge is far from the level required...

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

Re: XR8 rx telemetary sensors

Post by MikeB » Tue Feb 28, 2017 10:25 am

I'm not sure I understand the problem, other than it is working as designed!
In the Tx, we receive the SPort telemetry. From a 'X' receiver, we receive the receiver battery voltage as "RxBt", this is not A1.
For backward compatibility to 'D' receivers, the Tx makes this available as the A1 value. If you receive a real A1 value, then this is used for A1 instead of the receiver battery value.
So it is not the A1 value being overwritten, rather the A1 is no longer a copy of RxBt.

Possibly, the fix would be to change the firmware in the sensor to ignore the link input, and so send the voltage as TEMP2 all the time.

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


andrewju
Posts: 773
Joined: Tue Aug 21, 2012 7:29 am
Country: Russian Federation
Location: Moscow

Re: XR8 rx telemetary sensors

Post by andrewju » Tue Feb 28, 2017 10:40 am

Hmmm.... Let me rephrase my question.

Earlier you said the second analog input only works when the value is 999 or lower:
MikeB wrote:
Tue Dec 03, 2013 11:15 pm
The implementation is to read the 'second' ADC input (the debug pin closest to analog connector) as a 10-bit value (0-1023). The pin is configured with an internal pullup. If the value is over 999, it is ignored. If the value is less than 1000, then the pin is changed to analog input and the read value is then sent, currently as the second temperature, having been converted to 8 bits in the same way as the original analog input.
As far as I understand, it means that if the value on Pin2 is >999, neither Temp2 nor A1 should be transmitted by the sensor.
Am I wrong?

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

Re: XR8 rx telemetary sensors

Post by MikeB » Tue Feb 28, 2017 3:50 pm

Yes, but if you have fitted a voltage divider, you have added a pull-down resistor. This will cause the value read to be under 999. The internal pull-up is something like 20K to 50K.

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

andrewju
Posts: 773
Joined: Tue Aug 21, 2012 7:29 am
Country: Russian Federation
Location: Moscow

Re: XR8 rx telemetary sensors

Post by andrewju » Tue Feb 28, 2017 10:42 pm

Ahhhhh... Shame on me!
I really don't know why I decided it should work the other way around... :-(
You're absolutely right! It works exactly as it is supposed to!

Sorry for bothering you with this... And thanks a lot for taking the time to clarify (now obvious) things! :)

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

Re: XR8 rx telemetary sensors

Post by MikeB » Thu Sep 06, 2018 9:20 pm

I've made a change to the firmware for the X8R2Analog device so it doesn't "hog" the SPort bus.
This update now only sends 1 or 2 frames every 200mS instead of sending every time it is polled, which could have been a frame every 24mS.
The updated firmware (which is open source) is here: https://github.com/MikeBland/x8r-analog.

I tested using a .BAS script in ersky9x (very similar to the LUA script) and it worked OK with the X8R2Analog device attached to a S8R.

You do need an Atmel AVR/Tiny programmer to update the device. I used my AVRISP-II, but a USBASP should also work.

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

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

Re: X8R rx telemetry sensors

Post by MikeB » Sun Feb 17, 2019 9:19 pm

It looks like the production version, as sold by T9 and Aloft is no longer available.
I've ported the code to an Arduino Pro Mini, 3.3V 8MHz version, so this could be used instead. It will need the SPort connector wired in, together with some resistor dividers, but otherwise it should work the same way.
Since the Pro Mini has more I/O pins, I have also added options for A3 and A4 analog inputs. Alos, with the extra flash available, the SPort physical ID may be changed using the ChangeId function in ersky9x maintenance mode or the ChangeId app available when using the ersky9x bootloader.

I'll be posting more details when I have them available.

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

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

Re: XR8 rx telemetary sensors

Post by MikeB » Mon Feb 18, 2019 3:10 pm

Details and code are now available here: https://github.com/MikeBland/SportAnalog.

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

jtaylor
Posts: 142
Joined: Fri Nov 01, 2013 1:31 am
Country: -
Location: Wexford (Pittsburgh), PA

Re: XR8 rx telemetary sensors

Post by jtaylor » Tue Feb 19, 2019 5:25 pm

Thanks Mike, both for the original product and this update.

Jim

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

Re: XR8 rx telemetary sensors

Post by MikeB » Mon Jun 17, 2019 3:12 pm

I've sorted the source code for the original design so that a TINY85 may be used instead of a TINY13A. At present this is just a replacement, but I will add the code that allows changing the physical ID "soon". Since the '85 has much more flash memory I may be able to add more features as well.
To compile for the '85 use the command:
make CPU=85

I've attached a zip file with the updated source code and makefile and a .hex for the '85.
On the '85 you need the fuses to be Low=0xE2 and High=0xDF.

Mike
Attachments
Sport85.zip
17-Jun-2019 16:17
(12.34 KiB) Downloaded 17 times
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

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

Re: XR8 rx telemetary sensors

Post by jhsa » Mon Jun 17, 2019 6:12 pm

Couldn't the code be compiled using the arduino IDE?

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

Chrisbott
Posts: 33
Joined: Sun Aug 06, 2017 3:43 pm
Country: -

Re: XR8 rx telemetary sensors

Post by Chrisbott » Mon Jun 17, 2019 7:09 pm

Thanks Mike I have loaded that in a an ATTiny85 and the Tx sees A2. If I ground one of the inputs the Tx also sees A1. I think that's how it should work?

I'm getting nothing like the voltages I expect. Can I just check the pinout? S.port is in pin 6. Are the two analog inputs on pins 2 & 3?
Voltage dividers are Rin=15K and Rgnd=3k3?

Chris.

Chrisbott
Posts: 33
Joined: Sun Aug 06, 2017 3:43 pm
Country: -

Re: XR8 rx telemetary sensors

Post by Chrisbott » Mon Jun 17, 2019 9:27 pm

Update, I seem to only get A1 on the Tx if I ground pin3 (PB4).
But the A1 voltage seems to be being measured if I apply that to pin 7 (PB2). I guess I have something set up wrong somewhere.

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

Re: XR8 rx telemetary sensors

Post by MikeB » Mon Jun 17, 2019 10:53 pm

Yes to SPort on pin 6.
The A2 voltage should be on pin 7 (PB2).
The A1 voltage should be on pin 2 (PB3). This starts out with an internal pullup resistor, and so only sends an A2 value if the voltage is on the pin is less than 97.5% of VCC. If such a voltage is detected, the pullup resistor is disabled.

The second voltage (A2) is sent as Temperature 2 unless PB4 is grounded.

The code is written expecting VCC to be 3.3V. If you are running from 5V you will get different results.

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

Chrisbott
Posts: 33
Joined: Sun Aug 06, 2017 3:43 pm
Country: -

Re: XR8 rx telemetary sensors

Post by Chrisbott » Tue Jun 18, 2019 7:18 am

Thanks Mike. I had already realised about my supply being straight from the Rx. Parts on order to fix that.

I'd completely missed the PB4 switch between Temp and A2 though. Nice feature.

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

Re: XR8 rx telemetary sensors

Post by MikeB » Thu Jun 20, 2019 2:52 pm

Updated Sport85 that supports changing the physical ID over the SPort.

Mike
Attachments
Sport85.zip
(13.68 KiB) Downloaded 17 times
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

Chrisbott
Posts: 33
Joined: Sun Aug 06, 2017 3:43 pm
Country: -

Re: XR8 rx telemetary sensors

Post by Chrisbott » Fri Jun 21, 2019 4:37 pm

Thanks Mike. What's the process for changing ID?

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

Re: XR8 rx telemetary sensors

Post by MikeB » Fri Jun 21, 2019 9:34 pm

For erskyTx, I've written a script to change the ID of most sensors (over the air!), including this X8R2analog on the tiny85. It is available at www.er9x.com.

This script has been ported to a LUA script for openTx, available here: https://rcsettings.com/index.php/viewdo ... -sensor-id.

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

Chrisbott
Posts: 33
Joined: Sun Aug 06, 2017 3:43 pm
Country: -

Re: XR8 rx telemetary sensors

Post by Chrisbott » Thu Jul 18, 2019 10:12 am

Mike, I've been trying to use the LUA script from your link on a Taranis and a Horus that are running OpenTx. 2.2.4.
The script runs fine and if I select any other sensor, it goes off and reads the existing ID and subsequently allows changing said ID.
When I select X8R2ANA, it does not enter the Reading Id stage.

(Also on Horus it does a lot of screen flashing which is off putting, but I can live with that).

Chris

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

Re: XR8 rx telemetary sensors

Post by MikeB » Fri Jul 19, 2019 10:33 pm

Unfortunately, I can't help much as I don't run openTx (or LUA therefore), and I didn't write the LUA version.
I'll see if I can find time to read the LUA version to look for an error in the code.

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

Chrisbott
Posts: 33
Joined: Sun Aug 06, 2017 3:43 pm
Country: -

Re: XR8 rx telemetary sensors

Post by Chrisbott » Sat Jul 20, 2019 8:15 am

Many thanks Mike.

Maybe someone from OpenTx will spot this. Is there anywhere else I could ask?

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

Re: XR8 rx telemetary sensors

Post by MikeB » Sat Jul 20, 2019 9:09 am

Try here: https://www.rcgroups.com/forums/showthr ... st42123313, you may also then be able to contact the person that did the port to LUA.

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

Chrisbott
Posts: 33
Joined: Sun Aug 06, 2017 3:43 pm
Country: -

Re: XR8 rx telemetary sensors

Post by Chrisbott » Mon Jul 22, 2019 8:50 am

Thanks Mike I'll ask over there.

There now seems to be a V0.3 which has fixed the flashing on Horus.
The last sensor in the list still doesn't read existing ID but I've made a copy that works for X8R2ANA by moving another sensor to last in the list.

local sensor = {sensorType = {selected = 12, list = {'Vario', 'FAS-40S', 'FLVSS', 'RPM', 'Fuel', 'Accel', 'GPS', 'Air speed', 'R Bus', 'X8R2ANA', 'Gas suit', '-'}, dataId = { 0x100, 0x200, 0x300, 0x500, 0x600, 0x700, 0x800, 0xA00, 0xB00, 0xF103 , 0xD00}, elements = 11 }, sensorId = {selected = 29, elements = 28}}

Now X8R2ANA works and Gas Suit doesn't, which is fine for me.

Chris


Post Reply

Return to “General help (FrSky Taranis radio)”