diff --git a/arduino_code/Test/src/mqtt_handler.cpp b/arduino_code/Test/src/mqtt_handler.cpp index d4862e9..e896ef9 100644 --- a/arduino_code/Test/src/mqtt_handler.cpp +++ b/arduino_code/Test/src/mqtt_handler.cpp @@ -441,7 +441,7 @@ void handleServoMQTTCommand(const char* topic, const char* payload) { int channel = -1; char command[32] = {0}; - if (sscanf(topic, "servo/control/%d/%s", &channel, command) != 2) { + if (sscanf(topic, "servo/control/%2d/%8s", &channel, command) != 2) { Serial.printf("Invalid servo topic: %s\n", topic); return; }