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
Flashing/Plusing when pin14 is connected to ground #484
Comments
I have some units setup in the same fashion so it should work - I assume your light swtich is a proper toggle switch not a momentary on/off unit? Can you confirm
You can do this from the console on the webportal by issuing the commands
|
Thank you for your reply, the sonoff basic module is setup as follows. This is the result from the commands you asked me to run. Since I posted the issue, I have re-flashed the sonoff to try to rectify the issue, but It still remains but the interval between flashing is much longer now sometimes minutes apart.
The Switch is a standard household switch that latches and follows this schematic, that I obtained from here. The setup is a little different as I live in the UK, where no neutral is present at the switch but follows the same principles as the US.
Would there be a way to add latency to the switch before doing anything, or lowering the tolerance before determining if pin14 is high or low. As it does not seem to be present on Alexa or MQTT, perhaps it is the distance to the switch or interference? The problem is reversed when the switch is high and I've turned off the light with Alexa. Also would it be possible to just trigger MQTT, without turning on the light at the swtich, then I could filter out the blinking? |
switchmode 0 tells it that you want to toggle when it sees a connection, you probably want switchmode set to follow (1) see https://github.com/arendst/Sonoff-Tasmota/wiki/Commands |
@davidelang depends if you are likely to 'remotely' turn on/off often - as then toggle makes more sense (which makes it work similar to a 2 way switch) - a flick of the switch will always change the state - but up or down on the actual wall switch doesn't mean anything. At least that is what i have done. @aidancrane Your diagram seems to make sense to me and rest of setup looks ok. I can only imagine here that there is some cross talk/induction due to the length of cable from the rose to the switch (how long is this?). Could mean that it floats of GND sometimes even when switch closed. Also just want to check if you disable switch one it doesn't turn on/off by itself? |
Presuming you eliminate any possibility something other than the switch is causing the on/off then suggest reading this https://electronics.stackexchange.com/questions/49824/microcontroller-with-a-long-wire-for-digital-input/49825 |
Ok, I have been up into the ceiling and tried a dead short across the pins, low and behold the issue is gone, therefore it must be that the problem exists due to voltage drop from the switch as you had said. The distance to the switch is quite short, only 6-7 meters round trip, but seems to be enough to cause the flickering. Now this is more of an electronics question so may not be the best place to ask, but I don't really want to re-wire the switch and would rather use the existing wire. After reading the stackexchange question, would my best bet be to run a boost converter in line with pin14? say 3v to 5v? |
Ok, thank you, I will try a capacitor and if it fails I will try other means. |
add a small bypass capacitor to the line (between gpio14 and ground), that will
reduce the noise on the line. You may also want to attach a pull-up resistor on
the line to make it more solidly non-zero when the switch is open.
adding a 5v converter would not help, because when the switch is closed, it's
not seeing 3.3v, it's connecting to ground.
|
@davidelang @khcnz Hi, I am having this issue with one of my sonoff basics which I install on a 2 way circuit and the wires going around the house to both switches are probably exceeding 15 meters. sorry I need some visuals to get this right. Is the attached diagram correct for the placement of the capacitor and resistor? What size capacitor and resistor do I use? |
|
that looks correct, the value of the resistor and capacitor don't really matter much the resistor needs to be large enough that it doesn't eat a lot of power. the capacitor needs to be small enough that it's charge time isn't large enough to be noticable. |
@davidelang what puzzles me is that this happens only with this circuit with a 2 way switch. I have another 3 on a single gang switch and they seem to work fine. Do you think it is necessary to put the resistor and capacitor on the other sonoffs as well? |
the resistor is needed when using pin 14 (st least most of the time)
the capacitor is needed when the attached wire gets 'too long' or 'too near
sources of itnerference', so you don't need it a lot of the time, but the longer
the wire, the more the chances are that you will need it.
|
@davidelang could you give me the specification of the capacitor i need to get? I tried looking for one and there is a ton of them out there and they have voltage as well. The smallest voltage capacitors i could find was 4v and 40uF and i got a couple of 0.25w 10k om resistors. Does that sound right to you? |
On Sun, 9 Jul 2017, DNA99 wrote:
@davidelang could you give me the specification of the capacitor i need to
get? I tried looking for one and there is a ton of them out there and they
have voltage as well. The smallest voltage capacitors i could find was 4v and
40uF and i got a couple of 0.25w 10k om resistors. Does that sound right to
you?
those will probably do, the ESP-8266 is a 3.3v system so the 4v cap will
probably work, 10k resistors should be just fine.
|
Thanks pal! Now to remove the sonoffs and back to the soldering iron. |
|
I've seen people use anything from about 3K up past 10K, the value is not
critical. The smaller the resistor, the more current will be pulled from the pin
when the switch is closed
v=ir
v=3.3v
if r=1k then i=0.033 amps, I believe the pins are ratd at 0.02A, so this would
be too small, but if r=2k, that would drop it to 0,017A, which would not burn
out the chip, but would be quite a bit of draw.
David Lang
|
I have just flashed and installed Sonoff-Tasmota in a lightswitch in the house. I also attached pin14 to the old light switch to also have the ability to use the old light switch to turn it on and off.
From the console, or MQTT the bug is not present, I can turn the switch on and off no trouble when the wall switch is off.
However, when I turn on or off the light from the wall switch, it pulses for less than a couple seconds all the time, and it never ends, I've tried disabling MQTT.
12:04:09 is when I flipped the wall switch from off to on, the rest is of the switches own accord, does anyone know why this is happening?
The text was updated successfully, but these errors were encountered: