DeviationTX / deviation

Custom firmware for RC Transmitters
http://www.deviationtx.com
GNU General Public License v3.0
247 stars 153 forks source link

Support ELRS on T8SG V2 Plus #1038

Open albfan opened 1 year ago

albfan commented 1 year ago

From this closed PR https://github.com/DeviationTX/deviation/pull/1009, looks like at least from 4Jan 2022, ELRS (Express LRS) is supported out of the box.

Since last firmware availiable from T8SG V2 Plus are from 2021:

https://www.deviationtx.com/downloads-new/category/2830-2021-06-11

wonder if this feature is really supported but there's no firmware available.

So I build from sources the firmware using docker:

https://www.deviationtx.com/wiki/development/docker

NOTE1: I tried using podman but start do not do anything NOTE2: I need to give correct permissions to volumen using :z

docker pull deviationtx/deviation-docker
mkdir devo_builds
docker create -it -v $PWD/devo_builds:/release:z --name deviation_build deviationtx/deviation-docker
docker start -it deviation_build

After succesfully build ( I disable default and emu_default, just enable t8sg_v2_plus)

I upload firmware on device.

As far as I know, ELRS needs to use CRSF (right) but nothing happens on modules.

I use R9M and R9MX (flashed with ELRS 3.2.0, with passhphrase, so not bind is needed):

image

but nothing happens on transmitter and receiver (transmitter blinks red and green) while receiver blinks red.

To confirm if I did something wrong, I flash a flysky fs-i6x with a modified opentx:

https://github.com/OpenI6X/opentx/releases/tag/openi6x-1.9.0

and after configure external module to CRSF, transmitter stays in green and receiver stays in green and red led.

Connecting to betaflight I can see receiver tab correctly update axis info:

image

So asking for help:

hexfet commented 1 year ago

I replied to your post on the DeviationTX forum before looking here. 408f8c0 is the latest and does support CRSF and ELRS in particular. A hardware mod is needed on the t8sg - details in the user manual protocols chapter.

However I think there may be an issue with the R9M. Deviation outputs a non-inverted signal on the pin used for CRSF. Since the R9M is from Frsky it probably expects an inverted signal. Can you check what the s.port pin looks like with the fs-i6x?

albfan commented 1 year ago

I tried your nightly build and looks the same as my local build. As commit is the same I just can tell by this menu on CSRF:

crsf-protocol.jpg.jpg

Anyway I install from your nightly https://www.deviationtx.com/downloads-new/category/2881-hexfet-nightly-build?download=47857:deviation-t8sg-v2-plus-v5-0-0-408f8c0-zip

But other videos I see around show the correct external module connected (with name not this model 1).

The hardware mod I think is related with connect t8sg pin1 with s.port. I did it temporarily this way:

r9m-t8sg-conn.jpg.jpg

but R9M keeps blinking red and green.

On frsky fs-i6x it stays green, and receiver stays green and red at same time.

Some details about the ports on R9M transmitter internals (I think GND, 5V and s.port are the same)

R9m-internal-port.jpg

r9m-external-por.jpg

As said, I can build and make test (hardware and software) somehow I'm missing something but not sure what

hexfet commented 1 year ago

I think it must be that the R9M expects an inverted signal. The t8sg can only output a non-inverted signal. On ESP32-based tx modules the ELRS configurator provides a checkbox for selecting inverted or non-inverted input. That option is not available for the R9M.

albfan commented 1 year ago

Wonder if I can put a hardware inverter

https://www.team-blacksheep.com/products/prod:qx7mod

It says 3.3V. is there any similar inverter with 5V?

Could the flag UART_INVERTED in express les solve that by software?

https://www.deviationtx.com/forum/protocol-development/8868-expresslrs#77217

albfan commented 1 year ago

I tried a homemade inverter (with bc337 no transistor but doesn't work)

I found this hardware mod for r9m

https://www.rcgroups.com/forums/showpost.php?p=46673237&postcount=194

r9m-mod-uninvert-signal.jpg

Can confirm It works.

@hexfet Is It expected some progress on CRSF menu? Now it only shows 3 empty rows and a 4th row with "model1"

albfan commented 1 year ago

Just in case, a screenshot of t8sg s.port mod

t8sg-s.port-external-mod.jpg

hexfet commented 1 year ago

The s.port mod looks fine. I don't know about the R9M mod. What do you mean by "it works"?

If no ELRS items appear (just the model name) then it means that Deviation is not receiving data from the module. If you select the "model1" line you can change the baud rate to see if that makes any difference. Do you have a logic analyzer or oscilloscope to look at the signal directly?

albfan commented 1 year ago

What do you mean by "it works"?

Looks the R9M mod left the signal uninverted, so t8sg correctly send axis and switches

If no ELRS items appear (just the model name) then it means that Deviation is not receiving data from the module

Yes I have a logic analyzer, (saleae with pulseview) any specific samplerate and decoder to capture? if there's any guide or tutorial on forum didn't find it

hexfet commented 1 year ago

So the control link works, but not the menu? Are you receiving telemetry data on the telemetry test page?

I usually capture at 20MHz and use the serial decoder. No tutorial but just need the one signal line (s.port pin) and ground. Start the capture, turn on the t8sg, navigate to the protocol options. That should be enough.

albfan commented 1 year ago

No I don't even see telemetry.

Thanks for the tips, will create the capture and upload