Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of Sonoff Dual R2 variant #1249

Closed
vanyid opened this issue Nov 25, 2017 · 20 comments
Closed

Support of Sonoff Dual R2 variant #1249

vanyid opened this issue Nov 25, 2017 · 20 comments

Comments

@vanyid
Copy link

vanyid commented Nov 25, 2017

Hello Tasmona community,

I have purchased 3 x Sonoff Dual modules. But those are different from any other mentioned module. (or just I not found anything on the web, maybe my fault) Does anyone have the same board?

The label on the board: Sonoff Dual R2. Ver 1.0 , 2017-7-20 (maybe the manufacturing date)
Inside the case there is only one chip a ESP8285.
The relays and the LEDs are directly connected to the ESP.

I will open a pull request according to the new module as soon as I am able to check in the necessary modifications to my fork repo.

Here is the pinning of the ESP:
This variant is more simpler then the previous one. (and perhaps cheaper for iTead)

PIN Function
GIO0 BUTTON 0 (inside header)
GIO5 L2 RELAY
GIO9 BUTTON 1 (inside header)
GIO10 SWITCH (on the case)
GIO12 L1 RELAY
GIO13 BLUE LED (inverted)

Some pictures about the board:

img_e5188 2

img_e5187

img_e5189

img_e5190

@davidelang
Copy link
Collaborator

davidelang commented Nov 25, 2017 via email

@vanyid
Copy link
Author

vanyid commented Nov 25, 2017

As far as I see no it will not work 100%. Because the Button1 and the case switch are connected to the GPIO9 and 10, but in the "WeMos D1 mini" the GPIO 6 - 11 are not defined as GPIO_USER.

And otherwise in my opinion if this is an official Sonoff device then is should be supported by default.
I do not know when will iTead update the official wiki page and provide the schematic for this variant?

@arendst
Copy link
Owner

arendst commented Nov 27, 2017

The R2 will be included in Tasmota as a seperate device.

For now I use your findings regardiog GPIO and add it to the next (pre)release.

Edit: The GPIO connections are based on the 4CH where button 3 is the one on the casing. I guess I configure button 1 and 2 as switch 1 and 2 and button 3 (GPIO10) as button 1. Let's see if that's useful...

Edit2: Like this:

  { "Sonoff Dual R2",  // Sonoff Dual R2 (ESP8285)
     GPIO_SWT1,        // GPIO00 Button 1 on header
     GPIO_USER,        // GPIO01 Serial RXD and Optional sensor
     0,
     GPIO_USER,        // GPIO03 Serial TXD and Optional sensor
     0,
     GPIO_REL2,        // GPIO05 Relay 2 (0 = Off, 1 = On)
     0, 0, 0,          // Flash connection
     GPIO_SWT2,        // GPIO09 Button 2 on header
     GPIO_KEY1,        // GPIO10 Button 3 on casing
     0,                // Flash connection
     GPIO_REL1,        // GPIO12 Relay 1 (0 = Off, 1 = On)
     GPIO_LED1_INV,    // GPIO13 Blue Led (0 = On, 1 = Off)
     0, 0, 0, 0
  }

arendst added a commit that referenced this issue Nov 27, 2017
5.9.1j
 * Revert changes to xsns_05_ds18x20.ino and rename to
xsns_05_ds18x20_legacy.ino still needing library OneWire and providing
legacy JSON message:
 *
"DS18x20":{"DS1":{"Type":"DS18B20","Address":"284CC48E04000079","Temperature":19.5},"DS2":{"Type":"DS18B20","Address":"283AC28304000052","Temperature":19.6}}

* Add new xdrv_05_ds18x20.ino free from library OneWire and add the
following features:
 *  Add support for DS1822
 *  Add forced setting of
