ESP8266 Switching firmware on the fly
The esp8266 Arduino package has 3 libraries for firmware update. 


ArduinoOTA for upload from Arduino IDE
ESP8266HTTPUpdateServer for upload with web browser
ESP8266httpUpdate library to check a web server for new version of the
firmware