Reworked and reorganized

blakadder 2019-05-17 19:11:37 +02:00
parent d66997c5f7
commit b7b5cac995
1 changed files with 78 additions and 190 deletions

@ -1,184 +1,99 @@
## Known issues, please read
* Tasmota firmware has functionality to perform special actions on multiple quick button presses and long press
* This will cause the T1 board to reset if relay board is not connected, because long press on button 1 will be detected
* These special functions probably do not make sense for a wall switch
* To disable, use command [`SetOption13 1`](Commands#setoption13)
* If powered only with 3.3 V from the programming connector, long press will be detected by Tasmota on button 1
* If powered only with 3.3 V from the programming connector, RF functions do not work
<img align=right src=https://cdn.itead.cc/media/catalog/product/cache/1/thumbnail/160x160/9df78eab33525d08d6e5fb8d27136e95/s/o/sonoff_t1_000.jpg>
## Sonoff T1 UK
Sonoff-T1 seems to be an evolution of Sonoff Touch and exists in one, two or three button variations and contains a 433MHz receiver.
* [Itead Product Page](http://sonoff.itead.cc/en/products/residential/sonoff-t1)
* [Itead Shop](https://www.itead.cc/sonoff-t1.html)
* Itead Wiki: (na)
Based on the ESP8285, but using a Silabs EFM8BB1 microcontroller to extend the number of IOs needed to control 3 buttons, with separate relays and LEDs together with the radio. SYN470R is used as 433Mhz Radio. The chip for touch is unlabeled.
The Sonoff T1 UK with 1 to 3 gang is fully supported by Tasmota starting with version 5.6.1.
See below for verified way of flashing.
### Revisions
#### Touch Board VER:1
![](https://user-images.githubusercontent.com/10469147/34905168-6128981a-f84b-11e7-9cf0-e0e4c3b0bd55.jpg)
#### Touch Board VER:1.1
![](https://github.com/arendst/arendst.github.io/blob/master/media/SONOFF-T1-R2-UK-GPIO-PIN-OUTS.png)
Notes:
1. There is not enough room with this reversion to fit a header pins on the programming port and still close the case.
2. GPIO0 is connected to the Helper chip on this version. Therefore, the only way to get Ver1.1 of this board into flash mode is to solder a lead onto the resistor R19 from pin 15 on the ESP chip (i.e., GPIO0) and connect this lead to GND on power up; the device will set all the touch pads to dim and the WiFi LED D3 will NOT be on at all.
3. Log on the J3 header is GPIO2
## Sonoff T1 EU
* [Itead Product Page](http://sonoff.itead.cc/en/products/residential/sonoff-t1-eu)
* [Itead Shop](https://www.itead.cc/smart-home/sonoff-t1-eu.html)
* Itead Wiki: (na)
The Sonoff T1 EU with 1 to 3 gang is fully supported by Tasmota starting with version 5.6.1.
### Revisions
#### Touch Board VER:1.0
![](https://camo.githubusercontent.com/0aad604a8b3ea4c035e72d1ea31049abfbd073d4/68747470733a2f2f692e696d6775722e636f6d2f6c4539735343672e6a7067)
## Sonoff T1 US
* [Itead Product Page](http://sonoff.itead.cc/en/products/residential/sonoff-t1-us)
* [Itead Shop](https://www.itead.cc/smart-home/sonoff-t1-us.html)
* Itead Wiki: (na)
The Sonoff T1 US with 1 to 3 gang was launched March 2018. At least for the 3 gang version, _it appears that [SonOTA](SonOTA---Espressif2Arduino---Tasmota-without-compiling) may work again [with Sonoff firmware v2.0.1 or greater](https://github.com/mirko/SonOTA/wiki#known-working-configurations). This needs to be verified for your specific device._
### Revisions
#### REV 1.0
![](https://i.imgur.com/iA5N6GP.jpg)
![](https://i.imgur.com/mhkjJVl.jpg)
## State of implementation
![Sonoff T1 Image](https://cdn.itead.cc/media/catalog/product/cache/1/thumbnail/160x160/9df78eab33525d08d6e5fb8d27136e95/s/o/sonoff_t1_000.jpg)
Sonoff-T1 seems to be an evolution of Sonoff-Touch, and exists in one, two or three button variations and contains a 433MHz radio.
Sonoff Touch is also based on the ESP8285, But are using a Silabs EFM8BB1 microcontroller to extend the number of IOs needed to control 3 buttons, with separate relays and leds together with the radio. SYN470R is used as 433Mhz Radio, and chip for touch is unlabeled
### Data Sheets
* [EFM8BB1 Data Sheet](https://www.silabs.com/documents/public/data-sheets/efm8bb1-datasheet.pdf)
* [ESP8285 Data Sheet](http://www.espressif.com/sites/default/files/documentation/0a-esp8285_datasheet_en.pdf)
* [SYN470R Data Sheet](https://www.birdandgua.net/bird/wp-content/uploads/2016/09/SYN470R-Synoxo.pdf)
## Read before flashing
Tasmota has functionality to perform special actions on multiple button presses and long press for 40 seconds resets firmware to default. This will cause the T1 board to reset if relay board is not connected, because long press on Button1 will be detected.
**To avoid this, use command [`SetOption13 1`](https://github.com/arendst/Sonoff-Tasmota/wiki/Commands#setoption13) immediately after flashing Tasmota.**
## Serial Connection
When powered solely with 3.3v from the serial-to-USB adapter long press will be detected by Tasmota on Button1.
![Connections](https://user-images.githubusercontent.com/29403034/33187392-5a4902e4-d089-11e7-9522-ab7e70301c58.jpg)
When powered solely with 3.3v from the serial-to-USB adapter RF functions do not work.
There are 3 connectors available on the top board J1 to J3.
J1 is tied to EFM8BB1:
1. VDD
2. DATA
3. CLOCK
4. GND
If you can't flash succesfully lower the baud rate, most likely to **74880**.
J2 goes to the relay board (Pins counted cw):
1. Relay 3
2. Relay 1
3. GND
4. +5V
5. +5V
6. GND
7. Relay 2
8. Buzzer, controlled by EFM8BB1
# Serial Flashing
## Sonoff T1 UK
The front circuit board should be disconnected from the rear relay board to prevent power draw upsetting the flashing process. The unit must be powered up before attempting to enter programming mode. If touch Button1 is held while power is connected, the device will not go enter flash mode. The touch IC does not have time to recognise the key-press before the device boots.
J3 is a serial pinout, with the same pins as sonoff basic:
1. VDD
2. RX
3. TX
4. GND
5. GPIO02
With standard firmware, I get a short print out with an non-standard baudrate: 74,880bps (esp8285 bootloader bitrate)
```
ets Jan 8 2013,rst cause:1, boot mode:(3,7)
load 0x40100000, len 2408, room 16
tail 8
chksum 0xe5
load 0x3ffe8000, len 776, room 0
tail 8
chksum 0x84
load 0x3ffe8310, len 632, room 0
tail 8
chksum 0xd8
csum 0xd8
2nd boot version : 1.6
SPI Speed : 40MHz
SPI Mode : DOUT
SPI Flash Size & Map: 8Mbit(512KB+512KB)
jump to run user1 @ 1000
rf cal sector: 251
rf[112]▒ector: 251@ 10008Mbit(512KB+512KB) mode:(3,7)
```
The board is normally powered by the relay board with 5V. When 3.3 volts get applied to the board over J1 or J3 the AMS1117 "leaks" ~2.7V reverse to the LEDs of the touch buttons. This causes them to dimm.
## Flashing
### Preparation
The front circuit board should be disconnected from the rear relay board to prevent power draw upsetting the flashing process. The unit must be powered up before attempting to enter programming mode. If touch button 1 is held while power is connected, the ESP will not go into programming mode. The touch IC does not have time to recognise the key-press before the ESP boots.
### Flashing the board
There are different ways to enter flashing mode, depending on the device.
#### UK Version
The following board layouts are from the 3 variants of the Sonoff T1 UK variant and are marked Sonoff T1 R2 UK Touch Board, Ver 1.0. _It appears that [SonOTA](SonOTA---Espressif2Arduino---Tasmota-without-compiling) may work again [with Sonoff firmware v2.0.1 or greater](https://github.com/mirko/SonOTA/wiki#known-working-configurations). This needs to be verified for this specific device._
### Touch Board VER:1
The following board layouts are from the 3 variants of the Sonoff T1 UK variant and are marked Sonoff T1 R2 UK Touch Board, Ver 1.0.
![img_20180113_094236](https://user-images.githubusercontent.com/10469147/34905168-6128981a-f84b-11e7-9cf0-e0e4c3b0bd55.jpg)
1. Entering Flashing mode varies between the 1 2 and 3 channel versions. See the above picture for button nomenclature used. (The variations between the 3 versions appear to be managed by the touch IC rather than in the ESP).
To enter flashing mode the unit should be powered and connected to the programmer of choice. Touch Button 1 should then be held while the reset button (4) is pressed. The devices reboots, Button 1 can then be released.
1. Entering Flashing mode varies between the 1, 2 and 3 channel versions. See the above picture for button nomenclature used. (The variations between the 3 versions appear to be managed by the touch IC rather than in the ESP).
To enter flashing mode the unit should be powered and connected to the programmer of choice. Touch Button 1 should then be held while the reset button (4) is pressed. When the device reboots, Button 1 can be released.
OR
2. Double-press the reset-button
Try option 1 OR option 2. This will cause the unit to reboot into flash mode. This is confirmed on a serial console (74880 baud) by the boot mode displaying (1,x) indicating that we are booted to the bootloader and not the flash. You can also confirm booted to flash without a serial console, the main led should be off and the backlight LEDs lit dimly.
There is no longer a need to solder anything to GPIO0 or to ground it while powering up for Ver1.0; this step is replaced by the above button sequence. However, GPIO0 to Gnd is the only way for Ver1.1 boards, see above.
Try option 1 **OR** option 2. This will cause the unit to reboot into flash mode. This is confirmed on a serial console (74880 baud) by the boot mode displaying (1,x) indicating that we are booted to the bootloader and not the flash. You can also confirm booted to flash without a serial console, the main led should be off and the backlight LEDs lit dimly.
There is no longer a need to solder anything to GPIO0 or to ground it while powering up for Ver1.0; this step is replaced by the above button sequence. However, GPIO0 to GND is the only way for Ver1.1 boards.
### Touch Board VER:1.1
![](https://github.com/arendst/arendst.github.io/blob/master/media/SONOFF-T1-R2-UK-GPIO-PIN-OUTS.png?raw=true)
Notes:
1. There is not enough room with this reversion to fit a header pins on the programming port and still close the case.
2. GPIO0 is connected to the Helper chip on this version. Therefore, the only way to get Ver1.1 of the board into flash mode is to solder a lead onto the resistor R19 from pin 15 on the ESP chip (i.e., GPIO0) and connect this lead to GND on power up; the device will set all the touch pads to dim and the WiFi LED D3 will NOT be on at all.
3. Log on the J3 header is GPIO2
The board contains a ESP8285 - which is an ESP8266 with built-in 1M bytes of SPI Flash. Tasmota can be flashed and configured as usual. Both firmware based on ESP8285 or ESP8266 seems to function. The module type will need to be configured to a T1 1/2/3CH.
**WARNING!!** Do not attempt to power the device from your serial-to-USB adapter when connected to the relay board. This draws too much power and will cause the ESP to reboot frequently and will reset all the configured settings.
DO NOT attempt to power the device from your programmer when connected to the relay board. This draws too much power and will cause the ESP to reboot frequently and will reset all the configured settings.
#### EU Version
For most devices, the UK version flashing guide may be working. However, for at least the 2 Channel board version 1.0, you need to solder (or otherwise permanently connect) GPIO0 (R19) permanently to GND before powering the board and only disconnect them once the flashing is complete.
## Sonoff T1 EU
For most devices, the [UK version flashing guide](https://blakadder.github.io/templates/sonoff_T1_1_uk.html) may work. However, for **2 Channel board version 1.0**, you need to solder (or otherwise permanently connect) GPIO0 (R19) to GND before powering the board and only disconnect them once the flashing is complete.
![Sonoff T1 R2 EU board V1.0](https://i.imgur.com/bI9f5sa.jpg)
After having connected GPIO0 and GND, power the board - it will boot directly to flashing mode. Flash your firmware and disconnect the board.
#### US Version
### Sonoff T1 EU 1 Button (2018-06-04)
![Sonoff T1 EU 1 gang June version Image](https://i.imgur.com/lE9sSCg.jpg)
All the flashing pins are in the front top right corner (sorry about covering them with the wires). From top to bottom:
- LOG (GPIO2 not used)
- GND
- TXD
- RXD
- VCC
_It appears that [SonOTA](SonOTA---Espressif2Arduino---Tasmota-without-compiling) may work again [with Sonoff firmware v2.0.1 or greater](https://github.com/mirko/SonOTA/wiki#known-working-configurations). This needs to be verified for this specific device._ To get it working you can simply plug it to mains, once it's powered up, press and hold the button that's closer to the Wi-Fi logo (you'll hear a beep sound). Keep holding it until you hear that beep for the second time. Now let go. The Wi-Fi light should blink in pairs of 3. Now repeat the procedure (Press and hold until you hear the beep 2 times). Now you should be seeing the Wi-Fi logo flashing rapidly. You can proceed to flash with [SonOTA](SonOTA---Espressif2Arduino---Tasmota-without-compiling) now.
To flash simply connect GND, TXD, RXD, and VCC as any regular ESP. Hold the touch button, press reset at once, then it boots into flash mode (no blinking WiFi LED, dimmed touch button). If this does not work, try shorting R19 to GND as shown in "Touch Board VER:1.1"
* Stock baud rate: 74880
* Relay pin: 0
## Sonoff T1 US
_It appears that [SonOTA](https://github.com/mirko/SonOTA) may work again [with Sonoff firmware v2.0.1 or greater](https://github.com/mirko/SonOTA/wiki#known-working-configurations). This needs to be verified for this specific device._ To get it working you can simply plug it to mains, once it's powered up, press and hold the button that's closer to the Wi-Fi logo (you'll hear a beep sound). Keep holding it until you hear that beep for the second time. Now let go. The Wi-Fi light should blink in pairs of 3. Now repeat the procedure (Press and hold until you hear the beep 2 times). Now you should be seeing the Wi-Fi logo flashing rapidly. You can proceed to try and flash with [SonOTA](https://github.com/mirko/SonOTA) now.
## Flashing the easy way
### Video tutorial by Marcus Bennett
[![T1 UK 1-gang](https://img.youtube.com/vi/AqTIoxF49K0/0.jpg)](https://www.youtube.com/watch?v=AqTIoxF49K0)
[![T1 UK 2-gang](https://img.youtube.com/vi/Jldt7ZTkPb0/0.jpg)](https://www.youtube.com/watch?v=Jldt7ZTkPb0)
## US Model of 3-button T1, received direct from Sonoff China 2018-05-12
[Front photo (Google photos)](https://photos.app.goo.gl/1aPKEnBMvacy3uMK9)
[Rear photo (Google photos)](https://photos.app.goo.gl/7Rs9ftshCUdVH1qP2)
(Sorry about the tape smudges).
## Flashing issues
The header labels on J3 are accurate (apparently some boards have TX and RX reversed; this doesn't seem to suffer that).
Flashed with [SonOTA](https://github.com/mirko/SonOTA). Above method of getting into flash mode doesn't seem to work.
UPDATE: I did flash it with the FTDI method. To put then in flash mode press 2 times quickly the internal switch S1.
UPDATE 2: Confirmed by another user that flashed with [SonOTA](https://github.com/mirko/SonOTA) works as described on "Preparing"
### Sonoff T1 US 3 Gang
The jump-wire method to enter the flash mode:
* Jump the wire as attached picture
* While keeping the wire connected then plug the serial-to-USB adapter to the computer
* Eait for 1 to 2 seconds then release the jump-wire
* You can start flashing the Sonoff T1 US 3C.
![](https://user-images.githubusercontent.com/36041520/50041600-25bad980-008a-11e9-840b-86e431c12968.jpg)
##
It seems that Sonoff is trying to seal off the ESP using some glue see image:
![Glue on the chip](https://i.postimg.cc/Y2YrTG5S/IMG-20180910-233750.jpg)
Using a CP2102 USB to TTL connect RX->TX | TX->RX | 3.3v->3.3 | GND->GND
To get this in flashing mode just connect the TTL to your computer and push the button Twice (2 Times). I have successfully flashed 6 of these using this method no hassle. If it fails, just press twice again and flash.
Verified: The above method of enabling flashing mode works first time, every time.
## Quick config
After flashing and communication setup you might want to execute command [`SetOption13 1`](Commands#setoptin13) to configure the touch switches to only allow a single tap for quick response.
## 433MHz remote
The Tasmota firmware is compatible with the RF remote feature built in to the T1 modules.
@ -186,9 +101,7 @@ Pairing a new remote is the same procedure as a stock Sonoff, i.e., hold the des
given 1 beep (approx 7 seconds), press the button on your RF remote. The Sonoff will beep to confirm the pairing.
To unpair a remote, press until you are given 2 beeps, press the button on your RF remote. The Sonoff will beep to confirm the unpairing.
## Circuit
I tried to reverse engineer the circuit and I noticed:
### Circuit
ESP8285
```
@ -233,49 +146,24 @@ P1,6 ESP8285 EXT_RSTB (RESET)
* Where GPIO15 is connected? Over R18 10kOhm pull-down only?
New model, [PCB (Google Photos)](https://photos.google.com/share/AF1QipM1zLb_7_2SkFFfRWgVAL75VhNBYn3hvkkeMLeLkXOfQvsnIUuK9D5nzLNwrKg-Gw/photo/AF1QipMuZaw48dtqAuP1Ibk1dVZfBIwMPFnkN3kjNseb?key=UWsyS3VrZHBpaldyUnl3Zmh0c2hqNDRmM2wyaDRB)
# Official Sources
### Sonoff T1 UK
Looks like the programming headers are top right
* [Itead Product Page](http://sonoff.itead.cc/en/products/residential/sonoff-t1)
* [Itead Shop](https://www.itead.cc/sonoff-t1.html)
## US Model of 3-button T1, received direct from Sonoff China 2018-05-12
[Front photo (Google photos)](https://photos.app.goo.gl/1aPKEnBMvacy3uMK9)
[Rear photo (Google photos)](https://photos.app.goo.gl/7Rs9ftshCUdVH1qP2)
(Sorry about the tape smudges).
The Sonoff T1 UK with 1 to 3 gang is fully supported by Tasmota starting with version 5.6.1.
The header labels on J3 are accurate (apparently some boards have TX and RX reversed; this doesn't seem to suffer that).
## Sonoff T1 EU
Flashed with [SonOTA](SonOTA---Espressif2Arduino---Tasmota-without-compiling). Above method of getting into flash mode doesn't seem to work.
* [Itead Product Page](http://sonoff.itead.cc/en/products/residential/sonoff-t1-eu)
* [Itead Shop](https://www.itead.cc/smart-home/sonoff-t1-eu.html)
UPDATE: I did flash it with the FTDI method. To put then in flash mode press 2 times quickly the internal switch S1.
The Sonoff T1 EU with 1 to 3 gang is fully supported by Tasmota starting with version 5.6.1.
UPDATE 2: Confirmed by another user that flashed with [SonOTA](SonOTA---Espressif2Arduino---Tasmota-without-compiling) works as described on "Preparing"
## Sonoff T1 US
## EU Model of 1-button T1, received direct from Sonoff China 2018-06-04
![Sonoff T1 EU 1 gang June version Image](https://i.imgur.com/lE9sSCg.jpg)
All the flashing pins are in the front top right corner (sorry about covering them with the wires). From top to bottom:
- LOG (GPIO2 not used)
- GND
- TXD
- RXD
- VCC
* To flash simply connect GND, TXD, RXD, and VCC, as a regular ESP. Hold the touch button, press reset at once, then it boots into flash mode (no blinking WiFi LED, dimmed touch button). If this does not work, try shorting R19 to GND as shown in "Touch Board VER:1.1"
* Stock baud rate: 74880
* Relay pin: 0
## EU Model of 3-button T1, received direct from Sonoff China 2018-11-10.
* New PCB layout without (reset) button 4.
* Can be flashed via [SonOTA](SonOTA---Espressif2Arduino---Tasmota-without-compiling) without problems (Press button #1 for several seconds until the wifi appears).
* For hardwired flashing: GND, TXD, RXD, and 3.3V connectors are located on the back side of the new PCB, clearly labeled but not longer adjacent to each other.
**Update:**
* SonOTA, Hardwired flashing fails with New PCB layout, problem was that I found `ESP8285 PIN15_GIPO0` was shorted with `ESP8285 PIN14_GIPO2`. Bad soldering from manufacture side,after clearing solder from pin's, flashing was successful.
![image](https://user-images.githubusercontent.com/47775538/53097067-3de72300-3529-11e9-9e13-f699a4a564dc.png)
## US Model: Sonoff T1-US 3C (3-button or 3Gang), the jump-wire method to enter the flash mode:
* jump the wire as attached picture
* While keeping the wire connected then plug the FTDI USB to the computer
* wait for 1 to 2 seconds then release the jump-wire
* You can start flashing the Sonoff T1-US 3C.
![](https://user-images.githubusercontent.com/36041520/50041600-25bad980-008a-11e9-840b-86e431c12968.jpg)
* [Itead Product Page](http://sonoff.itead.cc/en/products/residential/sonoff-t1-us)
* [Itead Shop](https://www.itead.cc/smart-home/sonoff-t1-us.html)
The Sonoff T1 US with 1 to 3 gang was launched March 2018.