esp8266 Relay not functioning. Wifi works well, but relay wont activate

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
robp2175
New user
Posts: 5
Joined: 28 Dec 2016, 19:53

esp8266 Relay not functioning. Wifi works well, but relay wont activate

#1 Post by robp2175 » 03 Jan 2017, 16:37

I bought two of these:
http://www.ebay.com/itm/152345540675?_t ... EBIDX%3AIT

I was able to get the ESP Easy 120 firmware on both of them without any issues. The firmware appears to be working correctly and I can control the Wifi LED light by using
http://192.168.100.107/control?cmd=GPIO,1,0

However, the relay will not function using any of the GPIOs. My understanding is the relay should function using GPIOs1 or 2. However I have tried 0-16 and none work to activate the relay. On top of that, both relays emit this constant electronic clicking noise. See the Youtube video below.

I would greatly appreciate any advice that could be provided. I am somewhat of a newbie, therefore I appreciate a small bit of patience in advance.

https://youtu.be/5Le9kNT_Bm4

groovy
Normal user
Posts: 39
Joined: 14 Oct 2016, 11:32
Location: Chemnitz, Germany

Re: esp8266 Relay not functioning. Wifi works well, but relay wont activate

#2 Post by groovy » 03 Jan 2017, 17:10

The relays you bought are 5V, ESP8266 only has 3,3V. So you can't switch them.

robp2175
New user
Posts: 5
Joined: 28 Dec 2016, 19:53

Re: esp8266 Relay not functioning. Wifi works well, but relay wont activate

#3 Post by robp2175 » 03 Jan 2017, 17:13

The relays get there power from an external 5v power supply. The power is not the issue.

I have used the esp8266 module from to trigger another relay I own, also 5v, and it worked without an issue.

ntissm
New user
Posts: 7
Joined: 15 Dec 2016, 12:42

Re: esp8266 Relay not functioning. Wifi works well, but relay wont activate

#4 Post by ntissm » 07 Jan 2017, 22:09

Hi robp2175

The problem is not VCC but how you can close/open the relay.
This kind of device is not using gpio directly but the serial interface.

You have to send the following over serial in 9600,8,N,1

like for this other USB relay of the same company

LC USB switch the default communication baud rate: 9600 BPS
LC USB switch communication protocol
Data (1) - startup logo (the default is 0 xA0)
Data (2) - switch address code (the default is 0 x01, identifies the first switch)
Data (3) - operation data (0 x00 to "off", 0 x01 to "on")
Data (4) - check code

For example:
Open the USB switch: A0 01 01 A2
Close the USB switch: A0 01 00 A1

see http://www.chinalctech.com/index.php?_m ... w&p_id=969

I test it with socketWorkbench and the plugin ser2Net. it runs.

I am now trying to do a plugin to use it automatically with standard MQQT, HTTP request

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 88 guests