
ESP8266 WiFi Relay
The simplest of items can cause the biggest issues sometimes. Here we have an ESP8266-01 module plugged into a simple relay controller.
The relevant AT instructions have been sent to the ESP8266 – all well and good. I’ve downloaded the mobile phone app to control it. What could possibly go wrong?
Well, the phone app simply tells me “Connection error!”. Yet when I try and connect via my browser the connection details are immediately shown in the ESP8266 monitor window, so there’s nothing really wrong with the ESP8266 connecting to my wifi, nor my browser connecting to the ESP8266.
It’s that phone app that is the root cause of my issue here. What’s more frustrating is that the ESP8266’s code is not available – that is, I can’t just upload something else as I can’t easily find out what it is telling the relay controller.
So simple. So frustrating!
[Update 3rd March 2018 13:50] Fixed! All will be revealed in due course [\End Update]
Categories:Uncategorized
My 4 modules came in today but they are 3 volt. Not 5 volt as in the description.
https://www.ebay.ca/itm/ESP8266-ESP-01S-5V-Wifi-Relay-Module-for-TOI-APP-Controller-Smart-Home-DIY/332458964180?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649
They are different from yours, as there is no TX/RX on the board. It looks like I will have to program them “Off Board”
LikeLike
Remember that the ESP8266-01 boards themselves are always 3v3, Darrell, (unless they have a voltage regulator on-board, which mine don’t). The only 5v connection I have is on the relay module that does then go via a regulator to provide 3v3 to the ESP (and 5v to the relay).
As it happens I didn’t program the ESP via the RX/TX on the relay board as they are also connected to the STM8S003 and I didn’t want addition problems because of this, so I too programmed the ESP “off board”. Easy to do if you have a USB-to-Serial adapter or even better with a dedicated ESP8266-01 programmer like I will show in the follow-up video.
Your board is different from mine; the orientation of the ESP is different and you have an RST button, but it is simpler (and therefore, I suspect, better for its intended purpose). Yours has a relay, driver transistor, protection diode, a couple of resistors for the transistor and an LED. Basically, what I thought my board would be like, without the added complexity of the STM8S003. In which case I wonder if yours uses the GPIO2 pin to drive the transistor base directly instead of all that serial malarky? Seems highly probable.
Keep us updated! If these boards are good I might get a couple.
LikeLike
The pin to operate the relay is GP0, 3v3 switches on the relay coil and lights the LED.
Graham
LikeLike
Looking forward to your video on this one Ralph. Best of luck on the Blog.
One question I have about this board, is it using Esp-01 ? Perhaps you can share a link of where you got the board if possible.
LikeLike
I do have another question. Were you able to program the ESP with your own sketch?
LikeLike
I haven’t on this occasion but my last words in the video I’ve just done (not yet published at the time of this comment) I do state this very aspiration. I’ll see if it can be done and how easy; I’m thinking that as the Tx/Rx pins are available then it should be possible.
LikeLike
HI Raad, the manufacturer’s webpage states “On-board STM8S003 and ESP-01 WIFI module”. And I bought it from here: https://www.aliexpress.com/item/ESP8266-5V-WiFi-relay-module-Things-smart-home-remote-control-switch-phone-APP/32812243370.html
LikeLike
https://www.hackster.io/makerrelay/esp8266-wifi-5v-1-channel-relay-delay-module-iot-smart-home-e8a437
This gives good data on the physical device. Read the comments some look interesting (Pawel) I don’t understand the app pictures or why need a RS232 link to the main board from the ESP when it could drive the transistor buffer for the relay. It looks like the ESP is in LUA running AT commands.
Personally I would reprogram the ESP and connect it to the transistor and use its web address with /on and and /off and select the relay. It would run off a browser on the phone or computer no app required or a simple app that someone could write.
LikeLiked by 2 people
Thanks Graham! You’re the first poster on my new blog too.
Regarding that link, it seems to be a copy of the official documentation from Espressif, with the same (non working) result. BUT, my deep investigations and intensive research (Ok, I just went to the manufacturer’s webpage) led me to the correct solution. I’ll reveal all in a future video.
LikeLike
You’ve been mentioned in my video on this Graham. Nope, sorry, too late to cut it out now. Very useful, and then again not. But it all led me to the right solution (insofar as there was one, anyway). Thanks for the post.
LikeLike