JunOllyLi / espidf5_edgetx

EdgeTX build with ESP-IDF v5
Apache License 2.0
28 stars 8 forks source link

Project still on going? #1

Open relaxibus opened 1 year ago

relaxibus commented 1 year ago

Hi, is this project still ongoing?

JunOllyLi commented 1 year ago

Well, it is feature complete in my plan. And now I am not actively working on it anymore, unless there is new feature from future EdgeTX that interests me, or if I found some bug when I use the TX to fly my planes.

relaxibus commented 1 year ago

Thanks! Would you be interested to add a USB2Serial Protocol that could be used instead of the UART Gimbal? Goal is to use USB HOTAS with a EdgeTX box.

JunOllyLi commented 1 year ago

Sorry, I did not even get the USB OTG pin of the ESP32S3 out, so I am not able to work on it at all. Besides, the initial reason I started this project was to replace the FS-i6 gimbal with the FlySky Hall Gimbal, although the scope grow bigger and bigger, it is still one of the main reasons. So I don't see why I wanted to use another thing instead of the gimbal.

relaxibus commented 1 year ago

You missunderstod me. I have a board with 2x USB HID input and a serial output. This serial output could be connected to the gimbal UART and send all analog axis and 2x 32bit switches.

JunOllyLi commented 1 year ago

Oh, I see. But as I mentioned, I did not have the USB OTG pins soldered, so I am not able to do anything at this moment. Briefly thinking about it, maybe directly hook up the UART pins to the ESP32S3 maybe even easier?

relaxibus commented 1 year ago

image The USB to Serial board (green) will be connected via UART to the ESP. You don't need the USB OTG of the ESP32 ;-) This the result: https://www.youtube.com/watch?v=L_21r6xz2tw&t=49s But the ESP software is rudimentary and the great way would be to use your EdgeTX port for this :-)

JunOllyLi commented 1 year ago

Again, I am confused. The module above the USB-UART is the ESP? If you do not connect the display and everything else to that ESP, how are you going to get the EdgeTX to work?

And if you connect the UART to ESP, then you do not need me to add USB-serial into my build. You just use UART directly. If you need both TX/RX then the internal module code in my source tree can be a reference of how the UART in ESP is used. And if you only need RX, then you can also refer to my FlySky Hall Gimbal code which uses RMT to parse UART frame.

relaxibus commented 1 year ago

On the ESP is a custom software converting the UART protocol coming out of the USB board into PPM Out. There is EdgeTX yet installed. You don't need to add USB-serial into you build. The idea was to add the serial protocol coming out from the USB board to your EdgeTX and connect it instead of the UART Gimbals. I'm not a code, unfortunately. But I think it would be great to have a EdgeTX in a box and to use USB joysticks/HOTAS to fly FPV :-)

JunOllyLi commented 1 year ago

well, my code does have PPM in, so it is possible you connect your PPM out to the EdgeTX box's PPM in, just like a trainer box. I did have code and the pin wired out, although I have not really tested the trainer function, I assume it should work.

If you want to connect the UART directly the EdgeTX box, you need to do coding anyway, to process the HOTAS data. I cannot help you on that unless I have a HOTAS.

relaxibus commented 1 year ago

Where are you based?

JunOllyLi commented 1 year ago

Pacific Northwest

relaxibus commented 1 year ago

I have a board in California that can be sent to you, in case you're interested.

JunOllyLi commented 1 year ago

Sure I am interested. But I have to warn you that I don't know how much time I can put into this. It spent me whole winter to pull this EdgeTX box together, and now it is the good weather season in PNW so definitely less time for indoor projects.

And do you have the spec of the HOTAS about data format sent over the UART?

relaxibus commented 1 year ago

Are you on discord? Or how can start a discussion outside from Github?

JunOllyLi commented 1 year ago

You could send me a private message on RCGroups

DAMskill commented 4 months ago

I would realy like to build this ESP32 EdgeTX Remote. I'm stuck with an old Turnigy 9x. Grate layout, old tech.

What is the latest version of EdgeTx that you can run on the ESP32? Is there a reason you picked ESP32?

I just found these SMT32 development boards: https://www.st.com/en/evaluation-tools/stm32-nucleo-boards.html I guess al lot of commercial radios are build around this chip.

