You never get red returned, while debigging noticed the following:
[MQTT] Received /test/sonoffsc/rgb => rgb( 224, 154, 44)
AT+R=0
AT+G=154
AT+B=44
AT+RGBEXEC=1
I suspect that rgbValues contains "rgb( 224,154, 44) so strtokIndx will contain "rgb( 224" possibly causing the atoi function to fail.
re:
strtokIndx = strtok(rgbValues, ","); // get the first part - the string
rValue = atoi(strtokIndx); // convert this part to an integer
You never get red returned, while debigging noticed the following: [MQTT] Received /test/sonoffsc/rgb => rgb( 224, 154, 44) AT+R=0 AT+G=154 AT+B=44 AT+RGBEXEC=1
I suspect that rgbValues contains "rgb( 224,154, 44) so strtokIndx will contain "rgb( 224" possibly causing the atoi function to fail. re: strtokIndx = strtok(rgbValues, ","); // get the first part - the string rValue = atoi(strtokIndx); // convert this part to an integer