hey guys
I received 2 sonoff s20's in the mail. I flashed them with espeay r148 and set it all up for working
I have 2 questions
1) does this support i2c? I know the firmware does and the chip but does anybody know where to hook it up? or am I going to have to look at the pitout diagram and jankily solder wires to the I2c pins? Reason I ask is I have some LED lights that turn on after sunset at night so you can see in the hallway if you get up during the night. However they are on all the time even if the main lights are on. So I was going to hook up BH1750. Do you think that is possible? also do you think it'd be possible to make to look nice without having the sesor dangiling off?
2) my lights in the thallway run esp01 and just a basic relay and DHT22. the setup looks terrible as I custom made a box for it with my 3d printer. Does the S20 have extra pins anywhere that I can hook up a DHT22 to 1 pin? or am I going to have to do the same as above?
sonoff s20 i2c question
Moderators: grovkillen, Stuntteam, TD-er
Re: sonoff s20 i2c question
The only holes for header pins are vcc/tx/rx/gnd. You could reconfigure the TX (GPIO-1) and RX (GPIO-3) in esp easy for other functions after disabling the serial port from the advanced menu. My understanding is you can use GPIO-1 and GPIO-3 for SCL and SDA with i2c, but I haven't tried it. Similarly you could also use one of those pins with a DHT22.
Use caution with the S20 if you are using the US version of the device. The design incorrectly switches Neutral, not Hot. This is a potential safety hazard (depending on what's plugged in to it) and is in violation of the National Electric Code.
Use caution with the S20 if you are using the US version of the device. The design incorrectly switches Neutral, not Hot. This is a potential safety hazard (depending on what's plugged in to it) and is in violation of the National Electric Code.
-
- Normal user
- Posts: 119
- Joined: 26 Feb 2017, 17:30
Re: sonoff s20 i2c question
Thanks for that info! I didn't even know that was even possible to remap the tx,rx. Cool!
What happens if I have to reflash it /the webpage is not responding? would be disabling serial effectively just turn it into a paperweight if that happened?
Looking this up I can find the disable serial in the adv. But how to i remap the pins? and will it only work for the ones you specified? I see in the hardware tab the sda and scl. is it as easy as just selecting which pin i want? if anyone could enlighten me that would be great
Thanks for the info, I actually saw that in a picture today, it wasn't a post i dont think because i was trying to look at pinouts and layouts of the board, while i was at work...
Luckily i have the UK version, do you know if it affects that one? as if it does I was probably going to complain to the seller and they should take them off the market
What happens if I have to reflash it /the webpage is not responding? would be disabling serial effectively just turn it into a paperweight if that happened?
Looking this up I can find the disable serial in the adv. But how to i remap the pins? and will it only work for the ones you specified? I see in the hardware tab the sda and scl. is it as easy as just selecting which pin i want? if anyone could enlighten me that would be great
Thanks for the info, I actually saw that in a picture today, it wasn't a post i dont think because i was trying to look at pinouts and layouts of the board, while i was at work...
Luckily i have the UK version, do you know if it affects that one? as if it does I was probably going to complain to the seller and they should take them off the market
Re: sonoff s20 i2c question
If you need to flash over serial again, it's not a problem. Just disconnect whatever sensor(s) you have on the tx/rx pins and flash away using the same procedure you did originally.
For i2c, you simply go to the hardware page and map scl and sda to GPIO-1 (TX) and GPIO-3 (RX) with the drop down selection. Again, I haven't tried this but as far as I know it works. For the S20, GPIO-1 and GPIO-3 are the only easily accessible pins and you can use them for most anything you want as long as the serial port has been disabled. All other uses would be defined in an individual entry in the Device table, only SDA/SCL are in the hardware menu.
On the Neutral/Hot issue, I doubt it effects the other ones. It's most likely only an issue with the US version.
For i2c, you simply go to the hardware page and map scl and sda to GPIO-1 (TX) and GPIO-3 (RX) with the drop down selection. Again, I haven't tried this but as far as I know it works. For the S20, GPIO-1 and GPIO-3 are the only easily accessible pins and you can use them for most anything you want as long as the serial port has been disabled. All other uses would be defined in an individual entry in the Device table, only SDA/SCL are in the hardware menu.
On the Neutral/Hot issue, I doubt it effects the other ones. It's most likely only an issue with the US version.
-
- Normal user
- Posts: 119
- Joined: 26 Feb 2017, 17:30
Re: sonoff s20 i2c question
thanks I will check this all out today
Re: sonoff s20 i2c question
You ever get it working? I tried today and the I2C scan came up with a whole bunch or sensor addresses but then defaulted to use 0x23, the default. The value initially reported, bounced around a bit then got stuck on one value never to update again.
Numerous Sonoff's and Shelly's, Home Assistant on Intel NUC i3, Aeotec Z-Stick (Gen 5), deCONZ Zigbee Stick, 3 x Echo Dot's and 5 x Google Home
Who is online
Users browsing this forum: Google [Bot] and 1 guest