JunOllyLi commented 4 months ago

I would realy like to build this ESP32 EdgeTX Remote. I'm stuck with an old Turnigy 9x. Grate layout, old tech.

What is the latest version of EdgeTx that you can run on the ESP32? Is there a reason you picked ESP32?

I just found these SMT32 development boards: https://www.st.com/en/evaluation-tools/stm32-nucleo-boards.html I guess al lot of commercial radios are build around this chip.

Well, the reason I picked ESP32 has to go back to the start of the project. My original project was not a whole TX, it was only some add-on unit I can attach to my FlySky TX so I can use it to control the POWERUP module over Bluetooth. And ESP32 has built-in WiFi/BT which seems easy to use. Then I found that ESP32 is a lot more capable of only doing that and I found the EdgeTX project, so I decided to do more.

And yes I know most of the commercial TX use the STM32, but what is the fun of just using something existing. :D

As of today, my project runs EdgeTX 2.8. I am trying to catch up with the latest (2.10) right now, but I do not expect to get it done soon. The thing is that I finally decided to draw my own PCB board, instead of fly-wiring the modules together. But again that may take some time. I have not done PCB drawing for decades and I only do it after work and kids, so probably will not be done in several month. But hopefully I can have my own pretty dev board at that time. :)

DAMskill commented 4 months ago

Aah i see haha, Thats grate news. We think a like! There is nu fun in getting a $400 radio, that limits you to what the manufacturer has decided. Why not make use of every drop of juice, provided by the microprocessor. And by the way i really love the layout of this old controller.

I am an mechanical engineer, that loves to work in CAD software & even more I love to get my hands dirty. Designing in 3D is no problem for me. I did some PCB design in the past in Autodesk.

Unfortunately I'm not a electrical-engineer, so here is where my knowledge lacks a bit in designing from scratch. But I know some stuff and I learn quick.

Reverse engineering parts of existing board is always a clever starting point. I have some scopes and other measuring equipment. If you'd like, we can team up somehow.

Recently I started with micro processors. Arduino, ESP32 & Raspberry Pi. I'm not a diehard coder, but reverse engineering/adapting code is no problem. After all, there are a lot of libraries out there.

I'm completely new to drones, so i bought two cheap drones with different receivers. After soldering some wires to the motherboard & flashing OpenTx v2.1.9 on the Turnigy TGY 9X, using a Arduino as ISP. I realized how easy it is, to add features to a existing microprocessor.

You really inspired me to build this ESP32 model. Since there is no way to get EdgeTx to work on the ATMEGA64, due to a lack of memory. Thanks.

The plan for now is to see if it's possible, to use all the existing pull-up resistors, filtering, power regulators, etc. And just hard solder some connections on the existing motherboard of the radio to the ESP32, running your code. Maybe copy a bit of this solder less idea: https://www.pyramidmodels.com/shop/product.php/1280/9x_solderless_programmer_board_with_led_backlight_support

Add-in a bit of Multi-protocol Tx Module: iRangeX IRX4 Plus (4 in 1 with STM chip). https://www.multi-module.org/basics/module-hardware

And top it off with a pinch of ExpressLRS: https://www.expresslrs.org/quick-start/transmitters/tx-prep/#radio-operating-system

How did you get the code to work on ESP32, are there many steps involved, or is it simple to swap between processors?

I came across some interesting pages: Build EdgeTX: https://github.com/EdgeTX/build-edgetx#docker-images-to-build-edgetx STM development boards: https://www.st.com/en/evaluation-tools/stm32-nucleo-boards.html https://estore.st.com/en/products/evaluation-tools/product-evaluation-tools/mcu-mpu-eval-tools/stm32-mcu-mpu-eval-tools/stm32-nucleo-boards/nucleo-f413zh.html

JunOllyLi commented 4 months ago

Aah i see haha, Thats grate news. We think a like! There is nu fun in getting a $400 radio, that limits you to what the manufacturer has decided. Why not make use of every drop of juice, provided by the microprocessor. And by the way i really love the layout of this old controller.

I am an mechanical engineer, that loves to work in CAD software & even more I love to get my hands dirty. Designing in 3D is no problem for me. I did some PCB design in the past in Autodesk.

