diff --git a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino index 6a8d8ca5e..9c3080c3c 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino @@ -1245,7 +1245,12 @@ void CmndShutterPosition(void) ShutterReportPosition(true, index); } XdrvMailbox.index = index +1; // Fix random index for ShutterClose - strcpy( XdrvMailbox.command , D_CMND_SHUTTER_POSITION); + + // As this function is called three times from outside the command handler + // XdrvMailbox.command may not point to a char string resulting in exception 29 on strcpy + char command[CMDSZ] = { 0 }; + XdrvMailbox.command = command; + strcpy(XdrvMailbox.command, D_CMND_SHUTTER_POSITION); ResponseCmndIdxNumber((Settings->shutter_options[index] & 1) ? 100 - target_pos_percent : target_pos_percent); } else { ShutterReportPosition(true, MAX_SHUTTERS);