JunOllyLi / espidf5_edgetx

EdgeTX build with ESP-IDF v5
Apache License 2.0
30 stars 9 forks source link

Does this source compatible to elrs ?? #5

Open PravarHegde opened 6 months ago

JunOllyLi commented 6 months ago

Good question, by reading the code, it seems that it should be, if that ELRS module supports the same protocol as other MultiProtocolModule over the UART (You can see at least in 2.10 the ELRS code and MPM code are in the same multi.cpp). But I have never tried it. I may have a more clear answer in a few month, since my PCB did have the connector for both 4in1 and ELRS, with the hope they work well. 😄

PravarHegde commented 6 months ago

Okay okay

PravarHegde commented 6 months ago

Any update??

JunOllyLi commented 6 months ago

Any update??

Oh, sorry. I meant "in a few month" 😄 My PCBs were manufactured but still on their way to me, and I expect a lot more needs to be done after I got it, before I got to the ELRS stuff.

relaxibus commented 5 months ago

hi, did you ever connected an elrs or any other JR style TX module with a single line UART (half duplex)?

JunOllyLi commented 5 months ago

hi, did you ever connected an elrs or any other JR style TX module with a single line UART (half duplex)?

If you meant half duplex that TX RX uses the same line but at different time, it is possible but that depends on the ELRS module supports it or not. If you meant only one way, then I guess not. At least by reading the code, it is expecting to receive some data from the module.

PravarHegde commented 5 months ago

Is it possible to connect the LoRa RFM95W or RA02 directly to the ESP32 as an internal ELRS instead of using an ELRS external module?

JunOllyLi commented 5 months ago

Is it possible to connect the LoRa RFM95W or RA02 directly to the ESP32 as an internal ELRS instead of using an ELRS add-on?

I don't see any reason why not. And as a matter of fact, from the ES32 point of view, there is really no difference between internal module and external module (I think this is what you meant by "add-on"). The difference between internal and external are mainly from the mechanical point of view

relaxibus commented 5 months ago

hi, did you ever connected an elrs or any other JR style TX module with a single line UART (half duplex)?

If you meant half duplex that TX RX uses the same line but at different time, it is possible but that depends on the ELRS module supports it or not. If you meant only one way, then I guess not. At least by reading the code, it is expecting to receive some data from the module.

I mean, how do you connect a JR style elrs TX module to your ESP32?

JunOllyLi commented 5 months ago

hi, did you ever connected an elrs or any other JR style TX module with a single line UART (half duplex)?

If you meant half duplex that TX RX uses the same line but at different time, it is possible but that depends on the ELRS module supports it or not. If you meant only one way, then I guess not. At least by reading the code, it is expecting to receive some data from the module.

I mean, how do you connect a JR style elrs TX module to your ESP32?

Oh, sorry I missed the JR part. ommunication wise you can connect the signal pin to the ESP32 pin used for other TX module. Although my design use those pin as UART, but ESP32 is very flexible about pin muxing, the SW can use that pin for other purpose you like. However, if I understood correctly the JR requires a regulated 6V supply, which yo will need to add your own

relaxibus commented 5 months ago

The JR slot only offers a single pin for Tx/Rx, there is no full UART available.

JunOllyLi commented 5 months ago

The JR slot only offers a single pin for Tx/Rx, there is no full UART available.

Still, the SW could be coded to support that. Maybe some pullup/pulldown resistors needed? Depending on exactly what protocol is used on that line. I have not really study that. But I don't really see anything preventing ESP32 doing it.

PravarHegde commented 4 months ago

i would like to try elrs internal module as rfm95 or ra01 . both communicate in spi . spi pin are available in you esp32 project? in external module extra mcu that converts uart data to spi ? is it possible to eliminate that mcu?

JunOllyLi commented 4 months ago

i would like to try elrs internal module as rfm95 or ra01 . both communicate in spi . spi pin are available in you esp32 project? in external module extra mcu that converts uart data to spi ? is it possible to eliminate that mcu?

Yes SPI is supported and currently used by SD card interface. You could make it share with the SD (with different CS pin), or using another SPI host controller but of course more pins requires.

As regarding the external module you were talking about, I have not studied it and probably won't be able to provide you any comments.

PravarHegde commented 4 months ago

i would like to try elrs internal module as rfm95 or ra01 . both communicate in spi . spi pin are available in you esp32 project? in external module extra mcu that converts uart data to spi ? is it possible to eliminate that mcu?

Yes SPI is supported and currently used by SD card interface. You could make it share with the SD (with different CS pin), or using another SPI host controller but of course more pins requires.

As regarding the external module you were talking about, I have not studied it and probably won't be able to provide you any comments.

What are the necessary changes required ?

JunOllyLi commented 4 months ago

i would like to try elrs internal module as rfm95 or ra01 . both communicate in spi . spi pin are available in you esp32 project? in external module extra mcu that converts uart data to spi ? is it possible to eliminate that mcu?

Yes SPI is supported and currently used by SD card interface. You could make it share with the SD (with different CS pin), or using another SPI host controller but of course more pins requires. As regarding the external module you were talking about, I have not studied it and probably won't be able to provide you any comments.

What are the necessary changes required ?

HW wise you will need to connect the SPI pins (CLK/MISO/MOSI/CS) to the module. If you are sharing the same SPI host with SD, then the CLK/MISO/MOSI can share the same pins. If not then you will need to assign dedicated CLK/MISO/MOSI for that module as well. SW wise you will need to write your own code to talk to the ELRS module over SPI, which I don't have too much comment I can add since I don't know those modules you mentioned.

JunOllyLi commented 4 months ago

An update on the project I am working on. The PCB mostly works with some small tweaks needed. I have been using this thread to track the HW verification progress. So far everything HW wise seems working, including ELRS. https://github.com/JunOllyLi/TX_PCB/issues/2

Next step for me is to focus on the SW side, before I update the HW with those small changes I identified (those HW changes are not critical and I may just keep the hack I made on this version of PCB, instead of go through PCB manufacture again, but I do plan to update the schematics and PCB drawing later).