Formatting

Michael Ingraham 2019-08-13 10:02:55 -04:00
parent ec6061c0e6
commit eb632169cd
1 changed files with 42 additions and 63 deletions

@ -1,6 +1,6 @@
Some new Sonoff devices support the new [Itead DIY architecture](https://www.youtube.com/watch?v=fRS-ukCgD_I) which allows OTA firmware upload. With [Sonoff DIY](https://github.com/itead/Sonoff_Devices_DIY_Tools), a user has more control over the hardware features of the device and also allows for upgrading the firmware without additional hardware. Some new Sonoff devices support the new [Itead DIY architecture](https://www.youtube.com/watch?v=fRS-ukCgD_I) which allows OTA firmware upload. With [Sonoff DIY](https://github.com/itead/Sonoff_Devices_DIY_Tools), a user has more control over the hardware features of the device and also allows for upgrading the firmware without additional hardware. The following procedure upgrades Sonoff eWelink firmware to Tasmota.
## Compatible devices # Compatible devices
Currently the following devices officially support Sonoff DIY: Currently the following devices officially support Sonoff DIY:
- Sonoff Basic R3 - Sonoff Basic R3
- Sonoff RF R3 - Sonoff RF R3
@ -8,22 +8,21 @@ Currently the following devices officially support Sonoff DIY:
As Sonoff DIY is enabled by connecting GPIO16 to GND it may well be possible that other Sonoff devices running eWelink 3.1 or higher will also support it. As Sonoff DIY is enabled by connecting GPIO16 to GND it may well be possible that other Sonoff devices running eWelink 3.1 or higher will also support it.
## Flash procedure # Flash procedure
The following procedure upgrades Sonoff eWelink software to Tasmota using a Windows laptop. ## Using the Itead DIY tool
### Verify and/or update eWelink firmware version ### Verify and/or update eWelink firmware version
- Open the device and remove the jumper labeled OTA if present * Open the device and remove the jumper labeled OTA if present
- Power on device and connect to eWelink * Power on device and connect to eWelink
- Update eWelink firmware to at least 3.1 (mine came with 3.0) * Update eWelink firmware to at least 3.1
### Flash Tasmota ### Flash Tasmota
- Download the [Sonoff DIY `tool_01DIY85`](https://github.com/itead/Sonoff_Devices_DIY_Tools) from Github: - Download the [Sonoff DIY `tool_01DIY85`](https://github.com/itead/Sonoff_Devices_DIY_Tools) from Github:
- `./tool` `.exe` (Microsoft Windows) - `./tool` `.exe` (Microsoft Windows)
- `./code` `.py` (not yet tested) - `./code` `.py` (_not yet tested_)
- Power off the Sonoff DIY device and install the DIY OTA jumper - Power off the Sonoff DIY device and install the DIY OTA jumper
- Modify your PC configuration to provide a Mobile hotspot: - Modify your PC configuration to provide a Mobile hotspot:
- SSID: `sonoffDiy` (_**case sensitive!**_) - SSID: `sonoffDiy` (_**case sensitive!**_)
- Password: `20170618sn` - Password: `20170618sn`
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/w10mobile_hotspot.png" /> <img src="https://github.com/arendst/arendst.github.io/blob/master/media/w10mobile_hotspot.png" />
- Power on the Sonoff device and verify that it shows up on the Mobile hotspot Settings page - Power on the Sonoff device and verify that it shows up on the Mobile hotspot Settings page
- Start the `tool_01DIY85` utility - Start the `tool_01DIY85` utility
- The utility should discover the device - The utility should discover the device
@ -35,80 +34,60 @@ The following procedure upgrades Sonoff eWelink software to Tasmota using a Wind
If the firmware update gets stuck at 0%, the Sonoff device could not reach the manufacturer server because your mobile hotspot does not share the Internet connection. If this happens, use the DIY tool to set the SSID and password of your Wi-Fi network on the sonoff device. The device will connect to your network. Disable the hotspot and use your Wi-Fi for DIY tool laptop as well. Now start `Brush machine` again, flash Tasmota. Then continue with this guide. If the firmware update gets stuck at 0%, the Sonoff device could not reach the manufacturer server because your mobile hotspot does not share the Internet connection. If this happens, use the DIY tool to set the SSID and password of your Wi-Fi network on the sonoff device. The device will connect to your network. Disable the hotspot and use your Wi-Fi for DIY tool laptop as well. Now start `Brush machine` again, flash Tasmota. Then continue with this guide.
Once the firmware upload completes and the device restarts, it is recommend that you load the firmware variant needed for your device and use case (e.g., `sonoff.bin`). Once the desired firmware is on the device, continue the regular Tasmota setup process.
### Clean up ### Clean up
- Quit DIY mode tool - Quit DIY mode tool
- Stop mobile hotspot - Stop mobile hotspot
- Power off the device and remove DIY jumper as it is no longer needed and might interfere with future Tasmota features that use GPIO16 - Power off the device and remove DIY jumper as it is no longer needed and might interfere with future Tasmota features that use GPIO16
# Manual Flash / MacOSx ## Manual Flash
This procedure is recommended for MacOS.
After trying to get the python script to work, it seemed easier to do this manually using curl and the dns-sd process in MacOS ### Requirements
## Requirements
- Sonoff DIY (firmware 3.1+) - Sonoff DIY (firmware 3.1+)
- OS with curl and mDNS discovery tool - OS with `curl` and `mDNS` discovery tool
- `sonoffDiy` SSID on your router - `sonoffDiy` SSID on your local network
- Copy of firmware (e.g. [`sonoff-basic.bin`]) on a local webserver. It must be _smaller than 500k_. _**Do NOT use the sonoff-minimal pre-compiled binary**_ as it does not allow you to change any settings. - Copy of firmware (e.g. [`sonoff-basic.bin`]). It must be _smaller than 500k_. _**Do NOT use the sonoff-minimal pre-compiled binary**_ as it does not allow you to change any settings.
- SHA256 sum of above firmware - SHA256 sum of firmware binary file
>$ shasum -a 256 sonoff-basic.bin
**_1da0e89be4c01df033fa6da9d0c1db58c3deea354d7ad194f607d1f518db48f9_**
- Local web server
Upload the firmware file to a web server available on the same local network
### Verify and/or update eWelink firmware version ### Verify and/or update eWelink firmware version
- Open the device and remove the jumper labeled OTA if present - Open the device and remove the jumper labeled OTA if present
- Power on device and connect to eWelink - Power on device and connect to eWelink
- Update eWelink firmware to at least 3.1 (mine came with 3.0) - Update eWelink firmware to at least 3.1
### Discover the unit ID: ### Discover the device ID
- Power off the Sonoff DIY device and install the DIY OTA jumper - Power off the Sonoff DIY device and install the DIY OTA jumper
- Create a new SSID on your router: - Create a new SSID on your router:
- SSID: `sonoffDiy` (_**case sensitive!**_) - SSID: `sonoffDiy` (_**case sensitive!**_)
- Password: `20170618sn` - Password: `20170618sn`
- Wait for the Sonoff to connect - Wait for the Sonoff device to connect
- Using `dns-sd` search for the mDNS details: - Obtain the device IP address (search on the router or perform an IP scan)
- Using the `dns-sd` command, search for the mDNS details. In this example, the device ID is **_1000988699_**
~~~~ ~~~~
$ dns-sd -B _ewelink._tcp $ dns-sd -B _ewelink._tcp
Browsing for _ewelink._tcp Browsing for _ewelink._tcp
DATE: ---Mon 12 Aug 2019--- DATE: ---Mon 12 Aug 2019---
20:19:31.956 ...STARTING... 20:19:31.956 ...STARTING...
Timestamp A/R Flags if Domain Service Type Instance Name Timestamp A/R Flags if Domain Service Type Instance Name
20:19:31.957 Add 2 5 local. _ewelink._tcp. eWeLink_1000988699 20:19:31.957 Add 2 5 local. _ewelink._tcp. eWeLink_1000988699
~~~~ ~~~~
We've found here our ID is **1000988699** ### Flash the firmware and confirm
- Test with /zeroconf/info POST:
### Upload firmware >$ curl http://_\<deviceIP>_:8081/zeroconf/info -XPOST --data '{"deviceid":"1000988699","data":{} }'
- Upload firmware to a webserver available on the SSID create above {"seq":2,"error":0,"data":"{\"switch\":\"off\",\"startup\":\"off\",\"pulse\":\"off\",\"pulseWidth\":500,\"ssid\":\"sonoffDiy\",\"otaUnlock\":false}"}
- Verify sha256 sum of the firmware file:
~~~~
$ shasum -a 256 sonoff-basic.bin
1da0e89be4c01df033fa6da9d0c1db58c3deea354d7ad194f607d1f518db48f9
~~~~
Our SHA256 sum is **1da0e89be4c01df033fa6da9d0c1db58c3deea354d7ad194f607d1f518db48f9**
### Flash and confirm
- Test with /zeroconf/info POST:
~~~~
$ curl http://192.168.1.164:8081/zeroconf/info -XPOST --data '{"deviceid":"1000988699","data":{} }'
{"seq":2,"error":0,"data":"{\"switch\":\"off\",\"startup\":\"off\",\"pulse\":\"off\",\"pulseWidth\":500,\"ssid\":\"sonoffDiy\",\"otaUnlock\":false}"}
~~~~
- Unlock OTA updates at /zeroconf/ota_unlock - Unlock OTA updates at /zeroconf/ota_unlock
~~~~ >$ curl http://_\<deviceIP>_:8081/zeroconf/ota_unlock -XPOST --data '{"deviceid":"1000988699","data":{} }'
$ curl http://192.168.1.164:8081/zeroconf/ota_unlock -XPOST --data '{"deviceid":"1000988699","data":{} }' {"seq":2,"error":0}
{"seq":2,"error":0}
~~~~
- Flash firmware at /zeroconf/ota_flash - Flash firmware at /zeroconf/ota_flash
~~~~ >$ curl http://_\<deviceIP>_:8081/zeroconf/ota_flash -XPOST --data '{"deviceid":"1000988699","data":{"downloadUrl": "http://_\<webServer>_/sonoff-basic.bin", "sha256sum": "1da0e89be4c01df033fa6da9d0c1db58c3deea354d7ad194f607d1f518db48f9"} }'
$ curl http://192.168.1.164:8081/zeroconf/ota_flash -XPOST --data '{"deviceid":"1000988699","data":{"downloadUrl": "http://192.168.1.80/sonoff-basic.bin", "sha256sum": "1da0e89be4c01df033fa6da9d0c1db58c3deea354d7ad194f607d1f518db48f9"} }' {"seq":2,"error":0}
{"seq":2,"error":0} - Ping the device for about 30 seconds until it has rebooted
~~~~
### Post Steps ## Post Installation
Once the firmware upload completes and the device restarts, the usual "sonoff-xxxx" SSID should now be available. It is recommend that you load the firmware variant needed for your device and use case (e.g., `sonoff.bin`). Once the desired firmware is on the device, continue the regular Tasmota setup process.
I carried on pinging 192.168.1.164 for about 30 seconds until the Sonoff rebooted. The normal "sonoff-XXXX" SSID was now available and ready for configuration.
Carry on setup as usual
### Video tutorials ### Video tutorials
- [Andreas Spiess](https://youtu.be/fzEDFmB0UYU?t=239) - [Andreas Spiess](https://youtu.be/fzEDFmB0UYU?t=239)