Looking for a little guidance on a couple of ESP-01 configurations.

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
espfrm883
Normal user
Posts: 30
Joined: 28 Sep 2015, 00:07

Looking for a little guidance on a couple of ESP-01 configurations.

#1 Post by espfrm883 » 09 Dec 2015, 05:06

Will someone help with how to configure the following? I am a novice, at best, with electronics and learning as I go with your help of course. There are two different ESP nodes that I would like to create. So far, I can only get an led to work with both GPIO0 and GPIO2. I'm using openhab via MQTT and I know how to interface with openhab. My problem is that I can't get the ESP to load when I attach a pull-up resistor to either GPIO.

Node 1
- Reed switch and push button. The reed switch trips and sends an on/off to openhab via mqtt. The button performs the same command on the other GPIO.
> Do I use pull-up resistors? pull-down? Do I use the Switch hardware via the gui?

Node 2
- push button and relay.
> I'm assuming that I'll use the same design as recommended for Node 1 and the LED config that is already working.

Thank you for your patience and help.

Backbone
Normal user
Posts: 106
Joined: 06 Oct 2015, 22:12

Re: Looking for a little guidance on a couple of ESP-01 configurations.

#2 Post by Backbone » 09 Dec 2015, 08:15

Can you explain a little more precise what you mean with
"My problem is that I can't get the ESP to load when I attach a pull-up resistor to either GPIO".

When EASY esp is loaded you do not need any pull up or down resistors on the GPIO-01or 02 on the ESP 8266-01 versions.

Paco

espfrm883
Normal user
Posts: 30
Joined: 28 Sep 2015, 00:07

Re: Looking for a little guidance on a couple of ESP-01 configurations.

#3 Post by espfrm883 » 09 Dec 2015, 15:30

Trying to install a pull-up/down resistor may be my problem then.

How should I install a push button/reed switch? Does it matter if I use GPIO0 or GPIO2?


Where can I read up this?
When EASY esp is loaded you do not need any pull up or down resistors on the GPIO-01or 02 on the ESP 8266-01 versions.

Thanks again.

DMeekelenkamp
Normal user
Posts: 35
Joined: 11 Nov 2015, 13:52

Re: Looking for a little guidance on a couple of ESP-01 configurations.

#4 Post by DMeekelenkamp » 09 Dec 2015, 17:10

Just connect your button between the gpio (of your choice) and ground.

Then in the device menu of the Web gui . Choose switch. Enter the gpio that u used and tick the box with pull up. If u now push the button it will connect to ground otherwise it is pulled high by the esp.

You can also read this in the wiki:
http://www.esp8266.nu/index.php/Switch

espfrm883
Normal user
Posts: 30
Joined: 28 Sep 2015, 00:07

Re: Looking for a little guidance on a couple of ESP-01 configurations.

#5 Post by espfrm883 » 10 Dec 2015, 03:11

I am sorry that I am still having problems with the switch.

Can you see what may be wrong?

Notes:
- The value in the green area does not change.
- The button is in between the ground and GPIO0. I've tested the button and it is functioning properly and I connected it directly.
- The switch works fine

Code: Select all

Switch MQTTLED (test)	{mqtt=">[mymosquitto:/ESP01/gpio/2:command:ON:1],>[mymosquitto:/ESP01/gpio/2:command:OFF:0]"}
-I'm not sure what the correct format for openhab is correct. So I've listed many combinations.

Code: Select all

Switch MQTTLED (test)	{mqtt=">[mymosquitto:/ESP01/gpio/2:command:ON:1],>[mymosquitto:/ESP01/gpio/2:command:OFF:0]"}
Contact MQTTBTN1 (test)	{mqtt="<[mymosquitto:/ESP01/gpio/0:state:default]"}
Contact MQTTBTN2 (test)	{mqtt="<[mymosquitto:/ESP01/switch1:state:default]"}
Contact MQTTBTN3 (test)	{mqtt="<[mymosquitto:/ESP01/MQTTBTN:state:default]"}
Contact MQTTBTN4 (test)	{mqtt="<[mymosquitto:/ESP01/switch1/MQTTBTN:state:default]"}
- Here's a capture of the config
Capture1.PNG
Capture1.PNG (22.42 KiB) Viewed 11005 times
Thanks again.

Backbone
Normal user
Posts: 106
Joined: 06 Oct 2015, 22:12

Re: Looking for a little guidance on a couple of ESP-01 configurations.

#6 Post by Backbone » 10 Dec 2015, 07:36

to see the switch work in the esp easy interface you have to set the IDX/var value to an other value then 0.

Paco

espfrm883
Normal user
Posts: 30
Joined: 28 Sep 2015, 00:07

Re: Looking for a little guidance on a couple of ESP-01 configurations.

#7 Post by espfrm883 » 10 Dec 2015, 19:49

The ESP will still not recognize the input on either 00 and 02.

I changed the EDX/var to 123 and tried 100 as well.

Here's a picture of the build.
IMG_20151210_124629169_HDR.jpg
IMG_20151210_124629169_HDR.jpg (132.1 KiB) Viewed 10967 times

Backbone
Normal user
Posts: 106
Joined: 06 Oct 2015, 22:12

Re: Looking for a little guidance on a couple of ESP-01 configurations.

#8 Post by Backbone » 10 Dec 2015, 21:15

Did you connected the GND to the ESP board?
Picture does not show it.
This is how it works for me with a simple NO Normally Open contact.
Take care that if you press the switch the status in the interface will take some time to refresh.
Or do a manual refesh of the browser.
IDX/VAR is not shown as screenshot is from other version.


Paco
Knipsel13.JPG
Knipsel13.JPG (36.17 KiB) Viewed 10962 times

espfrm883
Normal user
Posts: 30
Joined: 28 Sep 2015, 00:07

Re: Looking for a little guidance on a couple of ESP-01 configurations.

#9 Post by espfrm883 » 11 Dec 2015, 04:38

Finally... I've got it working. Please bear with me as I two more requests...

- I can't get Openhab to pick it up.
- Can the switch config maintain a particular state when the circuit is closed? It appears to be in a monetary state (changing from 1 to 0 then to 0 to 1) each time the button it pushed. My idea would be for the state to normally be open (0) then change to (1) when the circuit is closed (button pressed) then back to open (0) when released.

These are the items that do not work.

Code: Select all

Contact MQTBTN	(test)	{mqtt=">[mymosquitto:/esp01/switch/button:state:MAP(switch.map)]"}
Contact MQTBTN1	(test)	{mqtt=">[mymosquitto:/esp01/switch/button:state:default)]"}
Here's the log.
SW : State 0
HTTP : Delay 1000 ms
MQTT : Topic /esp01/switch/button
SW : State 1
HTTP : Delay 1000 ms
MQTT : Topic /esp01/switch/button

Backbone
Normal user
Posts: 106
Joined: 06 Oct 2015, 22:12

Re: Looking for a little guidance on a couple of ESP-01 configurations.

#10 Post by Backbone » 11 Dec 2015, 07:40

i do not know how that mqtt stuff works.
it should work as you describe.
What happens in the esp interface is the correct status...........to work from. if they differ with openhab I have no idea.

Paco

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests