Programing code failure or wrong GPIO pin?

Do you have a common ground connection between the relay board and the esp board?