Sonoff 4CH with ESPEasy

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Sonoff 4CH with ESPEasy

#101 Post by grovkillen » 02 Dec 2017, 21:22

stofakiller wrote: 21 Sep 2017, 15:07 Hi,

I have a 5-32v Sonoff/Itead 4ch, but i cant figure out how to flash it. I have flash many types of Sonoff's, i have Sonoff POW, normal 1ch Sonoffs and bulbs... I have triede both thrue my Arduino to flash it and also tried to erase it with ESP_Basic_Flasher... I always get cant open the port. Anyone triede or have any suggestions?
sonoff-4ch.jpg
This unit is now "officially" supported by ESP Easy: https://www.letscontrolit.com/wiki/inde ... ff_DIY_4ch
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Sonoff 4CH with ESPEasy

#102 Post by manjh » 12 Dec 2017, 16:22

Any chance of formal support for the Sonoff Pow? Looks like a very handy little device to help understand power consumption...

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Sonoff 4CH with ESPEasy

#103 Post by grovkillen » 12 Dec 2017, 17:04

manjh wrote: 12 Dec 2017, 16:22 Any chance of formal support for the Sonoff Pow? Looks like a very handy little device to help understand power consumption...
Since Tasmota is supporting that device it should be possible to write a plugin for ESP Easy as well. If you do some research on the subject and bring all your findings and suggest a enhancement on GitHub someone might pick up the idea.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Sonoff 4CH with ESPEasy

#104 Post by Shardan » 12 Dec 2017, 20:10

manjh wrote: 12 Dec 2017, 16:22 Any chance of formal support for the Sonoff Pow? Looks like a very handy little device to help understand power consumption...
There's already a long thread about sonoff pow in the forum.
http://www.letscontrolit.com/forum/view ... POW#p20950
Regards
Shardan

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Sonoff 4CH with ESPEasy

#105 Post by manjh » 12 Dec 2017, 20:46

Shardan wrote: 12 Dec 2017, 20:10
manjh wrote: 12 Dec 2017, 16:22 Any chance of formal support for the Sonoff Pow? Looks like a very handy little device to help understand power consumption...
There's already a long thread about sonoff pow in the forum.
http://www.letscontrolit.com/forum/view ... POW#p20950
I noticed, and managed to read half way through it.
At some point the discussion drifted off towards liability and how people will try to electrocute themself. :twisted:
I was hoping to find a firm "yes" or "no" answer to the support question, or (if that can't be given) perhaps a careful "maybe in the near future"...

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Sonoff 4CH with ESPEasy

#106 Post by manjh » 12 Dec 2017, 20:48

grovkillen wrote: 12 Dec 2017, 17:04
manjh wrote: 12 Dec 2017, 16:22 Any chance of formal support for the Sonoff Pow? Looks like a very handy little device to help understand power consumption...
Since Tasmota is supporting that device it should be possible to write a plugin for ESP Easy as well. If you do some research on the subject and bring all your findings and suggest a enhancement on GitHub someone might pick up the idea.
Ah, yes... :oops:
Unfortunately I am more of a tester than a developer these days... I'm sure I would eventually even be able to write a plugin, but the learning curve would be a bit steep! :)

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Sonoff 4CH with ESPEasy

#107 Post by grovkillen » 12 Dec 2017, 21:30

manjh wrote: 12 Dec 2017, 20:48
grovkillen wrote: 12 Dec 2017, 17:04
manjh wrote: 12 Dec 2017, 16:22 Any chance of formal support for the Sonoff Pow? Looks like a very handy little device to help understand power consumption...
Since Tasmota is supporting that device it should be possible to write a plugin for ESP Easy as well. If you do some research on the subject and bring all your findings and suggest a enhancement on GitHub someone might pick up the idea.
Ah, yes... :oops:
Unfortunately I am more of a tester than a developer these days... I'm sure I would eventually even be able to write a plugin, but the learning curve would be a bit steep! :)
But you can always do something, like finding places where to find more information etc. Links are valuable assets.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

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

Re: Sonoff 4CH with ESPEasy

#108 Post by papperone » 13 Dec 2017, 07:37

manjh wrote: 12 Dec 2017, 16:22 Any chance of formal support for the Sonoff Pow? Looks like a very handy little device to help understand power consumption...
What do you mean? I already wrote a plugin to support POW current/voltage reading feature.
The relay and led can be activated with standard plugin, what else you need?
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

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Sonoff 4CH with ESPEasy

#109 Post by manjh » 13 Dec 2017, 08:45

papperone wrote: 13 Dec 2017, 07:37
manjh wrote: 12 Dec 2017, 16:22 Any chance of formal support for the Sonoff Pow? Looks like a very handy little device to help understand power consumption...
What do you mean? I already wrote a plugin to support POW current/voltage reading feature.
The relay and led can be activated with standard plugin, what else you need?
:) :) :) you just made my day! :) :) :)
This information is probably somewhere in the seond half of that long thread, which I have not read yet. I also checked the Wiki, found a number of Sonoff products that are supported but did not see any reference to the pow.
Can I assume the plugin is in Github?

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

Re: Sonoff 4CH with ESPEasy

#110 Post by papperone » 13 Dec 2017, 17:34

manjh wrote: 13 Dec 2017, 08:45
papperone wrote: 13 Dec 2017, 07:37
manjh wrote: 12 Dec 2017, 16:22 Any chance of formal support for the Sonoff Pow? Looks like a very handy little device to help understand power consumption...
What do you mean? I already wrote a plugin to support POW current/voltage reading feature.
The relay and led can be activated with standard plugin, what else you need?
:) :) :) you just made my day! :) :) :)
This information is probably somewhere in the seond half of that long thread, which I have not read yet. I also checked the Wiki, found a number of Sonoff products that are supported but did not see any reference to the pow.
Can I assume the plugin is in Github?
Yes, it's in the playground still but fully functional...
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

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Sonoff 4CH with ESPEasy

#111 Post by manjh » 13 Dec 2017, 17:37

papperone wrote: 13 Dec 2017, 17:34
manjh wrote: 13 Dec 2017, 08:45
papperone wrote: 13 Dec 2017, 07:37

What do you mean? I already wrote a plugin to support POW current/voltage reading feature.
The relay and led can be activated with standard plugin, what else you need?
:) :) :) you just made my day! :) :) :)
This information is probably somewhere in the seond half of that long thread, which I have not read yet. I also checked the Wiki, found a number of Sonoff products that are supported but did not see any reference to the pow.
Can I assume the plugin is in Github?
Yes, it's in the playground still but fully functional...
Great. Now I will have to figure out how to get it from that "playground", and compile....
For the time being, I am using the Sonoff with their app. Works great, but not integrated with other devicecs via Domoticz.

nekely
New user
Posts: 9
Joined: 16 Jan 2018, 23:17

Re: Sonoff 4CH with ESPEasy

#112 Post by nekely » 16 Jan 2018, 23:19

I have managed to operate the sonoff 4ch correctly, with ESP, what I do not get is that none of the physical buttons work.

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Sonoff 4CH with ESPEasy

#113 Post by manjh » 16 Jan 2018, 23:45

nekely wrote: 16 Jan 2018, 23:19 I have managed to operate the sonoff 4ch correctly, with ESP, what I do not get is that none of the physical buttons work.
You need to create rules for that.
Example:

Code: Select all

On TurnOn1 do
  gpio, 12, 1
endon
On TurnOff1 do
  gpio, 12, 0
endon
On TurnOn2 do
  gpio, 5, 1
endon
On TurnOff2 do
  gpio, 5, 0
endon
On TurnOn3 do
  gpio, 4, 1
endon
On TurnOff3 do
  gpio, 4, 0
endon
On TurnOn4 do
  gpio, 15, 1
endon
On TurnOff4 do
  gpio, 15, 0
endon

