mirror of https://github.com/arendst/Tasmota.git
Updated Sonoff DIY (markdown)
parent
1a5d7850db
commit
c11fff073a
|
@ -45,17 +45,17 @@ As Sonoff DIY is enabled by connecting GPIO16 to GND it may well be possible tha
|
||||||
This procedure is recommended for MacOS, but also works for Linux.
|
This procedure is recommended for MacOS, but also works for Linux.
|
||||||
### Requirements
|
### Requirements
|
||||||
- eWelink firmware updated to at least 3.1
|
- eWelink firmware updated to at least 3.1
|
||||||
- OS with `curl` and `mDNS` (MacOS)/`avahi-browse` (Linux) discovery tool
|
- OS with `curl` and a network services discovery tool (e.g., `mDNS` for MacOS or `avahi-browse` for Linux)
|
||||||
- `sonoffDiy` SSID on your local network. Use a router/access point or configure your laptop/smartphone as hotspot with the proper SSID and password.
|
- `sonoffDiy` SSID on your local network. Use a router/access point or configure your laptop/smartphone as a hotspot with the proper SSID and password.
|
||||||
|
- A `<webServer>` available on the same local network. Very simple web servers like `SimpleHTTPServer` will not work.
|
||||||
- A Tasmota binary (e.g., [`sonoff-basic.bin`](http://thehackbox.org/tasmota/020300/sonoff-basic.bin)) or your own self-compiled binary. It must fit in the available free program space. You can use the 2.3.0 Core for this initial flash since it has the smallest program memory footprint. _**Do NOT use the sonoff-minimal pre-compiled binary**_ as it does not allow you to change any settings.
|
- A Tasmota binary (e.g., [`sonoff-basic.bin`](http://thehackbox.org/tasmota/020300/sonoff-basic.bin)) or your own self-compiled binary. It must fit in the available free program space. You can use the 2.3.0 Core for this initial flash since it has the smallest program memory footprint. _**Do NOT use the sonoff-minimal pre-compiled binary**_ as it does not allow you to change any settings.
|
||||||
>You may wish to [compile your own firmware](https://github.com/arendst/Sonoff-Tasmota/wiki/Compiling-Tasmota-on-Gitpod) with all the features you require and disabling the features you do not. This will usually result in a "full" binary that is under 500k. You can use the resulting firmware file instead of the pre-compiled `sonoff-basic.bin`. This way you will not have to perform the secondary OTA firmware update. _**Nevertheless, it is still recommended that you perform a `Reset 5` immediately after the Sonoff DIY flash completes.**_
|
>You may wish to [compile your own firmware](https://github.com/arendst/Sonoff-Tasmota/wiki/Compiling-Tasmota-on-Gitpod) with all the features you require and disabling the features you do not. This will usually result in a "full" binary that is under 500k. You can use the resulting firmware file instead of the pre-compiled `sonoff-basic.bin`. This way you will not have to perform the secondary OTA firmware update. _**Nevertheless, it is still recommended that you perform a `Reset 5` immediately after the Sonoff DIY flash completes.**_
|
||||||
- SHA256 sum of firmware binary file
|
|
||||||
>$ shasum -a 256 sonoff-basic.bin
|
Upload the firmware file to the `<webServer>` available on the same local network.
|
||||||
**_1da0e89be4c01df033fa6da9d0c1db58c3deea354d7ad194f607d1f518db48f9_**
|
- SHA256 `<SHAsum>` of firmware binary file
|
||||||
- Local web server
|
> `$ shasum -a 256 sonoff-basic.bin`
|
||||||
Upload the firmware file to a web server available on the same local network
|
|
||||||
|
**_`1da0e89be4c01df033fa6da9d0c1db58c3deea354d7ad194f607d1f518db48f9`_**
|
||||||
Very simple webservers (like python SimpleHTTPServer) will not work.
|
|
||||||
|
|
||||||
### 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
|
||||||
|
@ -68,56 +68,56 @@ This procedure is recommended for MacOS, but also works for Linux.
|
||||||
- SSID: `sonoffDiy` (_**case sensitive!**_)
|
- SSID: `sonoffDiy` (_**case sensitive!**_)
|
||||||
- Password: `20170618sn`
|
- Password: `20170618sn`
|
||||||
- Wait for the Sonoff device to connect
|
- Wait for the Sonoff device to connect
|
||||||
- Obtain the device IP address (search on the router or perform an IP scan)
|
- Obtain the `<deviceIP>` address (search on the router or perform an IP scan)
|
||||||
- Using the `dns-sd` (MacOS) or `avahi-browse` (Linux) command, search for the Zeroconf details. In this example, the device ID is **_1000988699_**
|
- Discover the Zeroconf details.
|
||||||
~~~~
|
In this example, the `<deviceID>` is **_1000988699_**
|
||||||
$ dns-sd -B _ewelink._tcp
|
|
||||||
|
_MacOS_
|
||||||
|
> `$ 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
|
||||||
~~~~
|
```
|
||||||
|
|
||||||
~~~~
|
_Linux_
|
||||||
$ avahi-browse -t _ewelink._tcp --resolve
|
> `$ avahi-browse -t _ewelink._tcp --resolve`
|
||||||
|
```
|
||||||
+ wlp3s0 IPv4 eWeLink_1000988699 _ewelink._tcp local
|
+ wlp3s0 IPv4 eWeLink_1000988699 _ewelink._tcp local
|
||||||
= wlp3s0 IPv4 eWeLink_1000988699 _ewelink._tcp local hostname = [eWeLink_1000988699.local] address = [192.168.1.109] port = [8081] txt = ["data1={"switch":"off","startup":"off","pulse":"off","pulseWidth":500,"rssi":-47}" "seq=1" "apivers=1" "type=diy_plug" "id=1000988699" "txtvers=1"]
|
= wlp3s0 IPv4 eWeLink_1000988699 _ewelink._tcp local hostname = [eWeLink_1000988699.local] address = [192.168.1.109] port = [8081] txt = ["data1={"switch":"off","startup":"off","pulse":"off","pulseWidth":500,"rssi":-47}" "seq=1" "apivers=1" "type=diy_plug" "id=1000988699" "txtvers=1"]
|
||||||
~~~~
|
```
|
||||||
|
|
||||||
|
|
||||||
### Flash the firmware and confirm
|
### Flash the firmware and confirm
|
||||||
- Test with /zeroconf/info POST:
|
- Test with `/zeroconf/info` POST
|
||||||
>$ curl http://_\<deviceIP>_:8081/zeroconf/info -XPOST --data '{"deviceid":"1000988699","data":{} }'
|
> `$ curl http://<deviceIP>:8081/zeroconf/info -XPOST --data '{"deviceid":"<deviceID>","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
|
|
||||||
>$ curl http://_\<deviceIP>_:8081/zeroconf/ota_unlock -XPOST --data '{"deviceid":"1000988699","data":{} }'
|
|
||||||
>
|
|
||||||
>_**{"seq":2,"error":0}**_
|
|
||||||
- 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"} }'
|
|
||||||
>
|
|
||||||
>_**{"seq":2,"error":0}**_
|
|
||||||
|
|
||||||
|
**_`{"seq":2,"error":0,"data":"{"switch":"off","startup":"off","pulse":"off","pulseWidth":500,"ssid":"sonoffDiy","otaUnlock":false}"}`_**
|
||||||
|
- Unlock OTA updates at `/zeroconf/ota_unlock`
|
||||||
|
> `$ curl http://<deviceIP>:8081/zeroconf/ota_unlock -XPOST --data '{"deviceid":"<deviceID>","data":{} }'`
|
||||||
|
|
||||||
|
**_`{"seq":2,"error":0}`_**
|
||||||
|
- Flash firmware at `/zeroconf/ota_flash`
|
||||||
|
> `$ curl http://<deviceIP>:8081/zeroconf/ota_flash -XPOST --data '{"deviceid":"<deviceID>","data":{"downloadUrl": "http://<webServer>/sonoff-basic.bin", "sha256sum": "<SHAsum>"} }'`
|
||||||
|
|
||||||
|
**_`{"seq":2,"error":0}`_**
|
||||||
- Ping the device for about 30 seconds until it has rebooted
|
- Ping the device for about 30 seconds until it has rebooted
|
||||||
|
|
||||||
## Post Installation
|
## Post Installation
|
||||||
Once the firmware upload completes and the device restarts, the usual "sonoff-xxxx" SSID should now be available.
|
Once the firmware upload completes and the device restarts, the usual `sonoff-xxxx` SSID should now be available.
|
||||||
1. Set up Wi-Fi to connect your device to your network
|
1. Set up Wi-Fi to connect your device to your network
|
||||||
2. **_Perform a `Reset 5` to wipe any flash remnants BEFORE attempting a Tasmota OTA flash for the first time_**
|
2. **_Perform a `Reset 5` to wipe any flash remnants BEFORE attempting a Tasmota OTA flash for the first time_**
|
||||||
>**_Some users have reported that upgrading via OTA from sonoff-basic.bin to another binary has resulted in an unresponsive device which has required a wired flash to recover. A suggested, but untested, workaround is to perform a `Reset 5` to wipe any flash remnants BEFORE attempting a Tasmota OTA flash for the first time._**
|
>**_Some users have reported that upgrading via OTA from sonoff-basic.bin to another binary has resulted in an unresponsive device which has required a wired flash to recover. A suggested, but untested, workaround is to perform a `Reset 5` to wipe any flash remnants BEFORE attempting a Tasmota OTA flash for the first time._**
|
||||||
|
3. It is recommend that you upgrade to the firmware and Core variant that is needed for your device and use case (e.g., `sonoff.bin`).
|
||||||
|
4. Once the desired firmware is on the device, continue the regular Tasmota setup process. Use the [Sonoff Mini template](https://blakadder.github.io/templates/sonoff_mini.html) to assign the device components to the GPIO pins.
|
||||||
|
|
||||||
It is recommend that you upgrade to the firmware and Core variant that is needed for your device and use case (e.g., `sonoff.bin`).
|
<BR>GPIO | Tasmota<BR>Component | Device<BR>Function
|
||||||
|
--: | :--: | :--:
|
||||||
Once the desired firmware is on the device, continue the regular Tasmota setup process. Use the [Sonoff Mini template](https://blakadder.github.io/templates/sonoff_mini.html) to assign the device components to the GPIO pins.
|
0 | Button1 (17) | Button
|
||||||
|
4 | Switch1 (9) | S1/S2
|
||||||
<BR>GPIO | Tasmota<BR>Component | Device<BR>Function
|
12 | Relay1 (21) | L Out
|
||||||
--: | :--: | :--:
|
13 | LED1 (56) | Link/Power Indicator
|
||||||
0 | Button1 (17) | Button
|
|
||||||
4 | Switch1 (9) | S1/S2
|
|
||||||
12 | Relay1 (21) | L Out
|
|
||||||
13 | LED1 (56) | Link/Power Indicator
|
|
||||||
|
|
||||||
### Video tutorials
|
### Video tutorials
|
||||||
- [Andreas Spiess](https://youtu.be/fzEDFmB0UYU?t=239)
|
- [Andreas Spiess](https://youtu.be/fzEDFmB0UYU?t=239)
|
||||||
|
|
Loading…
Reference in New Issue