12-bit resolution for selected device types (#1222)
 *  Add read
temperature retry counter (#1215)
 *  Fix lost sensors by performing
sensor probe at restart only thereby removing dynamic sensor probe
(#1215)
 *  Fix sensor address sorting using ascending sort on sensor
type followed by sensor address
 *  Rewrite JSON resulting in shorter
message allowing more sensors in default firmware image:
 *
"DS18B20-1":{"Id":"00000483C23A","Temperature":19.5},"DS18B20-2":{"Id":"0000048EC44C","Temperature":19.6}

* Add additional define in user_config.h to select either single sensor
(defines disabled), new multi sensor (USE_DS18X20) or legacy multi
sensor (USE_DS18X20_LEGACY)
 * Add support for Sonoff Dual R2 (#1249)
 *
Fix ADS1115 detection (#1258)
@ThomDietrich
Copy link

I hate to be that guy to always push the documentation...
I'd suggest to keep the documentation up to date and one article that definitely would benefit from the images and a few details posted above is: https://github.com/arendst/Sonoff-Tasmota/wiki/Sonoff-Dual (see for an example for two versions) @vanyid maybe you could invest a few minutes there?

arendst added a commit that referenced this issue Dec 1, 2017
5.10.0 20171201
 * Upgrade library ArduinoJson to 5.11.2
 * Upgrade
library IRRemoteEsp8266 to 2.2.1 + 2 commits but disabled some protocols
(code size reduction)
 * Upgrade library NeoPixelBus to 2.2.9
 * Upgrade
library OneWire to 2.3.3 + 6 commits and disabled CRC lookup-table
(#define ONEWIRE_CRC8_TABLE 0) (code size reduction)
 * Update library
PubSubClient to 2.6 + 9 commits and additional delay (#790)
 * Update
core_esp8266_wiring_digital.c to latest (staged) level
 * Patch library
I2Cdevlib-Core for esp8266-core 2.4.0-rc2 compatibility
 * Remove
command EnergyReset 1..3 now replaced by ENergyReset1 to EnergyReset3
 *
Remove spaces in JSON messages (code size reduction)
 * Renamed
xsns_05_ds18x20.ino to xsns_05_ds18x20_legacy.ino still using library
OneWire and providing dynamic sensor scan
 * Fix possible iram1_0_seg
compile error by shrinking ICACHE_RAM_ATTR code usage
 * Fix PWM
watchdog timeout if Dimmer is set to 100 or Color set to 0xFF (#1146)
 *
Fix Sonoff Bridge Learn Mode hang caused by unrecognised RF code
(#1181)
 * Fix blank console log window by using XML character encoding
(#1187)
 * Fix wrong response name for command HlwISet (#1214)
 * Fix
DHT type sensor timeout recognition by distinguish "signal already
there" from "timeout" (#1233)
 * Add fixed color options 1..12 to
command Color
 * Add + (plus) and - (minus) to commands Dimmer
(+10/-10), Speed and Scheme
 * Add + (plus) and - (minus) to command
Color to select 1 out of 12 preset colors
 * Add + (plus) and - (minus)
to command Ct to control ColdWarm led ColorTemperature (+34/-34)
 * Add
commands EnergyReset1 0..42500, EnergyReset2 0..42500 and EnergyReset3
0..42500000
 *  to (Re)set Energy Today, Yesterday or Total respectively
in Wh (#406, #685, #1202)
 * Add optional ADS1115 driver as alternative
for unsupported I2Cdevlib in esp8266-core 2.4.0-rc2
 * Add support for
INA219 Voltage and Current sensor to be enabled in user_config.h with
define USE_INA219
 * Add support for Arilux LC11 (Clearing RF home code
when selecting no Arilux module)
 * Add support for WS2812 RGBW
ledstrips to be enabled in user_config.h with define USE_WS2812_CTYPE
(#1156)
 * Add SettingsSaveAll routine to command SaveData to be used
before controlled power down (#1202)
 * Add option PUSHBUTTON_TOGGLE
(SwitchMode 7) to allow toggling on any switch change (#1221)
 * Add new
xdrv_05_ds18x20.ino free from library OneWire and add the following
features:
 *  Add support for DS1822
 *  Add forced setting of 12-bit
resolution for selected device types (#1222)
 *  Add read temperature
retry counter (#1215)
 *  Fix lost sensors by performing sensor probe at
restart only thereby removing dynamic sensor probe (#1215)
 *  Fix
sensor address sorting using ascending sort on sensor type followed by
sensor address
 *  Rewrite JSON resulting in shorter message allowing
more sensors in default firmware image:
 *
"DS18B20-1":{"Id":"00000483C23A","Temperature":19.5},"DS18B20-2":{"Id":"0000048EC44C","Temperature":19.6}

* Add additional define in user_config.h to select either single sensor
(defines disabled), new multi sensor (USE_DS18X20) or legacy multi
sensor (USE_DS18X20_LEGACY)
 * Add clock support for more different
pixel counts (#1226)
 * Add support for Sonoff Dual R2 (#1249)
 * Add
FriendlyName to web page tab and add program information to web page
footer (#1275)
@smadds
Copy link

smadds commented Dec 1, 2017

The best thing I can see in this new version is that they have finally stopped using the fuse clips that were quite incapable of handling 16A. Have a look here for tales of woe when trying to use the fused Sonoffs with high currents: http://support.iteadstudio.com/support/discussions/topics/11000012976?page=1

@arendst arendst closed this as completed Dec 1, 2017
@ThomDietrich
Copy link

@arendst still no documentation. Way to go 💯

vanyid pushed a commit to vanyid/Sonoff-Tasmota that referenced this issue Dec 1, 2017
Add support for Sonoff Dual R2 version
All possible inputs are defined as USER configurable.
Case button multipress support for 2nd relay.
Web configuration "BUTTON1" label fix.
@localhost61
Copy link
Contributor

localhost61 commented Apr 16, 2018

For documentation I've annotated previous ESP8285 picture with pinout issued from the Espressif datasheet. I was looking for available GPIO pins. It appears that GPIO 2, 4, 6, 7, 8, 11, 14 & 16 are free but only available on the ESP8285 chip, which requires some squills to solder. Instead of ADC (pin6) it seems that it's GPIO15 that is used to monitor the power supply.
In fact the easiest way to connect a sensor will be to use RX and TX on the header. The sensor will have to be removable in case of serial reprogramming, but I guess not in case of OTA update..

[Edith]
dualr2_esp8285
I modified previous picture in order to clarified on the picture the RX and TX inversion between ESP8285 datasheet and the Sonoff notation.
dualr2_esp8285

In the meantime, I just managed to connect a DS18B20 on GPIO1 (TX).

2018-04-17 02_12_12-sonoff - configuration module | 2018-04-17 02_18_01-sonoff - menu principal
[/Edith]

@cpfarher
Copy link

@vanyid I have the same board, How do you flash tasmota firmware? I have the arduino uno, it is the same process as esp8266 but instead of select 8266 generic board I need to select generic esp8285 module?... It is compatible for add external switches?
Thank you

@localhost61
Copy link
Contributor

localhost61 commented Aug 24, 2018

@cpfarher I hope you already found your answer in the wiki here. And YES the settings are the same for esp8285 and 8266.

curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 6, 2018
5.9.1j
 * Revert changes to xsns_05_ds18x20.ino and rename to
xsns_05_ds18x20_legacy.ino still needing library OneWire and providing
legacy JSON message:
 *
"DS18x20":{"DS1":{"Type":"DS18B20","Address":"284CC48E04000079","Temperature":19.5},"DS2":{"Type":"DS18B20","Address":"283AC28304000052","Temperature":19.6}}

* Add new xdrv_05_ds18x20.ino free from library OneWire and add the
following features:
 *  Add support for DS1822
 *  Add forced setting of
12-bit resolution for selected device types (arendst#1222)
 *  Add read
temperature retry counter (arendst#1215)
 *  Fix lost sensors by performing
sensor probe at restart only thereby removing dynamic sensor probe
(arendst#1215)
 *  Fix sensor address sorting using ascending sort on sensor
type followed by sensor address
 *  Rewrite JSON resulting in shorter
message allowing more sensors in default firmware image:
 *
"DS18B20-1":{"Id":"00000483C23A","Temperature":19.5},"DS18B20-2":{"Id":"0000048EC44C","Temperature":19.6}

* Add additional define in user_config.h to select either single sensor
(defines disabled), new multi sensor (USE_DS18X20) or legacy multi
sensor (USE_DS18X20_LEGACY)
 * Add support for Sonoff Dual R2 (arendst#1249)
 *
Fix ADS1115 detection (arendst#1258)
@pmknowles
Copy link

pmknowles commented Sep 22, 2018

Has anyone managed to get an AM2301 to work on the Dual R2. I have tried Button 0, Button 1 ,Tx and Rx and just get NaN as a response.(v6.2.1). Have tried other versions back as far as 5.12 and the sensor doesn't appear in the UI after configuration.
Resolved - duff ground connection in the 2.5mm jack socket.

@localhost61
Copy link
Contributor

Of course it works.
I used GPIO1 for that, the header also have Vcc and Gnd, this perfect for the purpose.
Here is a picture of my implementation as a roller shutter with wall switches on GPIO0 and GPIO9
Currently working on 6.0.0a but I'm confident it would work on other versions.

@Bersaker
Copy link

Bersaker commented Jun 4, 2020

Hi. I've a new Version with Layer date from 2019-09-04

20200604_165311
20200604_165953
20200604_170012
20200604_170106

@localhost61
Copy link
Contributor

Yes I got 4 of them too and they behave the same as v1.0

@Bersaker
Copy link

Bersaker commented Jun 5, 2020

Is it possible to use a bme280 over sda and scl? When I look at pcb 1.4 pin 14 is in use

@pmknowles
Copy link

pmknowles commented Jun 5, 2020 via email

@localhost61
Copy link
Contributor

Yes, no problem to use the header on the top of board to connect a BME280 but you'll have to disable SerialLog (it's maybe automatic in Tasmota code).
The delicate point is to use Button 0 (GPIO9) which will prevent reboot if pull down.

2020-06-05 08_34_06-D11 VR_SdB2 - Configuration du Module

2020-06-05 08_35_47-D11 VR_SdB2 - Menu principal

@pmknowles
Copy link

pmknowles commented Jun 5, 2020 via email

@meingraham
Copy link
Collaborator

@pmknowles That's a great summary. You should add it to https://tasmota.github.io/docs/Peripherals/#usable-pins

@pmknowles
Copy link

pmknowles commented Jun 5, 2020 via email

@kugelkopf123
Copy link
Contributor

The same exists for ESP32. Perhaps this would be great to add it, too.

https://randomnerdtutorials.com/esp32-pinout-reference-gpios/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests