Open DangerD1024 opened 1 year ago
binary is in folder uf2. It is file Application.uf2. Just make a copy/paste to the USB drive that RP2040 emulates in bootloader mode (presssing boot button while power on)
Thank you, can you help me with wiring, where should i connect s.bus,s.port and rx tx from elrs receiver?
It is explained in main.cpp.
Here the text
// CRSF uses PIO1 with 2 pins. pin 7 for TX and pin 8 for RX;
// still ELRS module uses half duplex UART with only one pin (the lowest in the JR bay which is normally used for Sport)
// So, pin 8 (RX) from RP2040 has to be connected to the lowest pin (Sport) from ELRS Tx module
// and pin 7 (TX) from RP2040 has to be connected to pin 8 from RP2040 via a resistor (a value of 1K ohm should be ok)
// SBUS uses pin 1 UART0 RX = Serial
// SPORT (TX and RX) uses PIO0 and pin 5; for safety, insert a 1K resistor in serie on the wire to Frsky Sport
// the pinout of the ELRS Tx module is the folowing:
// - upper pin = ???? not used
// - second upper pin = ???? not used
// - battery VCC (5V-10V)
// - gnd
// - CRSF signal (is usually used by frsky for sport signal)
//
// The firmware reads the Sbus signal and save the 16 channels values
// At regular interval (2 or 4ms as defined in the set up; not Sbus related),
// it sent a CRSF RC channels frame with the last received Sbus value
// If the ELRS Tx module is binded with the ELRS Rx module,
// it get back a telemetry frame just after sending some RC channels (delay between is about 40usec)
// There are 5 types of telemetry frames being decoded by the firmware
// When valid, the telemetry data of each frame are stored in memory
// At regular interval the Frsky receiver sent a pulling code to ask if some device has telemetry data to transmit.
// When the device ID of the module is polled, the firmware sent on Sport bus a frame with one data (Id and value)
// On each request, the firmware tries to send a different data if the delay from the previous one (of the same type) exceed some delay
// The delay's of each type of data can be set up in order to manage priority in some way.
// SPORT (TX and RX) uses PIO0 and pin 5 It's pin 0 and pin 5? (PIO0 ???) (Or 4,5?)
it is pin 5. PIO is an internal component of RP2040 used to emulate a UART.
Soldered everything, rc works, I'm able to control drone, but I'm not receiving telemetry... any suggestions with that? If I connect crossfire module to rc, I'm able to receive it...
Receiver is Frsky r-xsr
P.S. Updated r-xsr firmware to latest S.Port, still has same issue...
Can you also add extra PPM output, i can donate you some money for beer)
I developed this project on request of someone. I never used it myself. As far I know, it worked. There is some post about it on Rcgroups. It is difficult to say why you do not get telemetry back. Do you have a logic analyser that could be used to make a capture of the sport signals on Frsky Rx and on the signal sent back by the ELRS receiver?
Why do you want a PPM output? Note: I expect you could find on the market (e.g. on aliexpress) some module that convert SBUS to PPM.
I want to connect 433mhz as backup channel, but you're right, I can buy converter
There is some post about it on Rcgroups.
Do you remember link?)
You can also search on "relay" in DIY Electronics section
I can't get a connection with either an ELRS TX or a Crossfire TX ...
Questions: Is it correct that APPLICATION.uf2 is automatically deleted from the RP2040 Zero drive? In the readme.md it says that two RP2040 Zeros are used? Is this just a typo?
Checkup:
It looks to me like the program is not running on the RP2040 Zero. For testing, can you maybe make the LED flash red when there is no SBUS signal and green when CRSF is output?
The S.Port connection to the ELRS TX was not ok ... Now the connection is there, RC works.
The ELRS telemetry works actually also, but with dropouts. Many entries are updated at , then data is missing, it is updated again etc.
With Crossfire RC works, but just like @DangerD1024 no telemetry comes.
Did you already try to change the telemetry rate inside ELRS. Can you try e.g. a telemetry rate of 4. When telemetry rate is to high, the ELRS receiver can't sent many data to the Tx and this can create telemetry lost messages.
I am not sure that this is the reason of the issue but it is good to try first.
I currently have ELRS set to 50 Hz and 1:8 TLM rate (for Long Range). I can probably reduce the TLM rate on a test basis.
Do you have an idea why no telemetry arrives at the Crossfire? As RC connection the Crossfire Full-TX reports "CRSF v2", so it should actually work. However, during the test yesterday I only operated the CF TX and did not have a CF RX active. I wanted to test that today.
By the way, the goal in my case is to be able to run the Yaapu Script on the transmitter. I use ArduPlane and here S.Port Passthrough is transmitted which also works with a pure CRSF system (ELRS or Crossfire). Since the Yaapu Script has become a certain standard, if you as an ArduPlane user do not necessarily want to use a GCS with Mavlink, it would be very interesting if your relay could implement this directly for ELRS and Crossfire.
Connected Frsky R-XSR to ES900TX It receives some weird data... If i insert ES900TX module directly to RC, it shows correct data. ExpressLRS firmware is latest...
How many beer bottles or how much $$ you want for fixes?)
Or better to make CSRF->CSRF relay CSRF RX/TX (2.4 Receiver) <- CSRF Half Duplex (900MHz Transmitter)
I do not have an installation to test the relay project. If you can connect the RP2040 to a PC (via USB) while it is connected to a Frsky receiver and to a ELRS Tx module, I could change the code in order to let the RP2040 generates some debug messages and so probably find the issue. Note : when the RP2040 is connected to the PC (via USB), I would recommend to avoid powering it on via the FRSKY RX or the ELRX Tx module. Let me know if you want to make such tests.
Let's make them
I just put on github a version in "test-without-wizio" branch that should display a line on the PC for each telemetry frame received from the ELRS TX module. This first test should show if the frames are wel received. Can you make a copy/paste of those lines? Note : the file to be uploaded into the RP2040 is "Frsky_Elrs_Relay.uf2
A picture posted here above shows some telemetry fields with a code staring with 0C0x. Those codes are "normal". The ELRS TX module generates some telemetry fields about the ELRS link quality. Those fields does not exist in the Frsky sport protocol. In order to still transmit them to the handset, the relay uses special codes. Here is the list:
In the handset it is possible to change the setup of those telemetry fields in order to get a meaningful name instead of the code.
Note : the file to be uploaded into the RP2040 is "Frsky_Elrs_Relay.uf2
I can't find where you've uploaded it...
@mstrens : why do you use special codes, if you can simply use the S.Port Passthrough protocol, which @yappu uses in his script for the conversion of ELRS CRFS or Crossfire CRSF? You would solve 2 points: the source is ready and tested and every station with FrSky S.Port can handle it. That would be just perfect for a relay.
This project receives 5 types of CRSF telemetry frames from a ELRS receiver. Each frame contains different types of fields. Those fields have to be transmitted to the handset using the Sport protocol (that is the principle of the relay). This requires to extract each field from the frame and to convert it to a format that is supported by the Frsky Sport protocol. In Sport protocol, each telemetry frame contains a code (on 2 bytes) to identify the type of data and a value (on 4 bytes). Some fields does not require 4 bytes and so it is possible, in theory, to group different fields into 4 bytes and to assign it a code to identify this combination. This allow to increase the telemetry throughput. As far I understand Yaapu worked so (grouped several fields in the 4 bytes value of some sport frame)
Still, as far I know, there is no specific Yaapu frsky Sport format defined to transmit the ELRS Tx/Rx link quality data.
Do you know the Yaapu script? This is primarily used to display various telemetry information. It replaces a GCS on a small scale, so to speak. Furthermore, it decodes the S.Port passthrough data stream and "creates" the individual telemetry entries in the transmitter. Without Yaapu script there is no telemetry data when S.Port Passthrough is used.
This is a disadvantage at first sight, but in the end you only have to install the script, which is hardly any effort.
A relay is primarily of interest for long range. I fly mainly LR and am of course interested in telemetry info. Without relay I have a lot of necessary information with the Yaapu script. With Relay only the RC connection works at the moment. I could now use Mavlink and use QGC or Mission Planner for display, but that always means additional hardware/effort.
So it would be very nice if CRSF data (no matter if from ELRS or Crossfire) is translated directly from your project to S.Port Passthrough.
I realize that S.Port Passthrough has no format for Tx/Rx link quality data yet which is important for relay operation. I think @Yaapu will not be averse to implement this as well.
I myself would sponsor the implementation with 250 EUR and also be available as a tester.
One more thing comes to my mind ... I can use ELRS or Crossfire in a relay and currently have only RC control available there. Basically I take full duplex UART from the ELRS/CF RX and convert that to half duplex to feed an ELRS or Crossfire TX. This works. What is not clear to me is why in this case is the telemetry not converted as well? What is different if I have the TX plugged into the transmitter?
(in this example I use 2x TX, once in the transmitter, with 10 mW to the relay and there the 2nd TX is driven. S.Port is here outside)
I just put on github a version in "test-without-wizio" branch that should display a line on the PC for each telemetry frame received from the ELRS TX module. This first test should show if the frames are wel received. Can you make a copy/paste of those lines? Note : the file to be uploaded into the RP2040 is "Frsky_Elrs_Relay.uf2
I'll test that at evening, i've got non working Pixhawk 6C, imu heats up to 120* o_O and pc doesn't recognize it... I should get another one at evening =)
Here's debug info: Current, Temperature and some other fields shows weird data... Also better to make some fix to make it working on crossfire receiver as it has 500mw telemetry instead of 50mw on expressLRS
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 5D 20 0 rate=20000 offset=2384
EA C 14 E4 0 64 6 0 2 8 D5 48 7
EA D 3A EA EE 10 0 3 D 40 0 0 54 BA
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 54 BA 0 rate=20000 offset=2169
EA C 14 E4 0 64 6 0 2 8 D3 54 6
EA D 3A EA EE 10 0 3 D 40 FF FF A9 8E
tlm=EA D 3A EA EE 10 0 3 D 40 FF FF A9 8E 0 rate=20000 offset=-2213
EA C 14 E4 0 64 6 0 2 8 C9 60 6
EA D 3A EA EE 10 0 3 D 40 0 0 41 C8
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 41 C8 0 rate=20000 offset=1684
EA D 3A EA EE 10 0 3 D 40 0 0 38 72
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 38 72 0 rate=20000 offset=1445
EA C 14 E3 0 64 6 0 2 8 E7 64 6
EA D 3A EA EE 10 0 3 D 40 0 0 30 C
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 30 C 0 rate=20000 offset=1230
EA C 14 E3 0 64 6 0 2 8 D0 64 6
EA D 3A EA EE 10 0 3 D 40 0 0 24 F4
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 24 F4 0 rate=20000 offset=946
EA C 14 E1 0 64 6 0 2 8 CF 64 2
EA D 3A EA EE 10 0 3 D 40 0 0 1C 98
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 1C 98 0 rate=20000 offset=732
EA C 14 E1 0 64 6 0 2 8 E0 64 7
EA D 3A EA EE 10 0 3 D 40 0 0 13 24
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 13 24 0 rate=20000 offset=490
EA 11 2 0 0 0 0 0 0 0 0 0 0 0 0 3 E8 0
EA C 14 E1 0 64 6 0 2 8 CD 64 7
EA D 3A EA EE 10 0 3 D 40 0 0 9 38
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 9 38 0 rate=20000 offset=236
EA A 8 0 2 0 34 0 0 16 63
EA D 3A EA EE 10 0 3 D 40 FF FF FD F8
tlm=EA D 3A EA EE 10 0 3 D 40 FF FF FD F8 0 rate=20000 offset=-52
EA C 14 E1 0 64 6 0 2 8 D1 64 6
EA 8 1E FE AB 0 FB FA 77
EA D 3A EA EE 10 0 3 D 40 0 0 91 32
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 91 32 0 rate=20000 offset=3717
EA C 14 DF 0 64 6 0 2 8 CF 64 7
EA D 3A EA EE 10 0 3 D 40 0 0 87 BE
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 87 BE 0 rate=20000 offset=3475
EA C 14 DF 0 64 6 0 2 8 E6 64 6
EA D 3A EA EE 10 0 3 D 40 0 0 7D 50
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 7D 50 0 rate=20000 offset=3208
EA C 14 E0 0 64 6 0 2 8 E6 64 6
EA D 3A EA EE 10 0 3 D 40 0 0 73 C8
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 73 C8 0 rate=20000 offset=2964
EA C 14 E0 0 64 6 0 2 8 E9 64 6
EA D 3A EA EE 10 0 3 D 40 0 0 6B 58
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 6B 58 0 rate=20000 offset=2748
EA 11 2 0 0 0 0 0 0 0 0 0 0 0 0 3 E8 0
EA D 3A EA EE 10 0 3 D 40 0 0 62 C
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 62 C 0 rate=20000 offset=2510
EA C 14 E3 0 64 6 0 2 8 D0 64 7
EA D 3A EA EE 10 0 3 D 40 FF FF 9B 7E
tlm=EA D 3A EA EE 10 0 3 D 40 FF FF 9B 7E 0 rate=20000 offset=-2573
EA A 8 0 2 0 34 0 0 19 63
EA C 14 E3 0 64 6 0 2 8 E2 64 7
EA D 3A EA EE 10 0 3 D 40 0 0 50 C8
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 50 C8 0 rate=20000 offset=2068
EA 8 1E FE B0 1 6 FA 79
EA C 14 E1 0 64 6 0 2 8 D0 64 7
EA D 3A EA EE 10 0 3 D 40 0 0 45 BA
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 45 BA 0 rate=20000 offset=1785
EA C 14 E1 0 64 6 0 2 8 D4 64 6
EA D 3A EA EE 10 0 3 D 40 0 0 3D 4A
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 3D 4A 0 rate=20000 offset=1569
EA D 3A EA EE 10 0 3 D 40 0 0 33 40
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 33 40 0 rate=20000 offset=1312
EA C 14 DE 0 64 6 0 2 8 E6 64 7
EA D 3A EA EE 10 0 3 D 40 FF FF CD 92
tlm=EA D 3A EA EE 10 0 3 D 40 FF FF CD 92 0 rate=20000 offset=-1291
EA C 14 DE 0 64 6 0 2 8 E5 64 7
EA 11 2 0 0 0 0 0 0 0 0 0 0 0 0 3 E8 0
EA D 3A EA EE 10 0 3 D 40 0 0 1E C8
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 1E C8 0 rate=20000 offset=788
EA C 14 E1 0 64 6 0 2 8 E7 64 7
EA A 8 0 2 0 34 0 0 1A 63
EA D 3A EA EE 10 0 3 D 40 0 0 10 72
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 10 72 0 rate=20000 offset=421
EA C 14 E1 0 64 6 0 2 8 CE 64 6
EA 8 1E FE BA 1 10 FA 7E
EA D 3A EA EE 10 0 3 D 40 0 0 6 CC
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 6 CC 0 rate=20000 offset=174
EA C 14 E1 0 64 6 0 2 8 D4 64 7
EA D 3A EA EE 10 0 3 D 40 FF FF FC D6
tlm=EA D 3A EA EE 10 0 3 D 40 FF FF FC D6 0 rate=20000 offset=-81
EA C 14 E1 0 64 6 0 2 8 D1 64 7
EA D 3A EA EE 10 0 3 D 40 0 0 91 6E
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 91 6E 0 rate=20000 offset=3723
EA D 3A EA EE 10 0 3 D 40 0 0 87 DC
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 87 DC 0 rate=20000 offset=3478
EA C 14 E2 0 64 6 0 2 8 CE 64 7
EA D 3A EA EE 10 0 3 D 40 0 0 7E 18
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 7E 18 0 rate=20000 offset=3228
EA C 14 E2 0 64 6 0 2 8 CE 64 7
EA D 3A EA EE 10 0 3 D 40 0 0 72 6
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 72 6 0 rate=20000 offset=2919
EA C 14 E0 0 64 6 0 2 8 E2 64 7
EA D 3A EA EE 10 0 3 D 40 0 0 69 DC
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 69 DC 0 rate=20000 offset=2710
EA 11 2 0 0 0 0 0 0 0 0 0 0 0 0 3 E8 0
EA C 14 E0 0 64 6 0 2 8 D1 64 6
EA D 3A EA EE 10 0 3 D 40 0 0 60 90
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 60 90 0 rate=20000 offset=2472
EA C 14 E0 0 64 6 0 2 8 CF 64 7
EA D 3A EA EE 10 0 3 D 40 0 0 57 4E
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 57 4E 0 rate=20000 offset=2235
EA 8 1E FE D1 1 16 FA 94
EA D 3A EA EE 10 0 3 D 40 0 0 4C AE
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 4C AE 0 rate=20000 offset=1963
EA C 14 E0 0 64 6 0 2 8 CF 64 7
EA D 3A EA EE 10 0 3 D 40 0 0 43 9E
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 43 9E 0 rate=20000 offset=1731
EA C 14 DE 0 64 6 0 2 8 CF 64 6
EA D 3A EA EE 10 0 3 D 40 0 0 3A 20
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 3A 20 0 rate=20000 offset=1488
EA C 14 DE 0 64 6 0 2 8 CD 64 7
EA D 3A EA EE 10 0 3 D 40 0 0 31 B0
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 31 B0 0 rate=20000 offset=1272
EA C 14 DE 0 64 6 0 2 8 D4 64 4
EA D 3A EA EE 10 0 3 D 40 0 0 22 7E
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 22 7E 0 rate=20000 offset=883
EA C 14 DE 0 64 6 0 2 8 CD 64 7
EA D 3A EA EE 10 0 3 D 40 0 0 19 96
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 19 96 0 rate=20000 offset=655
EA 11 2 0 0 0 0 0 0 0 0 0 0 0 0 3 E8 0
EA D 3A EA EE 10 0 3 D 40 0 0 10 FE
tlm=EA D 3A EA EE 10 0 3 D 40 0 0 10 FE 0 rate=20000 offset=435
EA C 14 DA 0 64 6 0 2 8 D4 64 6
EA D 3A EA EE 10 0 3 D 40 FF FF E9 4E
tlm=EA D 3A EA EE 10 0 3 D 40 FF FF E9 4E 0 rate=20000 offset=-581
EA D 3A EA EE 10 0 3 D 40 FF FF EA C0
tlm=EA D 3A EA EE 10 0 3 D 40 FF FF EA C0 0 rate=20000 offset=-544
EA A 8 0 2 0 34 0 0 20 63
EA D 3A EA EE 10 0 3 D 40 FF FF F1 64
tlm=EA D 3A EA EE 10 0 3 D 40 FF FF F1 64 0 rate=20000 offset=-374
Tried to connect it to Crossfire module, there's no debug output at all, except "start" Looks like CRSF on Crossfire and ExpressLRS differs somehow...
I think I understood a bug I made. In ELRS, when a value is coded on several bytes, the most significant byte is put first in the frame. I decoded the values in the opposite order. I will try to solve this in a new version.
can you also output extra csrf tx on pin0 (TXD0)? Or better ppm =) I want to connect extra transmitter for another frequency for redundancy
I propose first to try to get telemetry working. I put a new version in the branch test-without-wizio.
I expect it should be better. Still, I did not check if the decimals are OK. I will check this to morrow.
Thank you, works fine now =) Just Yaapu script doesn't works, i'll investigate why =)
What about Crossfire and extra PPM output on unused TX?
I expect that Yaapu script expects that the data are transmitted in the condensed format (grouping several field into a single packet and using the Yaapu code ID to identify the telemetry packets. Still I am not sure because I do not know Yaapu.
I put a new version this morning where I adjust scaling of telemetry fields (e.g. voltage is in 0.1V in ELRS and in 0.01V in sport).
What about Crossfire and extra PPM output on unused TX?
? =)
I can provide you any debug info with TBS crossfire
It is not clear for me what you expect. Can you make a schema with the different connections between the different components and the direction of the signals?
Or alternatively if you have no time to implement PPM you can make this: Send to TXD0 same as you send to TXD1
But the best solution i think is this one, it will be easier to achive telemetry passthrough as you don't have to convert anything in telemetry and Yaapu telemetry script should work from the box
I expect that Yaapu script expects that the data are transmitted in the condensed format (grouping several field into a single packet and using the Yaapu code ID to identify the telemetry packets. Still I am not sure because I do not know Yaapu.
You should really take a closer look at the project. IMHO you are doing work that is actually already done (except for things like remote RSSI etc.).
The Yaapu script works with S.Port passthrough, so the condensed format. But I don't know exactly how this works with CRSF, because in the setup of the Yaapu script you have to select CRSF specifically, so that the script also works with Crossfire and ELRS.
Maybe Alessandro can say some things about this, I'll send him a message => @yaapu
S.Port Passthrough protocol specs: https://docs.google.com/spreadsheets/d/1oFv5zSl10wyR0LOcCChDdy9peIRNkbaEBrsHDQ0ZdmE/edit#gid=0
Passthrough over CRSF: https://github.com/yaapu/FrskyTelemetryScript/wiki/Passthrough-over-CRSF-and-ExpressLRS
I put on github in "test_without_wizio" a version that is supposed to generate a ppm signal on pin 0 I did not tested this version but I hope it is OK. Let me know
I put on github in "test_without_wizio" a version that is supposed to generate a ppm signal on pin 0 I did not tested this version but I hope it is OK. Let me know
something is not right, transmitter can't read it...
tried on TBS crossfire and Arkbird 433, both was unable to identify it
have you finally got your retransmitter working? I also would like to implement the same schema
I can't install Wiz-IO package as it looks like outdated or something... https://github.com/Wiz-IO/framework-wizio-pico/issues/54
Can you share compiled binary?