By accident here updated one of two SonOff basic device to firmware 1.6.
Then using Windows Atom attempted to update firmware via JTAG.
Left here with a bricked device looking at the serial link. It would boot up and keep trying to connect to the WiFi connection.
This morning installed python esptools on my Linux laptop.
1 - Download Esptool Source code from download to a known folder.
2 - Install esptools - python setup.py install
3 - save current flash.bin (optional)
IBMNBK:/# esptool.py --port /dev/ttyUSB0 read_flash 0x00000 0x100000 image1M.bin
esptool.py v2.3.1
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Uploading stub...
Running stub...
Stub running...
1048576 (100 %)
1048576 (100 %)
Read 1048576 bytes at 0x0 in 95.7 seconds (87.7 kbit/s)...
Hard resetting via RTS pin...
IBMNBK:/# ls *.bin
image1M.bin
4 - erase current firmware (optional)
IBMNBK:/# esptool.py --port /dev/ttyUSB0 erase_flash
esptool.py v2.3.1
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 2.8s
Hard resetting via RTS pin...
4 - write mcsTasmota.bin current firmware
IBMNBK:/# esptool.py --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 mcsTasmota.bin
esptool.py v2.3.1
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Compressed 506976 bytes to 350565...
Wrote 506976 bytes (350565 compressed) at 0x00000000 in 30.9 seconds (effective 131.1 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
5 - Checking boot up via minicom / serial connection
Welcome to minicom 2.7
OPTIONS: I18n
Compiled on Feb 7 2016, 13:37:27.
Port /dev/ttyUSB0, 09:29:04
Press CTRL-A Z for help on special keys
00:00:00 WIF: Connecting to AP1 default in mode 11N as sonoff-7596...
00:00:07 WIF: Connect failed as AP cannot be reached
00:00:07 WIF: Connecting to AP1 default in.
This is the same issue that I have seen when updating the sonoff basic with sonoff firmware version 1.6.
Connecting to AP1 default in mode 11N as sonoff-7596
Scanning wireless here do not see SSID sonoff-7596 such that this is were I believe the Sonoff Firmware revision 1.6 upgrade the sonoff basic radio.
Looking now for Sonoff basic firmware 1.5X and will try to upload this firmware to the Sonoff basic device.
Found one called sonoff-basic-DHTxx.fw.afe.bin. Cleared firmware and uploaded this firmware then uploaded mcs.bin
Looks a bit different but radio stuff is the same. Hitting pairing button and see:
0:01:31 RSL: sonoff/RESULT = {"Reset":"Reset and Restarting"}
SettingsDefault
00:01:32 CFG: Use defaults
00:01:33 APP: Restarting
ets Jan 8 2013,rst cause:1, boot mode
3,6)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v4ceabea9
~ld
00:00:00 Project sonoff Sonoff (Topic sonoff, Fallback MCS_44BDAC, GroupTopic sonoffs) Version 5.9.10
00:00:00 WIF: Connecting to AP1 default in mode 11N as sonoff-7596...
00:00:07 WIF: Connect failed as AP cannot be reached
00:00:07 WIF: Connecting to AP1 default in mode 11N as sonoff-7596...
00:00:14 WIF: Connect failed as AP cannot be reached
00:00:14 WIF: WPSConfigactive for 1 minute
Scanning the wireless network with openWRT do see the client / AP named ESP_44BDAC
Channel: 1 | Mode: Master | BSSID: 2E:3A:E8:44:BD:AC | Encryption: open
Switched to Windows 7 Arduino software IDE programmer. Also noticed that it is available for Linux.
1 - download it here ==> IDE
2 - In Ubuntu downloaded arduino-nightly-linux64.tar.xz and extracted as arduino-nightly to the download directory
3 - in download directory do a cd arduino-nightly
4 - run the install.sh
5 - you should see an icon on your desktop when complete.
[ATTACH]69149[/ATTACH]
6 - configuration of IDE for use with SonOff
A - Open Arduino IDE and go to Preferences.
B - Under Additional Boards Manager URLs field, enter hxxp://arduino.esp8266.com/stable/package_esp8266com_index.json
C - Open Tools > Board > Boards Manager.
D - Search for ESP8266 and install.
E - Option settings in the Arduino IDE should look like this:
Again cleared the flash and installed a generic firmware with wifi. Cleared the flash again and installed original SonOff sketch. Change wireless below to your AP stuff.
Went back to Linux and I was able to program the SonOff basic using the python SonOTA uploader.
After uploading original SonOff bins went back to using the SonOTA script ran it again after the above, saw the sonoff-xxxx (instead of the ITEAD-*) AP.
The script then said I was in the finalstage piece and kept uploading the firmware.
I had done this before except it did not work with version 1.6 of the SonOff firmware.
Thinking the bins attached are SonOff firmware 1.5 or 1.4x and those may write to the Wifi card in the Sonoff Wifi basic device.
Then updated it to the mcs.bin.
All is well now.
Then using Windows Atom attempted to update firmware via JTAG.
Left here with a bricked device looking at the serial link. It would boot up and keep trying to connect to the WiFi connection.
This morning installed python esptools on my Linux laptop.
1 - Download Esptool Source code from download to a known folder.
2 - Install esptools - python setup.py install
3 - save current flash.bin (optional)
IBMNBK:/# esptool.py --port /dev/ttyUSB0 read_flash 0x00000 0x100000 image1M.bin
esptool.py v2.3.1
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Uploading stub...
Running stub...
Stub running...
1048576 (100 %)
1048576 (100 %)
Read 1048576 bytes at 0x0 in 95.7 seconds (87.7 kbit/s)...
Hard resetting via RTS pin...
IBMNBK:/# ls *.bin
image1M.bin
4 - erase current firmware (optional)
IBMNBK:/# esptool.py --port /dev/ttyUSB0 erase_flash
esptool.py v2.3.1
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 2.8s
Hard resetting via RTS pin...
4 - write mcsTasmota.bin current firmware
IBMNBK:/# esptool.py --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 mcsTasmota.bin
esptool.py v2.3.1
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Compressed 506976 bytes to 350565...
Wrote 506976 bytes (350565 compressed) at 0x00000000 in 30.9 seconds (effective 131.1 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
5 - Checking boot up via minicom / serial connection
Welcome to minicom 2.7
OPTIONS: I18n
Compiled on Feb 7 2016, 13:37:27.
Port /dev/ttyUSB0, 09:29:04
Press CTRL-A Z for help on special keys
00:00:00 WIF: Connecting to AP1 default in mode 11N as sonoff-7596...
00:00:07 WIF: Connect failed as AP cannot be reached
00:00:07 WIF: Connecting to AP1 default in.
This is the same issue that I have seen when updating the sonoff basic with sonoff firmware version 1.6.
Connecting to AP1 default in mode 11N as sonoff-7596
Scanning wireless here do not see SSID sonoff-7596 such that this is were I believe the Sonoff Firmware revision 1.6 upgrade the sonoff basic radio.
Looking now for Sonoff basic firmware 1.5X and will try to upload this firmware to the Sonoff basic device.
Found one called sonoff-basic-DHTxx.fw.afe.bin. Cleared firmware and uploaded this firmware then uploaded mcs.bin
Looks a bit different but radio stuff is the same. Hitting pairing button and see:
0:01:31 RSL: sonoff/RESULT = {"Reset":"Reset and Restarting"}
SettingsDefault
00:01:32 CFG: Use defaults
00:01:33 APP: Restarting
ets Jan 8 2013,rst cause:1, boot mode

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v4ceabea9
~ld
00:00:00 Project sonoff Sonoff (Topic sonoff, Fallback MCS_44BDAC, GroupTopic sonoffs) Version 5.9.10
00:00:00 WIF: Connecting to AP1 default in mode 11N as sonoff-7596...
00:00:07 WIF: Connect failed as AP cannot be reached
00:00:07 WIF: Connecting to AP1 default in mode 11N as sonoff-7596...
00:00:14 WIF: Connect failed as AP cannot be reached
00:00:14 WIF: WPSConfigactive for 1 minute
Scanning the wireless network with openWRT do see the client / AP named ESP_44BDAC
Channel: 1 | Mode: Master | BSSID: 2E:3A:E8:44:BD:AC | Encryption: open
Switched to Windows 7 Arduino software IDE programmer. Also noticed that it is available for Linux.
1 - download it here ==> IDE
2 - In Ubuntu downloaded arduino-nightly-linux64.tar.xz and extracted as arduino-nightly to the download directory
3 - in download directory do a cd arduino-nightly
4 - run the install.sh
5 - you should see an icon on your desktop when complete.
[ATTACH]69149[/ATTACH]
6 - configuration of IDE for use with SonOff
A - Open Arduino IDE and go to Preferences.
B - Under Additional Boards Manager URLs field, enter hxxp://arduino.esp8266.com/stable/package_esp8266com_index.json
C - Open Tools > Board > Boards Manager.
D - Search for ESP8266 and install.
E - Option settings in the Arduino IDE should look like this:
- Flash Mode: DIO
- Flash Frequency: 40MHz
- Upload Using: Serial
- CPU Frequency: 80MHz
- Flash Size: 1M (64K SPIFFS)
- Debug Port: Disabled
- Debug Level: None
- Reset Method: ck
- Upload Speed: 115200
- Port: Your COM port connected to Sonoff
Again cleared the flash and installed a generic firmware with wifi. Cleared the flash again and installed original SonOff sketch. Change wireless below to your AP stuff.
Code:
/* Simple Wifi Switch */ #include <ESP8266WiFi.h> #include <WiFiClient.h> #include <ESP8266WebServer.h> #include <ESP8266mDNS.h> MDNSResponder mdns; // Replace with your network credentials const char* ssid = "YOUR_WIFI_SSID"; const char* password = "YOUR_WIFI_PASSWORD"; ESP8266WebServer server(80); String web_on_html = "<h1>SONOFF switch is ON</h1><p><a href=\"on\"><button>ON</button></a> <a href=\"off\"><button>OFF</button></a></p>"; String web_off_html = "<h1>SONOFF switch is OFF</h1><p><a href=\"on\"><button>ON</button></a> <a href=\"off\"><button>OFF</button></a></p>"; int gpio_13_led = 13; int gpio_12_relay = 12; void setup(void){ // Init pinMode(gpio_13_led, OUTPUT); digitalWrite(gpio_13_led, HIGH); pinMode(gpio_12_relay, OUTPUT); digitalWrite(gpio_12_relay, HIGH); Serial.begin(115200); delay(5000); WiFi.begin(ssid, password); Serial.println("Connecting to wifi.."); // Wait for connection while (WiFi.status() != WL_CONNECTED) { digitalWrite(gpio_13_led, LOW); delay(500); Serial.print("."); Serial.println(WiFi.localIP()); Serial.println(WiFi.status()); digitalWrite(gpio_13_led, HIGH); delay(500); } Serial.println(""); Serial.print("Connected to "); Serial.println(ssid); Serial.print("IP address: "); Serial.println(WiFi.localIP()); if (mdns.begin("esp8266", WiFi.localIP())) { Serial.println("MDNS responder started"); } server.on("/", [](){ if(digitalRead(gpio_12_relay)==HIGH) { server.send(200, "text/html", web_on_html); } else { server.send(200, "text/html", web_off_html); } }); server.on("/on", [](){ server.send(200, "text/html", web_on_html); digitalWrite(gpio_13_led, LOW); digitalWrite(gpio_12_relay, HIGH); delay(1000); }); server.on("/off", [](){ server.send(200, "text/html", web_off_html); digitalWrite(gpio_13_led, HIGH); digitalWrite(gpio_12_relay, LOW); delay(1000); }); server.begin(); Serial.println("Server ready.."); } void loop(void){ server.handleClient(); }
Went back to Linux and I was able to program the SonOff basic using the python SonOTA uploader.
After uploading original SonOff bins went back to using the SonOTA script ran it again after the above, saw the sonoff-xxxx (instead of the ITEAD-*) AP.
The script then said I was in the finalstage piece and kept uploading the firmware.
I had done this before except it did not work with version 1.6 of the SonOff firmware.
Thinking the bins attached are SonOff firmware 1.5 or 1.4x and those may write to the Wifi card in the Sonoff Wifi basic device.
Then updated it to the mcs.bin.
All is well now.
Comment