Sport sensor to hub protocol converter
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Sport sensor to hub protocol converter
It seems many of the original hub type sensors are being/have been discontinued. It should be possible to program an Arduino mini, or something similar, to 'talk' to Sport sensors, and output the old hub protocol for use by 'D' series receivers.
Is there much interest in this?
Mike.
Source code:
Is there much interest in this?
Mike.
Source code:
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
- bob195558
- Posts: 2377
- Joined: Sun Dec 16, 2012 7:24 pm
- Country: United States
- Location: New England, Vermont
- Contact:
Re: Sport sensor to hub protocol converter
Hi Mike,
I think I will be in the future, want this ability.
Bob B.
I think I will be in the future, want this ability.
Bob B.
Er9x on 9x radio, with Smartieparts Programmer and TelemetrEZ Board.
ErSky9x on Taranis, Sky9x, 9Xtreme radios.
3D-Printing: (https://openrcforums.com/forum/viewforum.php?f=129).
ErSky9x on Taranis, Sky9x, 9Xtreme radios.
3D-Printing: (https://openrcforums.com/forum/viewforum.php?f=129).
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Sport sensor to hub protocol converter
I've made a bit of a start on code for an Arduino mini to do this. It's a bit of a side project at present, too many other things to do!
Mike.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
- bob195558
- Posts: 2377
- Joined: Sun Dec 16, 2012 7:24 pm
- Country: United States
- Location: New England, Vermont
- Contact:
Re: Sport sensor to hub protocol converter
Hi Mike,
No hurry as of yet, I have what need for now.
Bob B.
No hurry as of yet, I have what need for now.
Bob B.
Er9x on 9x radio, with Smartieparts Programmer and TelemetrEZ Board.
ErSky9x on Taranis, Sky9x, 9Xtreme radios.
3D-Printing: (https://openrcforums.com/forum/viewforum.php?f=129).
ErSky9x on Taranis, Sky9x, 9Xtreme radios.
3D-Printing: (https://openrcforums.com/forum/viewforum.php?f=129).
Re: Sport sensor to hub protocol converter
Is it possible to create a D8 protocol (old hub) to D16 protocol (S.Port) bridge using a ProMini or a Teensy 3.1 instead of having to use a Variometer Sensor as a bridge. ??
This would be great as I have 3 TGY 9x tx's using opentx with XJT modules and FLD-02 display screens attached..
Garry S.
This would be great as I have 3 TGY 9x tx's using opentx with XJT modules and FLD-02 display screens attached..
Garry S.
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Sport sensor to hub protocol converter
I should be possible, I hadn't considered doing anything for this because the variometer does provide that function, and I thought the low precision one was not so costly.
Mike.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
Re: Sport sensor to hub protocol converter
The variometer does provide the function at the cost of overwriting the altitude data sent by the Flight Controller to the FLD-02 display through a X8R receiver.
I was hoping to be able to use the data supplied by the FC, mainly because the APM resets the altitude to 0 automatically at arming.
Garry S.
I was hoping to be able to use the data supplied by the FC, mainly because the APM resets the altitude to 0 automatically at arming.
Garry S.
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Sport sensor to hub protocol converter
I've found a bit of time to re-visit this project.
I've got the 'bottom level' drivers all working. The Pro Mini is polling the SPort, receiving data from a FrSky Vario, and sending out the raw data received in a 'hub' protocol.
Mike.
I've got the 'bottom level' drivers all working. The Pro Mini is polling the SPort, receiving data from a FrSky Vario, and sending out the raw data received in a 'hub' protocol.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
- bob195558
- Posts: 2377
- Joined: Sun Dec 16, 2012 7:24 pm
- Country: United States
- Location: New England, Vermont
- Contact:
Re: Sport sensor to hub protocol converter
I am still interested as I still and have the need and see others who have DJT modules
with D8R-II Plus / D8R-XP receivers and not able to find telemetry D-Series sensors.
To have the ability to connect S.Port telemetry X-Series sensors through a Pro Mini Atmega328
to output the old hub protocol for use by 'D' series receivers would be great!
Bob B.
with D8R-II Plus / D8R-XP receivers and not able to find telemetry D-Series sensors.
To have the ability to connect S.Port telemetry X-Series sensors through a Pro Mini Atmega328
to output the old hub protocol for use by 'D' series receivers would be great!
Bob B.
Er9x on 9x radio, with Smartieparts Programmer and TelemetrEZ Board.
ErSky9x on Taranis, Sky9x, 9Xtreme radios.
3D-Printing: (https://openrcforums.com/forum/viewforum.php?f=129).
ErSky9x on Taranis, Sky9x, 9Xtreme radios.
3D-Printing: (https://openrcforums.com/forum/viewforum.php?f=129).
- KAL
- Posts: 552
- Joined: Thu Oct 10, 2013 4:36 pm
- Country: Germany
- Location: somewhere near Rothenburg ob der Tauber
Re: Sport sensor to hub protocol converter
I wonder whether this could also be added to OpenXSensor?
Klaus
Klaus
( TH9X / 9XTreme / FrSky DHT / Spektrum / Multi / RotEnc )
( 9XR PRO / erSKY9x / FrSky DHT / Spektrum / Multi / RotEnc / P3 as Slider )
( 9XR PRO / erSKY9x / FrSky DHT / Spektrum / Multi / RotEnc / P3 as Slider )
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Sport sensor to hub protocol converter
Probably asking a lot of it as it has to poll the SPort bus while still sending the hub serial data.
Mike.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Sport sensor to hub protocol converter
I've now sorted most of this so it polls all the possible physical IDs, but when it finds any that respond it polls them more frequently.
It handles all the checksums and byte stuffing.
It's sending hub data, and I've put that into a D8R-II, and received data on the Tx.
"All" I need to do now is process the actual data from SPort sensors and convert it into the correct format for the hub protocol.
So far, I've only implemented the FrSky vario, since I have one not in use. Almost not needed, as the vario by itself sends hub protocol, although I am sending the vertical speed (using the openXsensor ID) that isn't normally sent by the vario over the hub protocol.
Which SPort sensors does anyone want converted?
Mike.
Edit: Source code now on the first post.
It handles all the checksums and byte stuffing.
It's sending hub data, and I've put that into a D8R-II, and received data on the Tx.
"All" I need to do now is process the actual data from SPort sensors and convert it into the correct format for the hub protocol.
So far, I've only implemented the FrSky vario, since I have one not in use. Almost not needed, as the vario by itself sends hub protocol, although I am sending the vertical speed (using the openXsensor ID) that isn't normally sent by the vario over the hub protocol.
Which SPort sensors does anyone want converted?
Mike.
Edit: Source code now on the first post.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Sport sensor to hub protocol converter
Just posted, on the first post, a second version with support for the FLVSS.
Mike.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Sport sensor to hub protocol converter
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Sport sensor to hub protocol converter
New version posted on the first post and committed to Github.
Supports RPM, Temp1, FAS voltage and current, FLVSS Vario.
It includes GPS Lat and Long, but I haven't tested this yet, I haven't got a lock with my SPort GPS sensor.
Mike.
Supports RPM, Temp1, FAS voltage and current, FLVSS Vario.
It includes GPS Lat and Long, but I haven't tested this yet, I haven't got a lock with my SPort GPS sensor.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Sport sensor to hub protocol converter
GPS Lat/Lon now working, new sources on first post and Github.
Mike.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
Re: Sport sensor to hub protocol converter
Hi Mike,
What about designing a new telemetry module for the V2 Orange Rxs with such a range of sensors, today the Orange range is very poor...
Michel
What about designing a new telemetry module for the V2 Orange Rxs with such a range of sensors, today the Orange range is very poor...
Michel
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Sport sensor to hub protocol converter
That is much more complicated as it includes an RF section and the code to actually transmit the telemetry data while monitoring the receiver DSM control data.
I don't have the information to do that.
Mike.
I don't have the information to do that.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Sport sensor to hub protocol converter
Latest (on first post and Github), now includes GPS speed, altitude and course. Until I get this in a 'plane and test fly it I can't really test how well these work, although I am getting a speed reading when walking around my back garden.
Mike.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
Re: Sport sensor to hub protocol converter
Mike,
Are you interested to put this code on an Attiny85?
I know you have that SportinyAnalog code for X8R I think it can be modified easier for SPORT to Hub converter.
It will be much smaller board too.
Are you interested to put this code on an Attiny85?
I know you have that SportinyAnalog code for X8R I think it can be modified easier for SPORT to Hub converter.
It will be much smaller board too.
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Sport sensor to hub protocol converter
I may look into that.The biggest problem is the lack of a 16-bit timer. The code currently relies on one of those. I don't think it will be so easy to change the code to use just an 8-bit timer.
It may also depend on how big the code/data gets.
Mike.
It may also depend on how big the code/data gets.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
Re: Sport sensor to hub protocol converter
There are many software serial codes on the net on attiny that use 8 bits timer interrupt.If you are interested I can attach some here.The baudrate is low enough so I think it will work just fine on 8Mhz internal clock.
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Sport sensor to hub protocol converter
Its not quite that straightforward. There are two serial ports, both software driven, at different baudrates. One or other of these are active most of the time, so I use interrupts on each bit to leave processor time for other processing. Due to the timing, I don't use the standard millis() routine, which uses interrupts, but use my own that doesn't use interrupts, but does use the 16-bit timer.
Mike.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
Re: Sport sensor to hub protocol converter
Just speculating if you use one 8 bits timer / or 2 for both and stop SPORT poling/listening while you send out Hub bytes,and listening for SPORT packets in between HUB frames.The hub frame are sent 1 every 200ms second every 1 sec and third every 5 sec.In fact you can send out HUB frame at the time interval you choose.
The max bytes on full hub frame are around 50 bytes(mores with stuffed) that is roughly 50 ms...The SPORT frame can be polled/listen in between..200-50= min 150ms for SPORT and processing.This is not exact calculation,is rounded.Again just speculating.
What do you think?
The max bytes on full hub frame are around 50 bytes(mores with stuffed) that is roughly 50 ms...The SPORT frame can be polled/listen in between..200-50= min 150ms for SPORT and processing.This is not exact calculation,is rounded.Again just speculating.
What do you think?
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Sport sensor to hub protocol converter
The SPort needs to be polled every 12mS, around 83 times per second.
The nominal definition for the SPort is use 4mS to send a poll, 4mS to receive any response then 4mS idle. What I do is to use the third 4mS time slot to send 4 bytes of hub data, so I do avoid overlapping the two serial operations.
I am about to order a couple of Tiny85 processors, so I will be able to investigate possibilities.
Mike.
The nominal definition for the SPort is use 4mS to send a poll, 4mS to receive any response then 4mS idle. What I do is to use the third 4mS time slot to send 4 bytes of hub data, so I do avoid overlapping the two serial operations.
I am about to order a couple of Tiny85 processors, so I will be able to investigate possibilities.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
Re: Sport sensor to hub protocol converter
I have no original SPort sensors, but tested this with my self made ones.
A few observations:
I get data for Alt and Vspd, even without any sensor connected. With a vario connected, Alt alternates between actual value and zero.
When I connect a FAS like sensor, VFAS and Current also alternates between actual values and zero.
It will continue to send last values even if SPort data is lost (no timeout).
Fred
A few observations:
I get data for Alt and Vspd, even without any sensor connected. With a vario connected, Alt alternates between actual value and zero.
When I connect a FAS like sensor, VFAS and Current also alternates between actual values and zero.
It will continue to send last values even if SPort data is lost (no timeout).
Fred
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Sport sensor to hub protocol converter
As I started with just a vario connected and processed the code does indeed always send hub values for this. I will need to make it conditional on seeing a vario connected.
With FrSky SPort devices I don't see alternating zeroes.
Currently you are correct in that once data has been received from a device, ad stored on the converter, it will continue to send the stored values, even if no further data arrives from the SPort device.
Mike.
With FrSky SPort devices I don't see alternating zeroes.
Currently you are correct in that once data has been received from a device, ad stored on the converter, it will continue to send the stored values, even if no further data arrives from the SPort device.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
Re: Sport sensor to hub protocol converter
Mike ,
I uploaded the SPort to hub code in a promini and use it with openx sensor.
I hooked up a logic analyzer to see the signal.
There is some corrupted data received. I test the same sensor with RX X4RSB and it seems to be working fine with the same sensor.
I attached the screen capture from analyzer.After polling those 2 bytes 0x7E and sensor ID ,,the first byte received is not 0x10 as it should be but 0x20 frame error.I think the next sport frame bytes are ok.All the frames received start with 0x20 corrupt header.
I uploaded the SPort to hub code in a promini and use it with openx sensor.
I hooked up a logic analyzer to see the signal.
There is some corrupted data received. I test the same sensor with RX X4RSB and it seems to be working fine with the same sensor.
I attached the screen capture from analyzer.After polling those 2 bytes 0x7E and sensor ID ,,the first byte received is not 0x10 as it should be but 0x20 frame error.I think the next sport frame bytes are ok.All the frames received start with 0x20 corrupt header.
Last edited by midelic on Sun May 29, 2016 5:25 pm, edited 1 time in total.
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Sport sensor to hub protocol converter
I thought you could select hub protocol on the openRxSensor, so not need this.
I can see a short spike at the beginning of the 0x20, that shouldn't be present. That may be shifting the bits a small amount causing 0x10 to appear as 0x20.
Mike.
I can see a short spike at the beginning of the 0x20, that shouldn't be present. That may be shifting the bits a small amount causing 0x10 to appear as 0x20.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!