on Toggle1 do
  if [relais1#state]=1
    Event TurnOff1
  else
    Event TurnOn1
  endif
endon
on Toggle2 do
  if [relais2#state]=1
    Event TurnOff2
  else
    Event TurnOn2
  endif
endon
on Toggle3 do
  if [relais3#state]=1
    Event TurnOff3
  else
    Event TurnOn3
  endif
endon
on Toggle4 do
  if [relais4#state]=1
    Event TurnOff4
  else
    Event TurnOn4
  endif
endon

on button1#state do
  Event Toggle1
endon
on button2#state do
  Event Toggle2
endon
on button3#state do
  Event Toggle3
endon
on button4#state do
  Event Toggle4
endon

nekely
New user
Posts: 9
Joined: 16 Jan 2018, 23:17

Re: Sonoff 4CH with ESPEasy

#114 Post by nekely » 17 Jan 2018, 10:27

sorry ..., I had not restarted the sonoff. :?
now it works, but only the first time it turns on and off, then I press the button and it does not do anything

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Sonoff 4CH with ESPEasy

#115 Post by manjh » 17 Jan 2018, 10:45

nekely wrote: 17 Jan 2018, 10:27 sorry ..., I had not restarted the sonoff. :?
now it works, but only the first time it turns on and off, then I press the button and it does not do anything
can you show the rules and device settings?

nekely
New user
Posts: 9
Joined: 16 Jan 2018, 23:17

Re: Sonoff 4CH with ESPEasy

#116 Post by nekely » 17 Jan 2018, 20:07

this is the rule

Code: Select all

On Channel1#Switch do
    if [Channel1#Switch]=1
        event,Channel1_On
    else
        event,Channel1_Off
    endif
endon
On Channel2#Switch do
    if [Channel2#Switch]=1
        event,Channel2_On
    else
        event,Channel2_Off
    endif
endon
On Channel3#Switch do
    if [Channel3#Switch]=1
        event,Channel3_On
    else
        event,Channel3_Off
    endif
endon
On Channel4#Switch do
    if [Channel4#Switch]=1
        event,Channel4_On
    else
        event,Channel4_Off
    endif
endon


on Channel1_On do
    gpio,12,1
    inputswitchstate 0,1
endon
on Channel1_Off do
    gpio,12,0
    inputswitchstate 0,0
endon

on Channel2_On do
    gpio,5,1
    inputswitchstate 9,1
endon
on Channel2_Off do
    gpio,5,0
    inputswitchstate 9,0
endon

on Channel3_On do
    gpio,4,1
    inputswitchstate 10,1
endon
on Channel3_Off do
    gpio,4,0
    inputswitchstate 10,0
endon

on Channel4_On do
    gpio,15,1
    inputswitchstate 14,1
endon
on Channel4_Off do
    gpio,15,0
    inputswitchstate 14,0
endon
Image
Image
Image

TD-er
Core team member
Posts: 8748
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Sonoff 4CH with ESPEasy

#117 Post by TD-er » 17 Jan 2018, 20:11

What version of ESPeasy?
I recently (last week) fixed an issue with the switch plugin.

nekely
New user
Posts: 9
Joined: 16 Jan 2018, 23:17

Re: Sonoff 4CH with ESPEasy

#118 Post by nekely » 17 Jan 2018, 20:25

version 2_3_0

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Sonoff 4CH with ESPEasy

#119 Post by grovkillen » 17 Jan 2018, 20:56

nekely wrote: 17 Jan 2018, 20:25version 2_3_0
That is the core version. What ESP Easy version?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Sonoff 4CH with ESPEasy

#120 Post by manjh » 17 Jan 2018, 21:29

In the first piece of code, you're checking on the state of the switch. Should be the state of the gpio.

nekely
New user
Posts: 9
Joined: 16 Jan 2018, 23:17

Re: Sonoff 4CH with ESPEasy

#121 Post by nekely » 17 Jan 2018, 21:50

I just put the last update today, I'll try it

nekely
New user
Posts: 9
Joined: 16 Jan 2018, 23:17

Re: Sonoff 4CH with ESPEasy

#122 Post by nekely » 17 Jan 2018, 22:07

nothing, with the new update they do not work either

nekely
New user
Posts: 9
Joined: 16 Jan 2018, 23:17

Re: Sonoff 4CH with ESPEasy

#123 Post by nekely » 20 Jan 2018, 13:27

manjh wrote: 17 Jan 2018, 21:29 In the first piece of code, you're checking on the state of the switch. Should be the state of the gpio.
I'm sorry I did not see this message, I try it

tplus
New user
Posts: 3
Joined: 21 Jan 2018, 21:00

Re: Sonoff 4CH with ESPEasy

#124 Post by tplus » 21 Jan 2018, 21:02

Is there an IO-mapping for the Sonoff 4CH PRO available?

Thanks for help...

nekely
New user
Posts: 9
Joined: 16 Jan 2018, 23:17

Re: Sonoff 4CH with ESPEasy

#125 Post by nekely » 23 Jan 2018, 13:13

in the end I got it, thanks

at first pressing the button would turn on, but turning it off at the time it was turned on again.
After several tests I got it to work changing "normal switch" to "push button active low"

these are the rules that you create

Code: Select all

on Boton1#Switch do
if [Boton1#Switch]=1
gpio,12,0
else
gpio,12,1
endif
endon

on Boton2#Switch do
if [Boton2#Switch]=1
gpio,5,0
else
gpio,5,1
endif
endon

on Boton3#Switch do
if [Boton3#Switch]=1
gpio,4,0
else
gpio,4,1
endif
endon

on Boton4#Switch do
if [Boton4#Switch]=1
gpio,15,0
else
gpio,15,1
endif
endon
now all switch works fine, I just need to try it with my veraedge

tplus
New user
Posts: 3
Joined: 21 Jan 2018, 21:00

Re: Sonoff 4CH with ESPEasy

#126 Post by tplus » 23 Jan 2018, 17:52

I tried to find the GPIO IO-mapping for the 4CH Pro using HTTP commands. At GPIO-6 relay one got on but I could not switch it off again. Tried also to switch on GPIO 4 and 5. Then I could not connect to the GUI any more and now the 4CH Pro is in a boot-loop:

Code: Select all

INIT : Booting version: v2.0-20180120
INIT : Cold Boot
FS   : Mounting...
FS   : Mount successful, used 75802 bytes of 113201
INIT : Free RAM:26000
INIT : I2C
INIT : SPI not enabled
WIFI : AP Mode disabled
WIFI : AP Mode ssid will be ESP_water_0 with address 192.168.4.1
WIFI : Connecting XXXX attempt #1
WIFI : Connected! IP: 192.168.10.35 (ESP_water_0)

 ets Jan  8 2013,rst cause:4, boot mode:(3,0)

wdt reset
load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v09826c6d
~ld
⸮U


INIT : Booting version: v2.0-20180120
INIT : Warm boot #1
FS   : Mounting...
FS   : Mount successful, used 75802 bytes of 113201
INIT : Free RAM:26000
INIT : I2C
INIT : SPI not enabled
WIFI : AP Mode disabled
WIFI : AP Mode ssid will be ESP_water_0 with address 192.168.4.1
WIFI : Connecting XXXX attempt #1
WIFI : Connected! IP: 192.168.10.35 (ESP_water_0)

 ets Jan  8 2013,rst cause:4, boot mode:(3,0)

wdt reset
load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v09826c6d
~ld
⸮U
When I change the onboard "Work Mode Switch" from "Interlock" to "Self-locking/Inching" it's still in a loop but the boot mode changes to (3,2). Also the top 3 LED are on.

Installed software v2.0-20180123, no change.

What to do? Is there a "GPIO of death"?

Thanks for some help.

nekely
New user
Posts: 9
Joined: 16 Jan 2018, 23:17

Re: Sonoff 4CH with ESPEasy

#127 Post by nekely » 24 Jan 2018, 20:10

nekely wrote: 23 Jan 2018, 13:13 now all switch works fine, I just need to try it with my veraedge
Works fine with my veraedge, send de command and status correctly modifing some the rules to send htpp commands

tplus
New user
Posts: 3
Joined: 21 Jan 2018, 21:00

Re: Sonoff 4CH with ESPEasy

#128 Post by tplus » 26 Jan 2018, 17:11

Sonoff 4CH Pro:

GPIO mapping is the same. All K5 switches should be set to "on", the S6 switch to 1. Then it works like the standard one.

radebebek
New user
Posts: 5
Joined: 05 Feb 2018, 11:06

Re: Sonoff 4CH with ESPEasy

#129 Post by radebebek » 05 Feb 2018, 11:10

...
Last edited by radebebek on 05 Feb 2018, 11:14, edited 2 times in total.

radebebek
New user
Posts: 5
Joined: 05 Feb 2018, 11:06

Re: Sonoff 4CH with ESPEasy

#130 Post by radebebek » 05 Feb 2018, 11:13

Hello All,

I have this scheme wiring: http://prntscr.com/i0qrfb

I used homebridge plugin and iphone app HOME and I have problem about inform state.

Example:

1. State Lights on HOME app is OFF.
2. Turn on Lights with HOME app on R1 relay, snd Sonoff PRO switch reley and Lights is ON. On app HOME change state to ON.
3. When I pressing physical key "WALL SWITHC" Disconnect Electric Cricuit and turn off Light.
State continue ON on HomeAPP.

How to inform app that state is change?
Is there firmware has this possibility?
Rade

User avatar
Methuselah
Normal user
Posts: 45
Joined: 04 Feb 2018, 01:39
Location: Boston, MA

Re: Sonoff 4CH with ESPEasy

#131 Post by Methuselah » 05 Feb 2018, 16:00

Greetings folks.

Has anyone attempted to solder an I-PEX connector on PSF-A's wifi antenna solder traces?

I need to install my Sonoff outside, in a weatherproof electrical enclosure which will attenuate the wifi signal. I can drill a hole and install an SMA barrel connector, and place an wifi antenna on the exterior of the enclosure, and run a I-PEX cable to the Sonoff, but need to solder a I-PEX female connector to the PSF-A board

Assuming this will work... wondering if anyone has tried it.
N00b to the world of ESPEasy, but I've been programming since the days of punch cards and paper tape :)

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: Sonoff 4CH with ESPEasy

#132 Post by Domosapiens » 06 Feb 2018, 01:01

I-PEX and PSF-A :? :?

Could this solve you problem?
https://nl.aliexpress.com/item/1set-2-4 ... 04091.html
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

User avatar
Methuselah
Normal user
Posts: 45
Joined: 04 Feb 2018, 01:39
Location: Boston, MA

Re: Sonoff 4CH with ESPEasy

#133 Post by Methuselah » 06 Feb 2018, 13:43

Pretty much what I was going to do...

but requires the male connector soldered to the traces on the chip...

Image
Image

was wondering if anyone has attempted or done it already. I've ordered everything I need off amazon, should be here friday.
N00b to the world of ESPEasy, but I've been programming since the days of punch cards and paper tape :)

User avatar
Methuselah
Normal user
Posts: 45
Joined: 04 Feb 2018, 01:39
Location: Boston, MA

Re: Sonoff 4CH with ESPEasy

#134 Post by Methuselah » 09 Feb 2018, 18:10

Was a little tough to get the I-PEX connector soldered on (I had to order a different set of tips for my Weller), but I managed to do it, and it works great. After soldering on the connector, you can check if it is seated correctly by testing connectivity between the antenna pin (marked in red) and the center conductor on the I-PEX connector. The outer ring connects to ground, so just test connectivity between it and any ground on the motherboard. I connected a pigtail and secured it with some hot glue to the motherboard so it would not work itself loose. I then drilled a hole through the side of the Sonoff case and mounted the SMA connector. I connected a spare wifi antenna, but, when I mount it in the electrical enclosure outside, I will use an SMA extension cable through a drilled hole in the enclosure itself and mount the antenna on the outside of the cabinet.

Image
Image
Image
N00b to the world of ESPEasy, but I've been programming since the days of punch cards and paper tape :)

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: Sonoff 4CH with ESPEasy

#135 Post by Domosapiens » 09 Feb 2018, 18:19

Good job!
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Sonoff 4CH with ESPEasy

#136 Post by grovkillen » 09 Feb 2018, 18:20

Yes, looks very sharp. Good job!
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

User avatar
Methuselah
Normal user
Posts: 45
Joined: 04 Feb 2018, 01:39
Location: Boston, MA

Re: Sonoff 4CH with ESPEasy

#137 Post by Methuselah » 20 Feb 2018, 18:39

Final installation:

Image
Image

left-upper unit is wired to a 4-port VHF antenna switch on my tower, which uses 12vdc on 3 different pins to select which port (no voltage = port 1). I've programmed it to accept different commands to select which port on the switch to choose, e.g. /ip/control?cmd=event,Antenna3 will flip relay 3 to select port 4 on the switch.

upper-right unit is wired to an 8-port HF antenna switch (Ameritron RCS-10) which uses 12vdc BCD logic on 3 pins to select a port (000 = port 1, 111 = port 7, etc.) Again, programmed some commands, e,g, /ip/control?cmd=event,Antenna4 to turn on and off the appropriate relays via GPIO to select the correct port.

This allows me to run 2 line of Andrews LDF6-50 (~250' each) from my shack to the tower base, rather than a different run for each antenna (mega $$$$ - $10+/foot), and I can select which antenna I want to operate off of via a web command.

The bottom sonoff is used to control a winch to automatically raise and lower the tower fixture (a TX-455 crank up, retrofitted with a KF9P hoist plate and harbor freight 2000 lb hoist (see https://www.youtube.com/watch?time_cont ... TQiq-WGNFE). One relay is used to power on and off the hoist w/ 120vac (switching the hot wire), and two relays are used to select up or down motion (by directing current to one of two wires).
N00b to the world of ESPEasy, but I've been programming since the days of punch cards and paper tape :)

TD-er
Core team member
Posts: 8748
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Sonoff 4CH with ESPEasy

#138 Post by TD-er » 21 Feb 2018, 00:25

And the sonoff's are not interfering with the antenna signal itself?

Hope you're not switching to much current with these sonoffs. Even though they are rated for up to 10 Amps (some even 16 Amps), I wouldn't let them switch currents even half those limits.

User avatar
Methuselah
Normal user
Posts: 45
Joined: 04 Feb 2018, 01:39
Location: Boston, MA

Re: Sonoff 4CH with ESPEasy

#139 Post by Methuselah » 21 Feb 2018, 15:07

TD-er wrote: 21 Feb 2018, 00:25 And the sonoff's are not interfering with the antenna signal itself?
No. They switch relays which control an RF path from an input source to an output port. No RF travels through the Sonoff. It simply provides a 12vdc current source to the switching relays (not the unit I have, but along the same principle):

Image
Image

Hope you're not switching to much current with these sonoffs. Even though they are rated for up to 10 Amps (some even 16 Amps), I wouldn't let them switch currents even half those limits.
The antenna switches themselves use about 1/3rd of an amp to control the switching logic. The hoist uses a couple of amps to raise and lower the tower -- the hoist is significantly oversized for my application, but that's what the manufacturer of the hoist plate recommends (he sells one plate which will work with towers ranging from 40 to 90 feet, so the hoist in question is really designed for a tower twice the height of mine.) I expect it to draw about 3-5 amps maximum.
N00b to the world of ESPEasy, but I've been programming since the days of punch cards and paper tape :)

Mazzokun
New user
Posts: 7
Joined: 01 Nov 2016, 08:22

Re: Sonoff 4CH with ESPEasy

#140 Post by Mazzokun » 28 Mar 2018, 10:10

Hi all!
I'have flashed Sonoff 4ch with EspEasy v2.0-20180322, connected to domoticz and all works very well.
I connected a Pulse counter (TCRT5000 https://it.aliexpress.com/item/Free-shi ... lsrc=aw.ds) to GPIO2 on the board and followed the wiki https://www.letscontrolit.com/wiki/index.php/LJ12A3 but it doesn't work. Anyone can help? Thank you
Last edited by Mazzokun on 28 Mar 2018, 10:27, edited 2 times in total.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Sonoff 4CH with ESPEasy

#141 Post by grovkillen » 28 Mar 2018, 10:21

What task number is the pulse counter on? Only 1..4 is allowed.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Mazzokun
New user
Posts: 7
Joined: 01 Nov 2016, 08:22

Re: Sonoff 4CH with ESPEasy

#142 Post by Mazzokun » 28 Mar 2018, 14:48

Ok now with task 4 it reads the values...
but if I power cycle Sonoff it does not boot up if the tctr5000 Digital Output is connected to GPIO2..
If I connect TCTR to GPIO2 after the sonoff is boot up, all works.
What can I do?
Thank you

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Sonoff 4CH with ESPEasy

#143 Post by grovkillen » 28 Mar 2018, 15:04

https://www.letscontrolit.com/wiki/inde ... figuration

It need to be high on boot so please see if it's possible to activate a pull-up or you might need to fix a external pull-up.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Mazzokun
New user
Posts: 7
Joined: 01 Nov 2016, 08:22

Re: Sonoff 4CH with ESPEasy

#144 Post by Mazzokun » 28 Mar 2018, 20:18

I soldered a 4.7k resistance between 3.3v and gpio2 but it does not work.
I tried to use the gpio13 of the led of the wifi but during the start the relay 4 turns on and off immediately ..
Where did I go wrong?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Sonoff 4CH with ESPEasy

#145 Post by grovkillen » 28 Mar 2018, 20:30

Can you measure what the TCRT5000 is delivering to GPIO 2? I mean, can it be that it pulls the voltage down still even with the pull-up?
I'm no electronics guy so I'm just throwing stuff here...
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Mazzokun
New user
Posts: 7
Joined: 01 Nov 2016, 08:22

Re: Sonoff 4CH with ESPEasy

#146 Post by Mazzokun » 29 Mar 2018, 10:24

I'have found out that if I cover the IR led during the start up of sonoff it doesn't boot up (green led of TCRT is on) DO on tcrt is 3.3v .
If I don't cover it (green led on tcrt is off) DO on tcrt is 3.3v than Sonoff boot up...
But it's always green and it's off when it pulse.. so the problem persist..
I have connected DigitalOutput to the Sonoff but I have also an AnalogicOutput..
That's all. Thank you for support :)

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Sonoff 4CH with ESPEasy

#147 Post by grovkillen » 29 Mar 2018, 10:46

Ah, yes I always cover the IR led if I'm not using it as a signal. Great, I had my thoughts that something like that was going on :)

EDIT: or am I misunderstanding you (feels like it)?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Mazzokun
New user
Posts: 7
Joined: 01 Nov 2016, 08:22

Re: Sonoff 4CH with ESPEasy

#148 Post by Mazzokun » 29 Mar 2018, 11:06

yes, you misunderstood me, sorry for my little English :lol:
as an experiment I cover the two Led and if they are covered the esp doesn't boot, if they are not covered the esp boot up.
so I misured DO signal.. it's 3.3v if the led is covered and 0v if it's free..
I use the tcrt to read the number of spins of an old water meter

TD-er
Core team member
Posts: 8748
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Sonoff 4CH with ESPEasy

#149 Post by TD-er » 29 Mar 2018, 20:01

Just to be sure... it is just about the LEDs on the Sonoff 4ch, without any other components added?

A LED may act as a "solar panel".
You can verify this with a multimeter and a LED. Any led will work.
The voltage generated by the LED can be > 2V, depending on the color of the LED.
With the slightest load the voltage will drop to 0, since power generated is low, but on a high impedance input it may set some input off.
Activating a pull-up resistor may help then.

The_knarf
New user
Posts: 1
Joined: 21 Apr 2018, 15:03
Location: the Netherlands

Re: Sonoff 4CH with ESPEasy

#150 Post by The_knarf » 21 Apr 2018, 15:28

Hi all,

i am using the sonoff 4ch now for half a year with the default software, but i don't like that my switch is controlled via internet.
can i use ESPEasy to switch the 4 channels on/off? or does ESPEasy need to be controlled via a server/broker/MQTT?
I am looking for a solution to just have an app or webpage on my android phone to switch the 4 channels on or off. for now that would be all, who knows maybe later i will also use a broker or what ever.

I successfully loaded ESPEasy on it, but whats next, i dont see a page to control the switches, anybody a sugestion for this NOOB?

Thanks in advanced,

btw, i installed the ESPEasy_R148a_1024.zip posted by Shardan on page 4

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 52 guests