Unfortunately I'm not a electrical-engineer, so here is where my knowledge lacks a bit in designing from scratch. But I know some stuff and I learn quick.

Reverse engineering parts of existing board is always a clever starting point. I have some scopes and other measuring equipment. If you'd like, we can team up somehow.

Recently I started with micro processors. Arduino, ESP32 & Raspberry Pi. I'm not a diehard coder, but reverse engineering/adapting code is no problem. After all, there are a lot of libraries out there.

I'm completely new to drones, so i bought two cheap drones with different receivers. After soldering some wires to the motherboard & flashing OpenTx v2.1.9 on the Turnigy TGY 9X, using a Arduino as ISP. I realized how easy it is, to add features to a existing microprocessor.

You really inspired me to build this ESP32 model. Since there is no way to get EdgeTx to work on the ATMEGA64, due to a lack of memory. Thanks.

The plan for now is to see if it's possible, to use all the existing pull-up resistors, filtering, power regulators, etc. And just hard solder some connections on the existing motherboard of the radio to the ESP32, running your code. Maybe copy a bit of this solder less idea: https://www.pyramidmodels.com/shop/product.php/1280/9x_solderless_programmer_board_with_led_backlight_support

Add-in a bit of Multi-protocol Tx Module: iRangeX IRX4 Plus (4 in 1 with STM chip). https://www.multi-module.org/basics/module-hardware

And top it off with a pinch of ExpressLRS: https://www.expresslrs.org/quick-start/transmitters/tx-prep/#radio-operating-system

How did you get the code to work on ESP32, are there many steps involved, or is it simple to swap between processors?

I came across some interesting pages: Build EdgeTX: https://github.com/EdgeTX/build-edgetx#docker-images-to-build-edgetx STM development boards: https://www.st.com/en/evaluation-tools/stm32-nucleo-boards.html https://estore.st.com/en/products/evaluation-tools/product-evaluation-tools/mcu-mpu-eval-tools/stm32-mcu-mpu-eval-tools/stm32-nucleo-boards/nucleo-f413zh.html

Ah, wish you came earlier :D. I have already done my measurement and mechanical thinking (which is painful for me, and hope I got it right) to put this in the FlySky FS6 TX's shell. If I need more help, I would definitely let you know :)

As of running the code, the docker image to build official source tree (which runs on STM32) maybe not that helpful. You do need install ESP-IDF 5.0.1, which is described in my README of this repository.

What I have implemented in my source tree is the device drivers for ESP32, but it does depend on how you wires your modules together. I recently saw some changes in EdgeTX 2.10 that tries to separate the upper layer app and lower layer HW, which I think it is a good direction. I wish with both their effort and mine, I could end up proposing them taking my code (once it is done) into official tree as well, that would make our lives easier later.

And for re-using the stuff on existing board with new ESP module, actually I did similar thing. I was just a little bit brutal force. I sanded away the wires on the existing PCB (it is a two layer board) and re-used the buttons on the board. 😄

DAMskill commented 4 months ago

That sounds like a grate way to keep the development in radios active. DIY till the day i die. Hahah ;)

What PCB design software did you use? If you'd like to share the files, I can build one, test it and help you troubleshoot.

relaxibus commented 4 months ago

There is another add-on to this project that could be done. instead of using the ESP32 native inputs (analog and digital), a serial stream could be used as a front end. So you can use different HMI front ends including USB HID (for HOTAS, etc). What about this idea?

DAMskill commented 4 months ago

Grate idea, again we think a like.

I have a 3D Connexion SpaceMouse Enterprise with a 6DoF sensor. Why not use it as a 6-Degrees-of-Freedom Remote. https://3dconnexion.com/dk/product/spacemouse-enterprise/ https://forum.3dconnexion.com/viewtopic.php?t=36183 With wireless head-tracking inside my Spektrum Fatshark goggles, controlling a 3DoF camera-gimbal.

I would like to give this board a try also, since it will have its first support in EdgTx 3.x.: https://www.st.com/en/evaluation-tools/stm32-nucleo-boards.html

This page might be interresting: https://manual.edgetx.org/edgetx-how-to/configure-advanced-joystick-with-edgetx Can you already use 3rd party controllers in EdgeTx? other controller use layout
OpenTX EdgeTX pre 2.9
Orqa FPV.Ctrl EdgeTX pre 2.9
Stadia Android
XBox Android
JunOllyLi commented 4 months ago

