No I2C with Sonoff 4CH R2
Moderators: grovkillen, Stuntteam, TD-er
-
- New user
- Posts: 9
- Joined: 29 Aug 2018, 22:06
No I2C with Sonoff 4CH R2
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
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
Re: No I2C with Sonoff 4CH R2
As far as I know the standard I2C pins are GPIO4 and GPIO5 and I use them in quite few projects....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?
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
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
-
- New user
- Posts: 9
- Joined: 29 Aug 2018, 22:06
Re: No I2C with Sonoff 4CH R2
Here is the known GPIO list for the Sonoff 4CH R2:papperone wrote: ↑21 Apr 2019, 08:19As far as I know the standard I2C pins are GPIO4 and GPIO5 and I use them in quite few projects....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?
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
Re: No I2C with Sonoff 4CH R2
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.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
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
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Re: No I2C with Sonoff 4CH R2
Hipapperone wrote: ↑03 May 2019, 07:10Then 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.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
I can confirm GPIO1/3 are the hardware serial and probably can't be used reliably for I2C communication.
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
Re: No I2C with Sonoff 4CH R2
I am interested in the outcome of this question!
So is it finally possible to add an MCP23017 to the Sonoff 4CH R2 using I²C ?
Once serial RX/TX disabled you can use GPIO 1 and 3 for I²C ?
Someone has done it successfully ?
So is it finally possible to add an MCP23017 to the Sonoff 4CH R2 using I²C ?
Once serial RX/TX disabled you can use GPIO 1 and 3 for I²C ?
Someone has done it successfully ?
Re: No I2C with Sonoff 4CH R2
It should indeed be possible to use those pins for I2C.
Just make sure to uncheck "Enable Serial port:" on the Tools->Advanced tab.
I do advice to use a simple pin header for this, as you may need to use them later for serial again to upgrade ESPEasy as this one uses only an 1M flash chip.
Just make sure to uncheck "Enable Serial port:" on the Tools->Advanced tab.
I do advice to use a simple pin header for this, as you may need to use them later for serial again to upgrade ESPEasy as this one uses only an 1M flash chip.
Re: No I2C with Sonoff 4CH R2
I have several Sonoff S20's, that like the 4CH R2 only expose gpio 1 and 3, to connect I2C sensors, though you must take care of the fact that there may be dangerously high voltages on these connections, so please wire them safely!
/Ton (PayPal.me)
Who is online
Users browsing this forum: Majestic-12 [Bot] and 16 guests