I'm trying to get my ST3215 servos moving, I tried using official SCServo library but its more for ESP32 and did not work the Arduino did not see them when pinged did not move when sent move package, I tried sending example packets from official documentation using Serial1.write because i have it on Serial1 pins (0,1) then it goes to custom driver that just puts it into one half duplex wire, I tried every possible way to get it working but it just does not. The servos are a nightmare when using official driver ESP32 one, the servos sometmes only move in one direction or not get detected and have awful delay even the official flash tool doesnt see the ESP32.
I have no idea what is wrong if its the packets somehow, I tried viewing if something is on the line with osciloscope and it does seem something is going through however the servos dont move a bit
image is schematic of the driver
i tried also this code with no success I hope someone used this servo and could help
#define BAUD_RATE 1000000 // 1 Mbps baud rate for communication with the servo
void setup() {
// Initialize Serial Monitor for debugging (optional)
Serial.begin(9600);
// Initialize Serial1 for servo communication (1 Mbps)
Serial1.begin(BAUD_RATE);
// Give it a moment to initialize communication
delay(1000);
// First, enable torque
enableTorque();
// Then, send the official packet to set the position
sendOfficialPacket();
}
void enableTorque() {
// Construct packet to enable torque
byte packet[] = {
0xFF, 0xFF, // Header
0xFE, // ID (1st servo)
0x04, // Length (4 bytes)
0x02, // Instruction: WRITE
0x28, // Register Address for Torque Enable (0x18)
0x00, // Enable torque (0x01)
0xD3 // Checksum (calculate the checksum for this packet)
};
// Print packet for debugging (optional)
printPacket(packet);
// Send the packet via Serial1 (for half-duplex communication with servos)
Serial1.write(packet, sizeof(packet));
Serial1.flush();
}
void sendOfficialPacket() {
// Construct the packet to set the position
byte packet[] = {
0xFF, 0xFF, // Header
0xFE, // ID (broadcast to all servos)
0x09, // Length (9 bytes of data)
0x03, // Instruction: WRITE
0x2A, // Address: Position (0x2A)
0x00, 0x08, // Position: 2048 (0x0800 in little-endian format)
0x00, 0x00, // Time: 0
0xE8, 0x03, // Speed: 1000 (in little-endian format)
0xD5 // Checksum (calculated correctly)
};
// Print packet for debugging (optional)
printPacket(packet);
// Send the packet via Serial1 (for half-duplex communication with servos)
Serial1.write(packet, sizeof(packet));
Serial1.flush();
}
void printPacket(byte packet[]) {
Serial.println("Sending packet:");
for (int i = 0; i < sizeof(packet); i++) {
Serial.print("0x");
if (packet[i] < 0x10) {
Serial.print("0");
}
Serial.print(packet[i], HEX);
Serial.print(" ");
}
Serial.println();
}
void loop() {
}