invalid conversion from 'const char*' to 'char*' [-fpermissive]
strtok modifies the char buffer entered as first parameter. It replaces the delimiters with terminating zeros. To parse a constant string with strtok, you must first copy it into a working char buffer.

For your test you can initialize a char array as in following example.

char payload[] = "setBrightness: 15";

uint8_t brightness;

void setup() {
  Serial.begin(9600);

  if(strncmp(payload, "setBri", 6) == 0) { // Search message
   strtok(payload, " ");
   const char* tok = strtok(NULL," "); // Get value (15)
   brightness = (uint8_t) atoi(tok); // Convert to uint8_t
  }
}

void loop() {}




if you know the 'name' part of the name:value string, you can skip it for atoi this way:

brightness = (uint8_t) atoi(payload + strlen("setBrightness: "));

(strlen("setBrightness: " will be evaluated at compile time to a constant number)

const char payload[] = "setBrightness: 15";

uint8_t brightness;

void setup() {
  Serial.begin(9600);

  if(strncmp(payload, "setBri", 6) == 0) { // Search message
     brightness = (uint8_t) atoi(payload + strlen("setBrightness: ")); // Convert to uint8_t
  }
}

void loop() {}