5v relay not working from GPIO
Your issue is likely that the esp-32 cannot source enough current to activate the relay. Try using a transistor to drive the relay coil rather than having the esp drive it directly.