CRSFforArduino icon indicating copy to clipboard operation
CRSFforArduino copied to clipboard

feat(targets): Add DOIT ESP32 DevKit V1 to Compatibility Table

Open ZZ-Cat opened this issue 2 months ago • 4 comments

Right-oh. Been a hot minute since I last made any Pull Requests for new targets.
As per #159, this adds support for the DOIT ESP32 DevKit V1.

I have been made aware that there may also be a conflict between CFA and how this target handles UART, as it uses The Old Skool Method™️ of sharing the default UART with an external Serial-to-USB converter chip.

So I have marked this Pull Request as a draft until this gets sorted.

ZZ-Cat avatar Nov 01 '25 23:11 ZZ-Cat

Right-oh @DurvalMenezes, you're up. =^/.^=

You can check-out the topic branch either by downloading-and-extracting the zip to where you have CFA currently installed relative to your IDE, or do a git clone -b ZZ-Cat/issue159 https://github.com/ZZ-Cat/CRSFforArduino.git

Then in CFA_Config.hpp, enable CRSF_DEBUG_ENABLED as well as CRSF_DEBUG_ENABLE_COMPATIBILITY_TABLE_OUTPUT and CRSF_DEBUG_ENABLE_CONFIGURATION_DUMP.

Then flash your choice of examples to your development board. To keep it simple for now, I recommend picking the rc_channels.ino file.

If you're getting grief on the default port, try the ESP32-specific constructor CRSFforArduino(HardwareSerial *serialPort, int RxPin, int TxPin)

Example:

#include "CRSFforArduino.h"

/* Define your custom UART pinouts here. */
#define MY_UART_RX_PIN 2
#define MY_UART_TX_PIN 3

/* Declare a null pointer to CRSF for Arduino. */
CRSFforArduino *crsf = nullptr;

void setup()
{
    /* Instantiate CRSF for Arduino with your custom pins. */
    crsf = new CRSFforArduino(&Serial1, MY_UART_RX_PIN, MY_UART_TX_PIN);
}

void loop()
{
    /* Your main code here... */
}

In this case, you may also need to point Serial1 (or whichever UART instance you are using) to what pins you are trying to use as well.

CRSF for Arduino supports custom baud rates as well. Although it defaults to 416,666 if you do not specify a baud rate when begin() is called.

ZZ-Cat avatar Nov 02 '25 00:11 ZZ-Cat

Also fuck my dyslexia. =</.>=
I been calling it "ESP32 DOIT" this entire time, and only now realised it's "DOIT ESP32" and not the other way around.

ZZ-Cat avatar Nov 02 '25 00:11 ZZ-Cat

Right-oh @DurvalMenezes, you're up. =^/.^=

DurvalMenezes.state = UP :-)

Seriously, thanks for the detailed instructions. Followed them to the letter and here's what trying to compile rc_channels.ino gets me:

/REDACTED/Arduino/libraries/CRSFforArduino/src/SerialReceiver/SerialReceiver.cpp: In member function 'bool serialReceiverLayer::SerialReceiver::begin(uint32_t)':
/REDACTED/Arduino/libraries/CRSFforArduino/src/SerialReceiver/SerialReceiver.cpp:365:55: error: 'PIN_SERIAL1_RX' was not declared in this scope
  365 |         CRSF_DEBUG_SERIAL_PORT.println(_rxPin == -1 ? PIN_SERIAL1_RX : _rxPin);
      |                                                       ^~~~~~~~~~~~~~
/REDACTED/Arduino/libraries/CRSFforArduino/src/SerialReceiver/SerialReceiver.cpp:367:55: error: 'PIN_SERIAL1_TX' was not declared in this scope
  367 |         CRSF_DEBUG_SERIAL_PORT.println(_txPin == -1 ? PIN_SERIAL1_TX : _txPin);
      |                                                       ^~~~~~~~~~~~~~
exit status 1

Compilation error: exit status 1

Looks like a couple of #define's are missing. So, where did I mess it up?

DurvalMenezes avatar Nov 02 '25 10:11 DurvalMenezes

Also fuck my dyslexia. =</.>= I been calling it "ESP32 DOIT" this entire time, and only now realised it's "DOIT ESP32" and not the other way around.

He who has never inverted two words in entirely arbitrary names may cast the first nasty comment... :-)

DurvalMenezes avatar Nov 02 '25 10:11 DurvalMenezes