How to drive a relay from ESP8266 gpio
Both modules handle things differently. The single relay module uses a direct PNP transistor to control the relay. Active low. Since your base never gets lower than 4.3V (5v - 0.7v VBE drop), it will never turn off. This is also why you see ~4.3V when IN is floating. The leakage current through the VBE diode is enough to cause this, and can also keep the transistor on by itself.

Your 3.3V output can never turn this off. You can fix this with a driver circuit. Any common NPN and two resistors. The logic is inverted due to the NPN. So Output High is NPN on which is PNP on which is Relay on.



simulate this circuit &ndash; Schematic created using CircuitLab
The other module is more complicated. It uses an Opto-coupler to drive the relay transistor.

The opto's led side has multiple problems for your ESP though. It's tied to VCC. It's resistor was chosen based on 5V VCC. It has an inline status led. Since your GPIO is 3.3V, that means it can never really turn the opto couple off. At logic High, the opto sees 5V - 3.3V = 1.7V across everything, so the transistor side stays conducting.
Also, your picture shows that the VCC to JD-VCC jumper is connected. This means you didn't power the Opto side from 3.3V, and you maybe caused the non-5V tolerant ESP GPIO could have been damaged.
But you can test with the same thing as above. A NPN + Base Resistor is all you need. You don't need the pull up (R2 10k).