Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Telemetry view App #390

Open
kusnendar opened this issue Mar 17, 2021 · 41 comments
Open

Support for Telemetry view App #390

kusnendar opened this issue Mar 17, 2021 · 41 comments
Labels
enhancement 🪄 New feature or request

Comments

@kusnendar
Copy link

I hope ELRS can use Telemetey Viewer App Android/IOS. Telemetry dta transfered from tx to smartphone via smarport + bluetooth module.
Like this: https://youtu.be/lmSMt6JLWL8

@CapnBry
Copy link
Member

CapnBry commented Mar 24, 2021

I was actually playing with this yesterday using the SIYI FM30 which has integrated bluetooth. I modified my RX code to just copy the CRSF telemetry over to the bluetooth (and verified I saw data on my phone) but the Telemetey Viewer app didn't like it. I think it had to do with it trying to auto-detect the protocol and there not being enough valid telemetry in the short time it probes to meet the minimum auto-detect threshold (2 complete sets of telemetry? Link Statistics don't count).

Once the SIYI TX and RX pull requests go through, I'll look at working out with the devs what ELRS will put out as standard and then maybe work to integrate it. The app supports MAVlink v1 and v2, LTM, FrSky S.Port, and CRSF. CRSF would be the easiest since we've already got the data in that format but MAVlink would probably be more compatible.

@kimman1
Copy link
Contributor

kimman1 commented Mar 30, 2021

I was actually playing with this yesterday using the SIYI FM30 which has integrated bluetooth. I modified my RX code to just copy the CRSF telemetry over to the bluetooth (and verified I saw data on my phone) but the Telemetey Viewer app didn't like it. I think it had to do with it trying to auto-detect the protocol and there not being enough valid telemetry in the short time it probes to meet the minimum auto-detect threshold (2 complete sets of telemetry? Link Statistics don't count).

Once the SIYI TX and RX pull requests go through, I'll look at working out with the devs what ELRS will put out as standard and then maybe work to integrate it. The app supports MAVlink v1 and v2, LTM, FrSky S.Port, and CRSF. CRSF would be the easiest since we've already got the data in that format but MAVlink would probably be more compatible.

Can you show me your modify code for copy CRSF tlm ?

@CapnBry
Copy link
Member

CapnBry commented Mar 30, 2021

I've since wiped the code out but all that I did was add a second write to CRSF::handleUARTout():

CRSF::Port.write(OutData, OutPktLen);
bluetooth.write(OutData, OutPktLen); // this line is added
CRSF::Port.flush();

Along with the code in the tx_main to create a HardwareSerial bluetooth(USART2) and set it up

@s2kaka
Copy link

s2kaka commented Apr 8, 2021

hope it will support this app with build in Bluetooth as x-lite pro, t16, t18.

@avsaase
Copy link
Contributor

avsaase commented May 4, 2021

I can confirm this is already functional on a TX16S with a HC05 module connected to the UART.

@TarasTadva
Copy link

