General area when it fits no where else

Moderator: Mmiscool

User avatar
By zopper
#38541 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

Code: Select allmsgbranch [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
User avatar
By Mmiscool
#38548 Can you post the serial output from the device.

Also pin 16 is used for the deep sleep mode and should probably not be used. Try a jumper from another pin and see if the relay work on that pin.
User avatar
By zopper
#38564
Mmiscool wrote:Try a jumper from another pin and see if the relay work on that pin.


Yes, thank you! I connected the relay with one diode and it stays open. Is the serial output still needed, or we can already draw a conclusion? :-)