...
The Sonoff Dual R2 offers control of 2 relays on one board.
GPIO | Function |
---|---|
0 | Button 0 on header |
1 | Serial Rx and Optional Sensor |
3 | Serial Tx and Optional Sensor |
5 | Relay 2 (RED LED) |
9 | Button 1 on header |
10 | Button on Case |
12 | Relay 1 (GREEN LED) |
13 | Blue Led (Inverted) |
Hardware Preperation
This device uses the ESP8285 module which is different than the other SONOFF products.
As always, you need to access the serial interface. The four serial pins (VCC, Rx, Tx, GND) are available at the short end of the PCB and can be seen on the left of the image above.
Revising the Tasmota config
...
You will want to solder on some header pins onto the VCC, Rx, Tx, GND points.
Flashing the Tasmota Firmware
Configuring the Software
- Startup the Arduino IDE
- Open sonoff.ino
- Update parameters in user_config.h.
Set the SWITCH_MODE to FOLLOW
...
Update the wifi settings: STA_SSID1, STA_PASS1, STA_SSID2, STA_PASS2
Code Block #define STA_SSID1 "mywifissid" // [Ssid1] Wifi SSID #define STA_PASS1 "mywifipwd" // [Password1] Wifi password #define STA_SSID2 "mywifissid2" // [Ssid2] Optional alternate AP Wifi SSID #define STA_PASS2 "mywifisspwd2" // [Password2] Optional alternate AP Wifi password
// [SwitchMode] TOGGLE, FOLLOW, FOLLOW_INV, PUSHBUTTON, PUSHBUTTON_INV, PUSHBUTTONHOLD, PUSHBUTTONHOLD_INV or PUSHBUTTON_TOGGLE (the wall switch state)
...
#define SWITCH_MODE FOLLOW
...
- Set Board Info
Entering Programming Mode
...
Luckily both GND and GPIO0 (as BUTTON 0) are available on the second header. A simple jumper between GND and BUTTON 0 while programming will do the trick.
<PIC>
...
Uploading the
...
Firmware
...
From the Arduino IDE
...
, click Sketch → Upload
- Set Board Info
Setting the Switch Mode
Reference
Reference | URL |
---|---|
Product Info | http://sonoff.itead.cc/en/products/sonoff/sonoff-dual |
Schematic for Dual | https://www.itead.cc/wiki/images/1/1d/Sonoff_Dual_View.pdf |
Sonoff-Tasmota | https://github.com/arendst/Sonoff-Tasmota/wiki/Sonoff-Dual-and-Dual-R2 |
Sonoff-Tasmota Switch Modes | https://github.com/arendst/Sonoff-Tasmota/wiki/Understanding-SwitchMode-and-SwitchTopic |