In this Christmas period, i use an ESPEasy with a MCP23017 to switch on/off all my christmas lights.
But with Domoticz, if i send 8 mcpgpio command in the same time, my little Esp


So i've made a little addition to the MCP Plugin : the "mcpioall" command :
Code: Select all
if (tmpString.equalsIgnoreCase("MCPIOALL"))
{
success = true;
argIndex = string.lastIndexOf(',');
tmpString = string.substring(argIndex + 1);
char tmp[17];
tmpString.toCharArray(tmp, 17);
urlDecode(tmp);
for (int p = 0; p < 16; p++) {
if (printToWeb)
{
printWebString += F("MCPIOALL Port ");
printWebString += p;
}
if (tmp[p] == '0' || tmp[p] == '1') {
Plugin_009_Write(p, tmp[p]);
if (printToWeb)
{
printWebString += F(" Set to ");
printWebString += tmp[p];
printWebString += F("<BR>");
}
} else {
if (printToWeb)
{
printWebString += F(" Ignored ");
printWebString += F("<BR>");
}
}
}
}
where the last value be the setting for each port of the mcp23017. The result for this command is :
MCPIOALL Port 0 Set to 1
MCPIOALL Port 1 Set to 0
MCPIOALL Port 2 Set to 1
MCPIOALL Port 3 Set to 0
MCPIOALL Port 4 Set to 0
MCPIOALL Port 5 Ignored
MCPIOALL Port 6 Set to 0
MCPIOALL Port 7 Set to 0
MCPIOALL Port 8 Set to 1
MCPIOALL Port 9 Ignored
MCPIOALL Port 10 Ignored
MCPIOALL Port 11 Ignored
MCPIOALL Port 12 Ignored
MCPIOALL Port 13 Ignored
MCPIOALL Port 14 Ignored
MCPIOALL Port 15 Ignored
and that all !