Servo motor and ESC "linked" on an ESP32

I have an esp32 that is connected to a servo and an esp32 and I would like to use the PWM outputs to control the 2. This is where I have a problem, because I have the impression that the 2 are "linked". When I increase one, the 2 do not move at all normally. They make random movements.I use the ESP32Servo library.I think it might be due to the Timer, but I can't find anything about it. Thanks in advance.

If you don't post any info, it's difficult to help.
Try to allocate two timers.

void setup() {
  
  ESP32PWM::allocateTimer(1);
  ESP32PWM::allocateTimer(2);
....

Yes, sorry, I was a bit quick. This is for a remote control car project. There are 2 HC-12 (radio module) to ensure communication between the car and the remote control. The information is sent in this format '[Vehicle ID]/[Engine Speed]/[Wheel Orientation]!'. There are 2 servos, a servomotor to control the wheels and an ESC for the motor. I am sending you the code attached.

#include <ESP32Servo.h>
#include <HardwareSerial.h>
#include <ESP32PWM.h>

// === Settings ===
const String Player = "A";  // Vehicle identifier

// === Pin definitions ===
const byte Wheel_Pin = 12;     // ESC control pin
const byte Servo_Pin = 14;     // Steering servo control pin

// === Motor objects ===
Servo esc;
Servo servo;

// === Global variables ===
int Wheel;
int Servo_dir;
int Servo_dirSave;
int pwmVal;
int pwmValSave = 1500;
float batteryVoltage = 0;
String vitesse = "...";
String vitesseSave = "...";
String input;
unsigned long long lastSng = 0;
unsigned long long lastSend = 0;

ESP32PWM pwm;

void setup() {
  ESP32PWM::allocateTimer(4);
  ESP32PWM::allocateTimer(5);

  // Initialize ESC
  esc.attach(Wheel_Pin);
  esc.write(1500);  // Neutral signal for ESC
  delay(7000);      // Wait for ESC initialization

  // Initialize steering servo
  servo.attach(Servo_Pin);
  servo.write(90);  // Center position

  // Serial communications
  Serial.begin(115200);                   // Debug serial
  Serial1.begin(9600, SERIAL_8N1, 3, 1);  // HC-12 receive (RX=3, TX=1)
  Serial2.begin(9600, SERIAL_8N1, 16, 17);// HC-12 transmit (RX=16, TX=17)

  // Status LED or signal pin
  pinMode(2, OUTPUT);

  // Set ADC resolution for battery monitoring
  analogReadResolution(12);
}

void loop() {
  getData();           // Read data from transmitter
  checkDisconnected(); // Fail-safe if signal is lost
  readBatteryVoltage();// Measure battery voltage
  sendData();          // Send telemetry
  delay(1);
}

// === Reads control data from HC-12 ===
void getData() {
  if (Serial1.available()) {
    digitalWrite(2, HIGH);  // Signal detected
    input = Serial1.readStringUntil('!');
    input.trim();

    // Keep only the last complete command starting with "A/"
    int lastAIndex = input.lastIndexOf("A/");
    if (lastAIndex != -1) {
      input = input.substring(lastAIndex);
    }

    int firstSlash = input.indexOf('/');
    int secondSlash = input.indexOf('/', firstSlash + 1);

    if (input.startsWith("A/") && firstSlash != -1 && secondSlash != -1 && secondSlash < input.length() - 1) {
      // Extract values
      Wheel = input.substring(firstSlash + 1, secondSlash).toInt();
      pwmVal = map(Wheel, 0, 1023, 2000, 1000); // Inverted for ESC
      pwmVal = pwmVal / 10 * 10;                // Round to nearest 10

      Servo_dir = input.substring(secondSlash + 1).toInt();

      // Update ESC if needed
      if (pwmVal != pwmValSave) {
        esc.write(pwmVal);
        delay(1);
      }

      // Update steering if needed
      if (Servo_dir != Servo_dirSave) {
        servo.write(Servo_dir);
        delay(1);
      }

      pwmValSave = pwmVal;
      Servo_dirSave = Servo_dir;
      lastSng = millis(); // Timestamp last signal
    }
  } else {
    digitalWrite(2, LOW); // No signal
  }
}

// === Fail-safe if signal is lost ===
void checkDisconnected() {
  if (millis() - lastSng > 10) {
    Serial.println("Signal lost - resetting to safe state");
    esc.write(1500); // Stop ESC
    servo.write(90); // Center steering
  }
}

// === Reads and calibrates battery voltage ===
void readBatteryVoltage() {
  int adcValue = analogRead(33); // Voltage divider input
  float voltageMesure = (adcValue * 3.3) / 4096;
  batteryVoltage = voltageMesure * ((10000.0 + 3300.0) / 3300.0); // Voltage divider
  batteryVoltage = 0.6365 * batteryVoltage + 4.2617; // Empirical calibration
}

// === Sends telemetry via second HC-12 ===
void sendData() {
  if (vitesse != vitesseSave || millis() - lastSend > 1000) {
    String buildString = Player + "/" + batteryVoltage + "/" + vitesse + "&";
    Serial2.print(buildString);
    vitesseSave = vitesse;
    lastSend = millis();
  }
}

Explain me that. What specific Esp32 variant you have?

ESP32-DevKitC-32 development board with an ESP32-WROOM-32 module.

So you have both serials on same pins. I wonder you didn't get any warnings.
Anyway, move the serial1 pins to 18 and 19 for example...

Do I need to resolder on the new pins?

Serial is connected to 1 and 3, so Serial1 can't be on those (since you use Serial).

It's okay, I fixed that, but the problem still persists.

At least your Usb serial monitor is now separate from HC-12.
Why you have two HC12 by the way?
Try to play with different allocateTimer.
Or add one "fake" Servo between esc and servo.
Purpose is to "force" them to different timers. Esp32 has 2 channels on one timer afaik.

it's a long story but the HC12 is half-duplex and it was faster to take tow of theme than buy a duplex module.

Ahh ok, that gave it a chance to "work" with your mixed UARTs.

Update. I finally got it by changing one of the two pins. It might have been too close (I don't see how that could play a role, but the result is there). I replaced 14 -> 26. Luckily it didn't take me 6 hours of research and a question on a forum...