brushlesspower / sbus2-telemetry Goto Github PK
View Code? Open in Web Editor NEWArduino Library for SBUS and SBUS2 with Futaba Telemetry
License: GNU General Public License v3.0
Arduino Library for SBUS and SBUS2 with Futaba Telemetry
License: GNU General Public License v3.0
R7003SB did not work
R7008SB work on the same Sketch and Hardware Setup
SBUS2 Signals are not transmitted properly
Hello, is it possible to make it compatible with frsky fport and fport2? :-)
Hello, great work..
I have it running on the ESP32. Do you have idea on how to make it work on the SMT32F103 / F405 etc.
They do support RTOS :-)
Many Thanks
Richard
SBUS is inverted Half Duplex UART Signal
The ESP32 should be able to handle RX/TX on one Pin
RS485 Half Duplex Mode?
RX/TX switch with a spare pin?
frame_ready is true for a valid received SBUS Frame
for SBUS2_get_servo_data() there should be a buffer for the last valid SBUS frame.
Why checking SBUS2_Ready()?
Does Is there any planning for compatibility with Teensy?
Sensor Slots 8 to 31 transmit wrong Slot ID
The USART RX Interrupt is processed 700µs after the SBUS Frame
This could be a Problem with the ESP32 FIFO and Interrupt source:
Interrupt is activated by Fifo full event (120Bytes) or RX Timeout
Here some facts and a possible fix
If using Slot 2 and Slot 6, there is a wrong Delay on the SBUS2 Signal.
Slot 6 is on the Timing of Slot 5
You shouldn't skip Slots
there are different input types for LON and LAT
actual accepted:
Degree Minutes as integer -> 52312499 (52 Degree 31.2499 Minutes)
other possible types:
Degree Minutes as float -> 52.312499
Decimal as integer -> 52520833
Decimal as float -> 52.520833
so there should be a bool for the Input Type on the GPS Sensor
Integer:
void send_f1675_gps(uint8_t port, uint16_t speed, int16_t hight, int16_t vario, int32_t latitude, int32_t longitude, bool Decimal);
Float:
void send_f1675_gps(uint8_t port, uint16_t speed, int16_t hight, int16_t vario, float latitude, float longitude, bool Decimal);
Will this library allow me to also get frame loss and holds etc on the radio?
Second, do you have a wiring schematic for Arduino itself?
Third, is the code provided for all the supported sensors? if so, the sensors that I do not want to use, can I remove that section of code?
Last question, can someone translate the schematic into words? I'm not very good with visual schematics etc, hence.
For testing Sensors (without Futaba Radio) you would need an Output of SBUS2 Frames
together with #36 you have a complete Simulation for testing ESP32 and Futaba Sensors
The Telemetry Send Timer has to be extended that it's send SBUS2 Data in Demo Mode.
Function is already finished for #36 and must be tested and locked against unwanted start.
Hello BrushlessPower ,
First of all, thank you for your effort and desire to share your project with others.
Excellent work !!!
Following your instructions I am trying to visualize Futaba telemetry parameters for a new big plane project that I am doing. This aircraft has a four-cylinder DLE 222 engine installed and I would like to visualize the four temperatures of the engine cylinder heads and the interior of the plane. ( five temperature sensor totally )
Also the RPMs and the voltage of the four batteries. In principle I do not need GPS although I do not rule out later using it but if necessary I can do without it.
My initial problem is that I can only display the RPMs, neither the temperature sensor, nor the GPS, etc. etc. appears, also when initializing the variometer it indicates +255.5m/s and at the same time that the RPMs are shown the value of the variometer changes to -64.5m/s
https://drive.google.com/file/d/1NBS2yBeSfRPz0MLVWmmkfSwXrp879I96/view
https://drive.google.com/file/d/1qUmKyzaBxOAnVxb1mKAuKPJhlGejBZo3/view
https://drive.google.com/file/d/1Jl31XbzBUovFmRNBtNpjTzZlcI4S-0z4/view
I have tried with arduino atmega 328P at 3.3V 8Mhz and also at 5V and 16Mhz but the result is the same.
I don't have GPS connected.
The configuration of Futaba is T18SZ and two receivers R7108SB dual mode and FassTest 18ch
This afternoon I will try a single receiver and other types of modulation that include telemetry and I will report if I have had any progress but in any case I will need to make it work at least in FassTest 12ch and two receivers.
Any guidance or advice of what you think I am doing wrong and for that reason I cannot make it work I will thank you very much.
In any case, thank you very much for your time and help!
Best regards,
Chema
Hi,
I use your library to make some sensor ( Temperature, GPS,...). if i plug only 2 sensors on the receiver with different slot everything is working perfectly.
But if i plug 3 sensors the telemetry on esp32 stop working, i have to stop one oh the three sensor to make it working again
Is there a limitation or something wich can explain these issue ?
Thanks
Julien
Hi,
Thanks for all your work,
I have a problem with negative GPS coordinates for South and West, it's working fine with positive (North and East).
If i use the coordinate
int32_t latitude = -52312499; // =S 52° 31.2499 = N 52.520833 = N 52° 31' 14.9988"
int32_t longitude = -13245658; // = W 13° 24.5658 = E 13.409430 = E 13° 24' 33.9480"
The radio display S 205°13.6077, W 244°20.2918
Any idea ?
Thanks
Julien
Actually the Current Sensor can handle Integer Values, for example 20 for 20A
The T14SG display a Current of 20.0A
The Protocol of the Sensor can handle decimal Values. For example 1234 for 12.34A
In the T14SG it should be displayed as 12.3A
Examples don't actually compile for ESP-32:
In function 'void setup()':
SBUS:16:20: error: too many arguments to function 'void SBUS2_Setup()'
SBUS2_Setup(25,26); // For ESP32 set RX and TX Pin Number <<--- this doesn't work
Originally posted by @Nellophonic in #44 (comment)
This is probably not an issue with the library but I'm using an Uno with an SN74HC IC and it's not sending any telemetry data. Maybe there is a way to conversate about a solution.
Hello
first of all thank you for your work in creating this library. I wanted to ask about the problem. I have T16SZ, Atmega328P with GPS neo-6m and BMP180 pressure / temperature sensors connected according to your scheme with BC547 transistors.
Regarding the problem, based on the attached SUBS example, if I create a variable that I increment 1 to in each pass (or even sending const numbers) and send it to the appropriate slots, everything works fine for an infinite time. But if I start processing data from the GPS sensor, some slots values (e.g. 7 out of 12) get stuck after about 30-60 seconds and stop updating on the radio. If I'm processing data from the BMP180, the hang will only show up after 2+ minutes. The only thing that helps is restarting the arduino.
As a walkaround, I found a way connecting second arduino, which has a GPS and BMP180 sensor connected and communicates with the SBUS arduino using I2C. The jam didn't happen here, I had the build running like this for a few days without any issues.
Even though you state that Softserial can be used, I found that it also uses TIMER 2, it would also correspond to me that as soon as the data starts going over the Softserial, there will be a jam. It also seems to me that the jamming during IC2 communication is only when the SBUS arduino is in the role of I2C Master, as I write above, if it is in the role of 2C slave, then the jam occurs.
Is this a lack of the library or should I look for flaws in my codes / wiring?
Hi,
Hi,
Thank you for your work, i tried to use your sbus2 telemetry on ESP32
Can you tell me on which port i have to connect the SBUS2 signal, tx0/rx0 ? other ?
Do i need a resistance between tx/rx ?
Thanks
Julien
Hello
Great lib ! Works perfectly with a R304SB and a 4px. Just this question because the sensor is only 1 canal and i cant see the first voltage on my radio, only the second one is displayed.
Thanks !
RPM Sensor has uint16_t Data Type
this means a maximum RPM Value of 65.535 RPM
The original Futaba RPM Sensor has a maximum of 300.000 RPM
So the Input Datatype should be uint32_t
That's it GPS seems to have an error.
latitude = 52312499 is 52312499 as Display
latitude = 52612499 displays latitude = 53012499
If the third digit is greater than five, four is added to the third digit.
and longitude has the same problem.
https://www.rcgroups.com/forums/showpost.php?p=42932981&postcount=20
Adding ESP32 support is actual in progress
there is some decoding done
i cant check it with T14SG
But i will try to add the Sensor with the known Data
Hi,
I'm working on the code to adding the GPS sensor SBS-02G. For the moment i manage to send the altitude, variometer and the pressure. But i'm stuck by the latitude and the longitude.
The latitude is coded on 26 bit wich can have the maximum value 67 108 864, insuffisant for 90°. According to my test the value of the bit is not always a power of 2.
Here the detail of the 26 bit :
55554432, 27577216, 13588608, 6594304, 3297152, 1448576, 524288, 262144, 131072, 65536, 32768, 16384, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1
Same thing with the longitude but this time with 27 bit :
111508864, 55554432, 27577216, 13588608, 6594304, 3297152, 1448576, 524288, 262144, 131072, 65536, 32768, 16384, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2,1
I tried to make a fonction to convert value with this bit but the radio display different value. Depending on the case i have the following difference between the send value and the display.
2400000, 2000000, 1600000, 1200000, 800000, 400000, 0
The difference depend of the coordonate
Have you ever seen this king of compression to transmit high value with less bit ?
Thanks
Hi, first of all big thanks to this amazing library! I want to make my own rpm sensor for my plane, i can send values to the futaba receiver from my esp32 but i have problem with rpm, for example i use "send_RPM(RPM_SLOT,(uint16_t) 500);" and in futaba i have the number 62 in this slot(of course i have set the slots and the sensors from futaba settings). I try with voltage and it works, i know that it must be something in conversion of the number in the code or in futaba. Do you know what is wrong?
Thank you for your time.!
Actual supported:
SBS/01TE -> Temp Sensor
SBS/01RB ->RPM Sensor
SBS-01RM -> RPM Sensor
SBS-01RO -> RPM Sensor
F1713 -> Temp Sensor
F1678 -> Power Sensor
F1675 -> GPS Sensor
comming soon:
SBS/01V -> Voltage Sensor
F1672 -> Vario
F1712 -> Vario
Not Documented:
SBS-01G -> GPS Sensor
SBS-01G -> GPS Sensor
SBS/01S -> Servo Sensor
SBS-0 1 TAS -> True Airspeed Sensor
F1677 -> True Airspeed Sensor
SBS/01C -> Current Sensor (maybe similar to F1678)
P-SBS/01T -> Temp 200 Sensor (maybe similar to SBS/01TE )
SBS/02A -> Vario (maybe similar to F1672 or F1712)
SBS/01A -> Vario (maybe similar to F1672 or F1712)
related to #30
Sometimes it could be necessary to Disable the SBUS Processing. For example writing to Flash (causing Crash).
So there should be a function to disable/enable UART and Timer Interrupt
actual these types cant compile because of missing stuff
SBUS2 Protocol has a Frame Error Rate (RSSI)
There should be a function to get this Value.
http://www.futaba-forum.net/showthread.php?7674-R7008SB-Empfangsst%E4rke-RSSI-verwenden/page2
Maybe its Decoded in Byte 23 Bit 0 to 3
With Version 1.0 I've added more Power Sensors following the existing Futaba Sensors
But with my T14SG i can't test all of them, because the T14SG doesn't support them all.
So it would be great, if someone could test the following Sensors:
Sensor SBS01V
Sensor F1678
Sensor SBS01C
Code doesnt compile with ESP32 Arduino Core V2.0.0
Hello there!
I started to study GPS. Currently the data transmission is normal, but the latitude and longitude display of GPS is inconsistent.
Remote control and receiver, 18SZ + R7008SB.
According to the example in your code, only the decimal point of the latitude and longitude in the GPS data is removed.
For example: GPS data format of NMEA01843
N 3029.52639, displayed as N 47 ° 35.2783
E 11425.15639, displayed as E 118 ° 51.5596
The last degree value may be inconsistent with the original GPS data,
The delay in the display prevented me from maintaining complete accuracy between them.
In addition, in the sample program
In the setup () section, why do latitude and longitude increase by 100?
What is the impact of not increasing by 100?
In your and others' information, I also modified the SBUS2.cpp file.
The following code is used:
`
// LATITUDE
if(latitude >= 0){
latitude_pos = true;
}
else{
latitude_pos = false;
latitude = latitude * -1;
}
bytes[1] = (uint8_t)(latitude/1000000);
value3 = (uint32_t)(latitude%1000000);
if(_latitude >= 0){
bytes[2] = ((value3 >> 16) & 0x0f); // North
}
else{
bytes[2] = ((value3 >> 16) & 0x10); // South
}
SBUS2_transmit_telemetry_data( port+4 , bytes);
bytes[1] = ((value3 >> 8) & 0xff);
bytes[2] = value3 & 0xff;
SBUS2_transmit_telemetry_data( port+5 , bytes);
// LONGITUDE
if(longitude >= 0){
longitude_pos = true;
}
else{
longitude_pos = false;
longitude = longitude * -1;
}
bytes[1] = (uint8_t)(longitude/1000000);
value3 = (uint32_t)(longitude%1000000);
if(_longitude >= 0){
bytes[2] = ((value3 >> 16) & 0x0f); // Eath
}
else{
bytes[2] = ((value3 >> 16) & 0x10); // West
}
SBUS2_transmit_telemetry_data( port+6 , bytes);
bytes[1] = ((value3 >> 8) & 0xff);
bytes[2] = value3 & 0xff;
SBUS2_transmit_telemetry_data( port+7 , bytes);
`
Thanks for this nice library, I'm starting to play with it. I have a Futaba 10J and am planning to add a flow meter (like this one) between the fuel tank and the engine.
Do you think this could work?
Which sensor do you think is best to use to push the telemetry data to my transmitter, voltage or current?
With Version 1.0 I've added more Temperature Sensors following the existing Futaba Sensors
But with my T14SG i can't test all of them, because the T14SG doesn't support them all.
So it would be great, if someone could test the following Sensors:
Sensor SBS01T
Sensor SBS01TE
Sensor Temp125
Sensor F1713
Hello,
is it possible to use this lib to read SBUS2 sensor data to Serial monitor / PC? o create a sort of sensor data sniffer.
i have an application where i like to take existing sensors data (sbus2) and display it on a PC.
for this purpose i have some ESP32 and arduino boards i can use.
thanks.
If the SBUS(2) Signal is broken (wire broken, disconnected or receiver unpowered) the SBUS_Ready() function would return true forever.
There should be a reset of sbus_ready and telemetry_ready.
The Functions will be false until a new SBUS(2) Frame is received
Altitude of GPS Sensor is always 0m RC Groups
Simulation showed that the Altitude is always 0xC000
There is a Bug for using ESP32 with this SBUS2 Library and write/read internal Flash
If ESP32 does a Flash read/write and a Interrupt occure (For Example receiving SBUS(2) or transmit Telemetry) the ESP32 crashes.
This is a known Bug, but i never thought about.
All SBUS(2) ISR (and it's called functions) have to run in IRAM
i will do some test and upload the fixed Bug.
Maybe it related to Issue #21 there where also mysterious Crash while using I2C
With Arduino Core Version 1.0.5 the Slot Timings are wrong
I have successfully make it work on receiver R3001SB. However it can't work with R7108. The slot 8-slot 31 just can't work. But the slot0-slot7. Why?
I asked chatGPT what's the scheme of the sbus2. It says the sbu2 telemetry frame should have a sync pulse at the beginning of it. Why I can't see any code of the sync pulse in your code?
Sbus.Begin(RX_PIN, TX_PIN);
Sbus.SetPins(RX_PIN, TX_PIN);
something like this
Hi,
Thank you for your work on the sbus2. But I don't see any code for logining ro the remote controller. Since every sbus2 device should be login to the remote controller by plugging the sensor into the remote controller first. Or it can't be display on the sensor's interface screen. How do you overcome for the problem?
I just had this one.Thanks
UART_dropped_frame is a value for complete lost of a Frame on the SBUS line
so....that is something that should be always zero!
But if you Hot-Plug a Sensor to the SBUS(2) Port it could be possible to lost a Frame.
So with Checking SBUS2_get_status() this value should be cleared.
ESP32 and Atmega
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.