xoseperez / sonoffsc

Itead Studio SonoffSC custom firmware with MQTT and Domoticz support
GNU General Public License v3.0
104 stars 35 forks source link

SendColor function - no red #18

Closed U-R-CrazyBro closed 6 years ago

U-R-CrazyBro commented 6 years ago

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

xoseperez commented 6 years ago

Hi Sorry for the late reply. This could be an issue with the old (pre 1.0) version. Check the latest one, please.