That sounds like a grate way to keep the development in radios active. DIY till the day i die. Hahah ;)

What PCB design software did you use? If you'd like to share the files, I can build one, test it and help you troubleshoot.

I am using kiCAD for PCB. It is not done yet.

And I am not following you. Are you saying you can build the PCB, the board itself? You have the equipment to build multi layer PCB?

JunOllyLi commented 4 months ago

There is another add-on to this project that could be done. instead of using the ESP32 native inputs (analog and digital), a serial stream could be used as a front end. So you can use different HMI front ends including USB HID (for HOTAS, etc). What about this idea?

Sounds interesting. I recall we had some discussion long time ago, didn't we? Could you draw some diagram to give more details about what you have in mind?

relaxibus commented 4 months ago

I used the SpaceMouse, it is not easy to use it as it is very sensitive and you need to prioritize some axis. Thats me with a Thrustmaster HOTAS: https://www.youtube.com/watch?v=L_21r6xz2tw Instead of using the Taranis, it would be good to have its own EdgeTX Blackbox with a UART-IN (SERaero) and CRSF-OUT (RF Module). @JunOllyLi Yes, we did :-) Here the project. A few boards has been made: USB2RC_Block-Diagram.pdf

Here the SERaero protocol specs to use as HMI front-end input: SERaero_C2-16B_spec_v1.1.pdf

JunOllyLi commented 4 months ago

I used the SpaceMouse, it is not easy to use it as it is very sensitive and you need to prioritize some axis. Thats me with a Thrustmaster HOTAS: https://www.youtube.com/watch?v=L_21r6xz2tw Instead of using the Taranis, it would be good to have its own EdgeTX Blackbox with a UART-IN (SERaero) and CRSF-OUT (RF Module). @JunOllyLi Yes, we did :-) Here the project. A few boards has been made: USB2RC_Block-Diagram.pdf

Here the SERaero protocol specs to use as HMI front-end input: SERaero_C2-16B_spec_v1.1.pdf

Nice! If it is PPM/UART, then I guess the board I am designing should be capable to handle. 😄 Just need SW changes. However, I am still a little bit confused. In two of the diagrams, you had PPM to RC controller, and then UART to RF module. Why is that? RC controller already has RF module in there, why need another RF module?

DAMskill commented 4 months ago

That sounds like a grate way to keep the development in radios active. DIY till the day i die. Hahah ;) What PCB design software did you use? If you'd like to share the files, I can build one, test it and help you troubleshoot.

I am using kiCAD for PCB. It is not done yet.

And I am not following you. Are you saying you can build the PCB, the board itself? You have the equipment to build multi layer PCB?

KiCad, nice open source software :)

A friend of mine has a 3Dprinter with a router/laser engraver. For sure you can make some nice PCB and prototypes with that. Even a 3d printed case if needed. I can send him the files, visit him for a while. Or even borrow the machine for a while, if we decide to go hard on this project.

Probably you can find double sided etching boards. SMD solder in the components and you have a double layer. Multi-layer... I think it can be done by gluing several thin layers together with epoxy, using a press or vacuum
As long as you keep the boards aligned to one and other, you can bridge the layers But then again with multi layered designs, why not keep it stupid simple: https://www.pcbway.com/

relaxibus commented 4 months ago

I used the SpaceMouse, it is not easy to use it as it is very sensitive and you need to prioritize some axis. Thats me with a Thrustmaster HOTAS: https://www.youtube.com/watch?v=L_21r6xz2tw Instead of using the Taranis, it would be good to have its own EdgeTX Blackbox with a UART-IN (SERaero) and CRSF-OUT (RF Module). @JunOllyLi Yes, we did :-) Here the project. A few boards has been made: USB2RC_Block-Diagram.pdf Here the SERaero protocol specs to use as HMI front-end input: SERaero_C2-16B_spec_v1.1.pdf

Nice! If it is PPM/UART, then I guess the board I am designing should be capable to handle. 😄 Just need SW changes. However, I am still a little bit confused. In two of the diagrams, you had PPM to RC controller, and then UART to RF module. Why is that? RC controller already has RF module in there, why need another RF module?

