I am using an ESP8266 wifi chip to control 4 relays which are connected to GPIO10,GPIO12,GPIO13,GPIO14 respectively. Now the problem is while updating firmware either using serial or OTA, the PIN GPIO10 goes HIGH automatically which also activates the relay during update.
The flash mode is DIO and a pull down register is also connected to GPIO10.
Why are you using GPIO10?
My guess is that the DIO/QIO setting doesn't have effect during upload.
Just use a different pin, that doesn't have a special function.
Also, consider using IO expanders like shift registers when you start to run out of IO pins.
GPIO10 is used for the flash during firmware update; use a different pin.
spycatcher2k:
NEVER upload code a microcontroller with anything plugged into it! you may activate an actuator that could harm you, or someone else!
Think about what you said. Are there not many microcontrollers mounted on the same board as other devices - yet we still update the firmware on them, despite the controller being connected to them. OTA updates, where firmware is updated remotely without touching the device are commonplace. Making sure that they won't activate those devices during firmware update is a key step in the design.... particularly if there are mechanical things connected that are large enough to cause harm, but OP has not indicated that there are...