Tell me! I have a Jumper t12 transmitter with a FrSky r9m module. There is no built-in UART in the Jumper. How do I use UART in a module? There is a S-port output, and bluetooth telemetry works through it in the FrSky, but after the firmware the Express Lrs does not work (((((

@nightflasher
Copy link
Contributor

Nice start, BUT: make also use of the Bluetooth part of the esp32 modules (mostly ttgo_v1 and ttgo_v2).
Maybe there is someone who can program an smartphone app for changing settings in the module (for those who can't run Lua, like modified or homebrew transmitters) - ttgo T-Watch-2020.

@hyperion11
Copy link

hi! it possible to sent telemetry stream via native s.port pins as stock R9 fw do?
image
HC-06 with inverter
image

@CapnBry
Copy link
Member

CapnBry commented Dec 2, 2021

I believe it is. I think you can also use EdgeTX Telemetry Mirror without an inverter too, on handsets that have a serial port (like the TX16S).

In 2.0, there's also an option to turn on BT Telem in the Lua options for FM30 TX modules. In 2.1 TX modules with backpacks will be able to use wifi mode and connect using a TCP/IP socket connection for a mirror.

@hyperion11
Copy link

I check R9M with this connections. No telemetry. I will try solder BT to pads on QX7 Motherboard and flash to QX7S FW. And check again... it would be nice to use S.PORT pins on R9M module to send telemetry stream...

@brandonrc brandonrc added the enhancement 🪄 New feature or request label Dec 19, 2021
@brandonrc
Copy link
Member

brandonrc commented Dec 19, 2021

@CapnBry so as of 2.1 we should have telemetry view wifi to an app?

With TX's that have the backpack.

@brandonrc brandonrc added the V2.1 label Dec 19, 2021
@CapnBry
Copy link
Member

CapnBry commented Dec 20, 2021

@CapnBry so as of 2.1 we should have telemetry view wifi to an app?

That's the plan. To make it so when the backpack is in wifi mode it has a port open to stream raw telemetry to (and accept config commands too).

@wvarty wvarty removed the V2.1 label Jan 7, 2022
@karl03
Copy link

karl03 commented Jan 15, 2022

That's the plan. To make it so when the backpack is in wifi mode it has a port open to stream raw telemetry to (and accept config commands too).

Will this be Mavlink compatible?

@bike797
Copy link
Contributor

bike797 commented Feb 14, 2022

It would be nice to be able to connect with the android telemetry app using the BLE of the esp32 backpack.

@pkendall64
Copy link
Collaborator

It would be nice to be able to connect with the android telemetry app using the BLE of the esp32 backpack.

The backpack is an 8285 which does not have BLE

@sweebee
Copy link
Contributor

sweebee commented May 8, 2022

@CapnBry any news on this? 😇

@GengKanghua
Copy link

GengKanghua commented Jul 6, 2022

Hello,I have some ideas and have practiced them.

I found that many TX have USB UART for debugging, such as debug_ LOG ,DEBUG_ LOG_ VERBOSE. The UART name is debug_ backpack_ RX and TX. You can find them in the JSON of src/hardware/tx. If I don't use debug, why don't I transmit telemetry information through this UART. https://github.com/ExpressLRS/ExpressLRS/blob/master/src/hardware/TX/BETAFPV%202400%20Nano.json

image

  1. First, set up the toolchain according to the website instructions。https://www.expresslrs.org/2.0/software/toolchain-install/
    My TX is betafpv_ 2400_ TX_ via_ WiFi that controlled by esp32

  2. Then modify TX_ main. cpp

    1. Set baud in the function setuptxpack() to 57600, because this is the requirement of android-taranis-smartport-telemetry

      #if defined(PLATFORM_ESP32) && defined(GPIO_PIN_DEBUG_RX) && GPIO_PIN_DEBUG_RX != UNDEF_PIN && defined(GPIO_PIN_DEBUG_TX) && GPIO_PIN_DEBUG_TX != UNDEF_PIN
        HardwareSerial *serialPort = new HardwareSerial(2);
        //serialPort->begin(BACKPACK_LOGGING_BAUD, SERIAL_8N1, GPIO_PIN_DEBUG_RX, GPIO_PIN_DEBUG_TX);//This is unmodified
        serialPort->begin(57600, SERIAL_8N1, GPIO_PIN_DEBUG_RX, GPIO_PIN_DEBUG_TX);//This is modified
      #elif defined(PLATFORM_ESP8266) && defined(GPIO_PIN_DEBUG_TX) && GPIO_PIN_DEBUG_TX != UNDEF_PIN
        HardwareSerial *serialPort = new HardwareSerial(0);
        serialPort->begin(BACKPACK_LOGGING_BAUD, SERIAL_8N1, SERIAL_TX_ONLY, GPIO_PIN_DEBUG_TX);
      #elif defined(TARGET_TX_FM30)
        USBSerial *serialPort = &SerialUSB; // No way to disable creating SerialUSB global, so use it
        serialPort->begin();
    2. Add a line of code in loop () to send telemetry data through serial port. TELEMETRY_UART should be defined after Stream *TxBackpack; with #define TELEMETRY_UART (*TxBackpack).

       if (TelemetryReceiver.HasFinishedData())
        {
            crsf.sendTelemetryToTX(CRSFinBuffer);
            TELEMETRY_UART.write(&CRSFinBuffer[0],CRSFinBuffer[1]+2);// this line is added
            TelemetryReceiver.Unlock();
        }
    3. My user_defines.txt are as follows:

        -DRegulatory_Domain_ISM_2400
        -DMY_BINDING_PHRASE="***********"
        -DFEATURE_OPENTX_SYNC
        -DUART_INVERTED
        -DAUTO_WIFI_ON_INTERVAL="60"
        -DHOME_WIFI_SSID="*************"
        -DHOME_WIFI_PASSWORD="************"
        -DUNLOCK_HIGHER_POWER
        -DFAST_SYNC
    
    1. Connect TX and phone with one cable, and connect use USB Serial.(Sorry,I can't take pictures of the phone itself)

      imageimage

    2. Enjoy it.

      image

  3. Finally, the performance of this is unknown, because I can't fly in Beijing. Would anyone like to test it. In addition, you can try to connect TX and Rx to Bluetooth or other devices to realize wireless transmission.

@CapnBry
Copy link
Member

CapnBry commented Jul 6, 2022

That's a great bunch of description, but you don't need to do quite all that. All you need to do is one line to mirror everything to the backpack UART (and change the baud):
crsf.PortSecondary = TxBackpack;

@edernucci
Copy link
Contributor

Is this all really necessary? I ask because I use the same application, without any code or backpack changes, just using the USB port of my Radiomaster TX16S with EdgeTX 2.7.

@GengKanghua
Copy link

Is this all really necessary? I ask because I use the same application, without any code or backpack changes, just using the USB port of my Radiomaster TX16S with EdgeTX 2.7.

You are right, it is not necessary for TX16S, but I don't have TX16S R9M or FM30. This is my solution for my existing equipment(TX12).

@ASDosjani
Copy link

Is anyone working on this? It would be good if radios with built in elrs work. The USB of the radio could be used to transmit telemetry data.

@dz0ny
Copy link

dz0ny commented Aug 22, 2022

This is attempt to use BLE on esp32 based tx https://github.com/dz0ny/ExpressLRS/tree/add/ble-telemetry

@dz0ny
Copy link

dz0ny commented Aug 22, 2022

Is anyone working on this? It would be good if radios with built in elrs work. The USB of the radio could be used to transmit telemetry data.

You can already do this in edgetx, VCP mode under Hardware needs to be set as Telemetry Mirror.

@Lance0724
Copy link

This is attempt to use BLE on esp32 based tx https://github.com/dz0ny/ExpressLRS/tree/add/ble-telemetry

If merge that code, can I use telemetry view in my phone or some AAT ?

Has this been tested?

@dz0ny
Copy link

dz0ny commented Oct 19, 2022

This is attempt to use BLE on esp32 based tx https://github.com/dz0ny/ExpressLRS/tree/add/ble-telemetry

If merge that code, can I use telemetry view in my phone or some AAT ?

Has this been tested?

It's missing initial payload that Telemetry view App uses to determine supported protocols, if you add that then it can be used yes.

@Lance0724
Copy link

This is attempt to use BLE on esp32 based tx https://github.com/dz0ny/ExpressLRS/tree/add/ble-telemetry

If merge that code, can I use telemetry view in my phone or some AAT ?
Has this been tested?

It's missing initial payload that Telemetry view App uses to determine supported protocols, if you add that then it can be used yes.

For now It's cannot be used with android-taranis-smartport-telemetry? The problem is android app?
Can I use in U360GTS?
I want use AAT with elrs.

@dz0ny
Copy link

dz0ny commented Oct 19, 2022

This is attempt to use BLE on esp32 based tx https://github.com/dz0ny/ExpressLRS/tree/add/ble-telemetry

If merge that code, can I use telemetry view in my phone or some AAT ?
Has this been tested?

It's missing initial payload that Telemetry view App uses to determine supported protocols, if you add that then it can be used yes.

For now It's cannot be used with android-taranis-smartport-telemetry? The problem is android app? Can I use in U360GTS? I want use AAT with elrs.

No my patch needs a bit more work :) Without additional work it cannot be used.

@Lance0724
Copy link

This is attempt to use BLE on esp32 based tx https://github.com/dz0ny/ExpressLRS/tree/add/ble-telemetry

If merge that code, can I use telemetry view in my phone or some AAT ?
Has this been tested?

It's missing initial payload that Telemetry view App uses to determine supported protocols, if you add that then it can be used yes.

For now It's cannot be used with android-taranis-smartport-telemetry? The problem is android app? Can I use in U360GTS? I want use AAT with elrs.

No my patch needs a bit more work :) Without additional work it cannot be used.

Out of the blue, do you have plans to complete it?
I'm really looking forward to this feature
I don't want to add a bluetooth module to my transmitter

@dz0ny
Copy link

dz0ny commented Oct 19, 2022

This is attempt to use BLE on esp32 based tx https://github.com/dz0ny/ExpressLRS/tree/add/ble-telemetry

If merge that code, can I use telemetry view in my phone or some AAT ?
Has this been tested?

It's missing initial payload that Telemetry view App uses to determine supported protocols, if you add that then it can be used yes.

For now It's cannot be used with android-taranis-smartport-telemetry? The problem is android app? Can I use in U360GTS? I want use AAT with elrs.

No my patch needs a bit more work :) Without additional work it cannot be used.

Out of the blue, do you have plans to complete it? I'm really looking forward to this feature I don't want to add a bluetooth module to my transmitter

When time permits, not sooner than in couple of months :) Other developers also suggested this should be moved to backpack to prevent for it to interfere with critical code used in TX.

@Lance0724
Copy link

It would also be nice to move this feature to the backpack

@pranas
Copy link

pranas commented Nov 7, 2022

I'm also interested in a "Telemetry Receiver" backpack. I would like a firmware for RXs that would allow them to bind, receive telemetry and spit it out via serial using CRSF protocol. This would enable building a lot of interesting things like an antenna tracker backpack. I guess I will have to get myself familiar with the codebase 😃 Is there anyone who could give me a jumpstart on how to approach this?

@derFrickler
Copy link
Contributor

derFrickler commented Dec 23, 2022

Thanks for this thread! I just connected a HC-05 with the inverter transistor mod to the DIY 2.4 ELRS module in my QX7 and i directly get telemetry data in the App without needing to change anything in OTX. As i had already set the CRSF protocol to 115200 in OTX.

Can anyone tell me if this will work with the DIY module in my Jumper T-Lite aswell? What baudrate does the T-Lite use for the external CRSF Module?

@pranas Great Idea with using an ELRS receiver to just receive telemetry data. Had the same thought yesterday before finding this thread.

@RomanLut
Copy link

Finsihed implementation and submitted pull request #2018

@RomanLut
Copy link

RomanLut commented Dec 25, 2022

Can anyone tell me if this will work with the DIY module in my Jumper T-Lite aswell? What baudrate does the T-Lite use for the external CRSF Module?

Well as you said it uses speed which you set in opentx. And you have to set it to 115200 because HC-05 can not handle default 400000 baud.

@RomanLut
Copy link

It's missing initial payload that Telemetry view App uses to determine supported protocols, if you add that then it can be used yes.

Telemetry viewer app does not need any initial payload. It will start decoding once 3 successull CRSF packets are received.
Actually the problem was that TELEMETRY_CRSF_UUID = 0x2A4D is some unlucky UID number - nothing is transmitted. If you change it, everything works fine.

@derFrickler
Copy link
Contributor

Well as you said it uses speed which you set in opentx. And you have to set it to 115200 because HC-05 can not handle default 400000 baud.

There is no option to set it in OTX on the T-Lite, thats why i was asking if somebody knows the used speed.

Great that it will work even without the HC-05 with your patch, can't wait to see it included.

@RomanLut
Copy link

RomanLut commented Dec 26, 2022

There is no option to set it in OTX on the T-Lite, thats why i was asking if somebody knows the used speed.

I thought latest opentx has is, but I did non try it myself. Flashed EdgeTx, there is an option to set crsf baud rate on t-lite.

@derFrickler
Copy link
Contributor

YES, baud-rate option appeared after updating to the latest OTX version. Will try edgeTX on my backup T-Lite

@derFrickler
Copy link
Contributor

Short feedback, hc-05 with the transistor inverter and module and otx set to 115200 baud works just fine.
Now I've got a Jumper T-Lite with 5in1 and BT-telemetry, all build-in 👍

@endymuhardin
Copy link

Hopefully #2305 will finally put this issue to rest :D

@dang-itt
Copy link

dang-itt commented Aug 21, 2023

Is it possible to connect the HC05 module with inverter to the JR bay S-Port? That way it would constantly be sending S-port telemetry which is what I assume the R9m module does anyway. (I assume the R9m module S-port is just passthrough of the radio s-port)

edit: with an elrs module installed in the jr bay at the same time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🪄 New feature or request
Projects
None yet
Development

No branches or pull requests