So you can decide to use a standard RC controller, or use only a RF module on a pole with larger antennas (CRSF, ELRS, etc).

relaxibus commented 4 months ago

I can share schematics (project is on Altium, so don't think it's useful for you). However the use of the new XIAO ESP32 would result in a smaller unit.

JunOllyLi commented 4 months ago

That sounds like a grate way to keep the development in radios active. DIY till the day i die. Hahah ;) What PCB design software did you use? If you'd like to share the files, I can build one, test it and help you troubleshoot.

I am using kiCAD for PCB. It is not done yet. And I am not following you. Are you saying you can build the PCB, the board itself? You have the equipment to build multi layer PCB?

KiCad, nice open source software :)

A friend of mine has a 3Dprinter with a router/laser engraver. For sure you can make some nice PCB and prototypes with that. Even a 3d printed case if needed. I can send him the files, visit him for a while. Or even borrow the machine for a while, if we decide to go hard on this project.

Probably you can find double sided etching boards. SMD solder in the components and you have a double layer. Multi-layer... I think it can be done by gluing several thin layers together with epoxy, using a press or vacuum As long as you keep the boards aligned to one and other, you can bridge the layers But then again with multi layered designs, why not keep it stupid simple: https://www.pcbway.com/

I c. That is beyond my knowledge. 😄 I will definitely send you the file to try once it is done.

JunOllyLi commented 4 months ago

I used the SpaceMouse, it is not easy to use it as it is very sensitive and you need to prioritize some axis. Thats me with a Thrustmaster HOTAS: https://www.youtube.com/watch?v=L_21r6xz2tw Instead of using the Taranis, it would be good to have its own EdgeTX Blackbox with a UART-IN (SERaero) and CRSF-OUT (RF Module). @JunOllyLi Yes, we did :-) Here the project. A few boards has been made: USB2RC_Block-Diagram.pdf Here the SERaero protocol specs to use as HMI front-end input: SERaero_C2-16B_spec_v1.1.pdf

Nice! If it is PPM/UART, then I guess the board I am designing should be capable to handle. 😄 Just need SW changes. However, I am still a little bit confused. In two of the diagrams, you had PPM to RC controller, and then UART to RF module. Why is that? RC controller already has RF module in there, why need another RF module?

So you can decide to use a standard RC controller, or use only a RF module on a pole with larger antennas (CRSF, ELRS, etc).

Ah. So if RC TX is used, it is more for trimming, mixing and curves, but you do not really need those?

JunOllyLi commented 4 months ago

I can share schematics (project is on Altium, so don't think it's useful for you). However the use of the new XIAO ESP32 would result in a smaller unit.

XIAO does not have enough pins to drive the display.

relaxibus commented 4 months ago

Ah. So if RC TX is used, it is more for trimming, mixing and curves, but you do not really need those?

not if you do use a flight controller such INAV or Ardupilot. All what you then need is just a small configuration tool (Windows app or vie web interface) to assign buttons to PWM values, axis to PPM channel, flight modes PWMs. This why you also don't relay need a large display if you can use your smartphone/tablet and use the ESP32's Webserver.

JunOllyLi commented 4 months ago

Alright, here is my first draft of the PCBs, if you are interested 😄 https://github.com/JunOllyLi/TX_PCB

I have placed an order from a factory in China, and will see how well I did, after not designing circuits for decades.

relaxibus commented 4 months ago

looking forward :-)

relaxibus commented 3 months ago

any feedback regarding the idea of using a HMI front-end connected via UART (SERaero protocol) to the EdgeTX back-end? I see a lot of other comments asking for more I/Os, my suggestion will resolve all this, no?

JunOllyLi commented 3 months ago

any feedback regarding the idea of using a HMI front-end connected via UART (SERaero protocol) to the EdgeTX back-end? I see a lot of other comments asking for more I/Os, my suggestion will resolve all this, no?

I don't see any reason why it does not work. The easiest change would be that you just hook up the UART to where my Hall Gimbal connects to, and just write your code to decode the SERaero frame as if it is just a gimbal. Also, on the other hand, my original design was only using ESP32S3's buildin USB-phy for debugging. But after discussing with you I added a UART debugging port, so you could actually use the USB phy directly to connect any USB stuff to the USB-OTG 😄

JunOllyLi commented 1 month 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).