Source code is very simple. Just include <Servo.h> and move the servo from 0 degree to 180 degrees in loop().
Everything works fine if I reset the power of ESP8266 and then connect GPIO pin to servo's pulse pin.
But whenever I reset the power of ESP8266 with GPIO to servo still remained connected, servo doesn't work as programmed but moves in a wrong direction and stuck.
Servo motor is powered by 5V, ESP8266 is powered by 3.3V. Both are from Raspberry Pi and sharing the GND.
How can I solve this problem?