Relay just clicks, don't stay on.
Posted: Mon Jan 11, 2016 6:20 pm
Hi. I like this project and tried to use it as my entry point with ESP8266. But I have an issue with a relay. I have ESP-201 development board, the one for which jwbr made a scheme.
I'm able to switch LEDs with no issue, but when I try to control the relay ("po 16 1" as it is on pin 16), it just clicks and switches on only for a moment. There is an indicative LED which blinks, and when I tried to connect a battery-powered light through the relay, it blinks too. So I know I'm sending the signal to the relay, and because with the original firmware from AI-Thinker the relay was always on, I know it is not broken mechanically.
From what I'm doing, it looks like turning on the relay resets the chip. In the attached code, I can set red and blue LED on or of with /msg?set-to=[1|0]. And I can do it as many times I want. But when I uncomment the line touching pin 16 for the relay, it turns on only the red light, relay clicks and the program dies ("No MSG Branch Defined" until I run it again).
Am I doing something wrong, or is this a bug? Thanks for any reply.
Flash version: ESP Basic 1.75
I'm able to switch LEDs with no issue, but when I try to control the relay ("po 16 1" as it is on pin 16), it just clicks and switches on only for a moment. There is an indicative LED which blinks, and when I tried to connect a battery-powered light through the relay, it blinks too. So I know I'm sending the signal to the relay, and because with the original firmware from AI-Thinker the relay was always on, I know it is not broken mechanically.
From what I'm doing, it looks like turning on the relay resets the chip. In the attached code, I can set red and blue LED on or of with /msg?set-to=[1|0]. And I can do it as many times I want. But when I uncomment the line touching pin 16 for the relay, it turns on only the red light, relay clicks and the program dies ("No MSG Branch Defined" until I run it again).
Am I doing something wrong, or is this a bug? Thanks for any reply.
Flash version: ESP Basic 1.75
Code: Select all
msgbranch [mybranch]
print "set the branch"
wait
[mybranch]
msgget "set-to" stateVar
print stateVar
let myReturnMsg = "You Entered " & stateVar
REM switch red LED
po 15 stateVar
REM switch relay - uncomment the following line to crash it
REM po 16 stateVar
REM switch blue LED
po 12 stateVar
msgreturn myReturnMsg
wait