No I2C with Sonoff 4CH R2

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
ajheyworth
Normal user
Posts: 8
Joined: 29 Aug 2018, 22:06

No I2C with Sonoff 4CH R2

#1 Post by ajheyworth » 20 Apr 2019, 09:06

Just diving into a Sonoff 4CH R2 which provides 4x relay outputs, a couple of unused GPIO pins on the board and 4x inputs tied to buttons.

I want to add an MCP23017 port expander to gain some more useful IO on the side and also for an OLED screen.

Q1. Trawling the internet it would seem that GPIO 01 and GPIO 03 are used for I2C. Does anyone else concur?

Q2. In ESP Easy Mega software, it seems that GPIO 01 and GPIO 03 are greyed out, so can't be allocated for I2C, yet I cannot see them allocated anywhere else.

Whilst on this topic...

Q3. Has anyone come across a very cheap IO breakout board tied to a port expander/circuit - just to provide a combination of both input and output connections? I've seen the relay boards, but am specifically looking for more inputs to reed switches etc.

Many thanks

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: No I2C with Sonoff 4CH R2

#2 Post by papperone » 21 Apr 2019, 08:19

ajheyworth wrote:
20 Apr 2019, 09:06
Q1. Trawling the internet it would seem that GPIO 01 and GPIO 03 are used for I2C. Does anyone else concur?
As far as I know the standard I2C pins are GPIO4 and GPIO5 and I use them in quite few projects....
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

ajheyworth
Normal user
Posts: 8
Joined: 29 Aug 2018, 22:06

Re: No I2C with Sonoff 4CH R2

#3 Post by ajheyworth » 21 Apr 2019, 08:27

papperone wrote:
21 Apr 2019, 08:19
ajheyworth wrote:
20 Apr 2019, 09:06
Q1. Trawling the internet it would seem that GPIO 01 and GPIO 03 are used for I2C. Does anyone else concur?
As far as I know the standard I2C pins are GPIO4 and GPIO5 and I use them in quite few projects....
Here is the known GPIO list for the Sonoff 4CH R2:
GPIO 00 - Button 1
GPIO 04 - Relay 3
GPIO 05 - Relay 2
GPIO 09 - Button 2
GPIO 10 - Button 3
GPIO 12 - Relay 1
GPIO 13 - WiFi LED
GPIO 14 - Button 4
GPIO 15 - Relay 4

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: No I2C with Sonoff 4CH R2

#4 Post by papperone » 03 May 2019, 07:10

ajheyworth wrote:
21 Apr 2019, 08:27
Here is the known GPIO list for the Sonoff 4CH R2:
GPIO 00 - Button 1
GPIO 04 - Relay 3
GPIO 05 - Relay 2
GPIO 09 - Button 2
GPIO 10 - Button 3
GPIO 12 - Relay 1
GPIO 13 - WiFi LED
GPIO 14 - Button 4
GPIO 15 - Relay 4
Then there are chances you can't use I2C with yout sonoff 4CH Pro due to the fact you have no good GPIO avail for the protocol.
I can confirm GPIO1/3 are the hardware serial and probably can't be used reliably for I2C communication.
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: No I2C with Sonoff 4CH R2

#5 Post by toffel969 » 03 May 2019, 11:48

papperone wrote:
03 May 2019, 07:10
ajheyworth wrote:
21 Apr 2019, 08:27
Here is the known GPIO list for the Sonoff 4CH R2:
GPIO 00 - Button 1
GPIO 04 - Relay 3
GPIO 05 - Relay 2
GPIO 09 - Button 2
GPIO 10 - Button 3
GPIO 12 - Relay 1
GPIO 13 - WiFi LED
GPIO 14 - Button 4
GPIO 15 - Relay 4
Then there are chances you can't use I2C with yout sonoff 4CH Pro due to the fact you have no good GPIO avail for the protocol.
I can confirm GPIO1/3 are the hardware serial and probably can't be used reliably for I2C communication.
Hi

You can use GPIO1/3 as I2C after disabling serial in advanced tab.
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests