http://www.andremiller.net/content/upgrading-sonoff-wireless-smart-switch-flash-memory-esp8266
Upgrading Sonoff Wireless Smart Switch Flash Memory (ESP8266)