Switch

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
journeyman
Normal user
Posts: 14
Joined: 06 Dec 2016, 22:03

Switch

#1 Post by journeyman » 16 Jun 2017, 16:36

Hello,

Im trying to use some gpio as swich by connecting a switch between ground and the GPIO pin. Its working but when the swich is setted on douring the esp restert - module is not waking up till i didnt disconnect the swich. What is wrong?

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Switch

#2 Post by Shardan » 16 Jun 2017, 16:57

journeyman wrote: 16 Jun 2017, 16:36 Hello,

Im trying to use some gpio as swich by connecting a switch between ground and the GPIO pin. Its working but when the swich is setted on douring the esp restert - module is not waking up till i didnt disconnect the swich. What is wrong?
Please give some more info.
Which Pins/GPIOs do you use? Which ESP?

Not every GPIO is a GPIO only. Some are used to switch the startup behavior to boot mode or starting from SD-card (Not used with ESPEasy atm).
Obviously these pins must have a defined level at startup.

Regards
Shardan
Regards
Shardan

journeyman
Normal user
Posts: 14
Joined: 06 Dec 2016, 22:03

Re: Switch

#3 Post by journeyman » 16 Jun 2017, 17:06

Shardan wrote: 16 Jun 2017, 16:57
Not every GPIO is a GPIO only. Some are used to switch the startup behavior to boot mode or starting from SD-card (Not used with ESPEasy atm).
Obviously these pins must have a defined level at startup.

Regards
Shardan

I Tryied with TX (GPIO 01), GPIO02,

on GPIO 15 its waking up but swich is not working.

Now I foundout that is working fine on GPIO12.

So which else of GPIO can be grounded on boot to avoid this issues?

Its ESP-12 (NodeMcu)

randytsuch
Normal user
Posts: 33
Joined: 05 Jun 2017, 05:32

Re: Switch

#4 Post by randytsuch » 16 Jun 2017, 17:23

GPIO0 and GPIO2 have to be high (they are pulled up internally) and GPIO15 has to be low at boot up.

I try not to use GPIO15, and am only using GPIO0 and 2 as inputs that are normally high right now to get around this.

Randy

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Switch

#5 Post by Shardan » 16 Jun 2017, 17:30

Some rules for that in general:

GPIO0:
Must be "1" ("high") on boot but can be used as output from ESPEasy.
Input is possible but be aware that input is "high" when booting.
If set to "0" ("low") on boot, ESP8266 starts in flash mode.

GPIO 1 / GPIO3:
Serial port in ESPEasy must be deactivated.
On bootup some signals will come out from TxD anyways so a relay might "flicker".

GPIO2:
Must be "1" ("high") on boot but can be used as output from ESPEasy.
Input is possible but be aware that input is "high" when booting.

GPIO4 & GPIO5
Can be used as input/output. These GPIOs are used for I²C as standard configuration.

GPIO9:
Used for external memory/SPI - DO NOT USE!
Using GPIO9 will crash the ESP into a reboot loop.

GPIO10:
Used for external memory/SPI - USE WITH CARE!

GPIOs 12,13,14
Can be used as IO.

GPIO15:
Must be "0" ("low") on boot but can be used as output from ESPEasy.
Input is possible but be aware that input is "low" when booting.

GPIO16
can be used as IO - used for wakeup-signal for sleepmode (hardcoded in the chip, can not be altered).


For extending GPIO's if needed there are several possibilities.
The PCF8574 gives 8 additional GPIOs. It uses I²C so several of these extenders can be chained.
Another possibility is the MCP23017.

A very versatile solution is the ProMini Extender, based on an Arduino ProMini,
but it needs more preparations as you have to compile and load the firmware first.
It provides several digital GPIO's, analog inputs and PWM.

Regards
Shardan
Last edited by Shardan on 16 Jun 2017, 22:04, edited 2 times in total.
Regards
Shardan

journeyman
Normal user
Posts: 14
Joined: 06 Dec 2016, 22:03

Re: Switch

#6 Post by journeyman » 16 Jun 2017, 18:42

Thank you!

Its very usefull! and I think that shuld be in Wiki ;)

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Switch

#7 Post by grovkillen » 16 Jun 2017, 18:55

journeyman wrote: 16 Jun 2017, 18:42 Thank you!

Its very usefull! and I think that shuld be in Wiki ;)
It's been there for the last month.

https://www.letscontrolit.com/wiki/inde ... figuration
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 3 guests