А покажите как пишете
да абсолютно стандартный код взял.
void onMqttMessage(char* topic, char* payload, AsyncMqttClientMessageProperties properties, size_t len, size_t index, size_t total) {
if (strcmp(topic, MOVE_SECS) == 0) {
moveSecs = 0;
Serial.print("New RAW Position received MOVE_SECS: "); // " сообщение: "
Serial.println(payload);
Serial.println(payload[0]);
moveSecs = atoi(payload);
Serial.print("NewPosition received MOVE_SECS: "); // " сообщение: "
Serial.println(moveSecs);
}
if (strcmp(topic, DIRECTION) == 0) {
Serial.print("New RAW direction received: "); // " сообщение: "
int directionInt = atoi(payload);
Serial.println(direction);
if(directionInt == 1) direction = true;
else direction = false;
servoStartMove(moveSecs, direction);
}
}