Wemos d1 mini wont boot when GPIO 0(D3) and GND(G) are connected

2,930 views
Skip to first unread message

Peter Andersson

unread,
Jul 9, 2018, 4:33:45 PM7/9/18
to SonoffUsers
Hi i posted a question here before, there i was told to connect the switch between GPIO 0(D3) and GND(G), but if the switch allows power to pass while booting the wemos d1 min wont boot.

Does any one have a idea what is wrong?


Philip Knowles

unread,
Jul 9, 2018, 4:37:27 PM7/9/18
to Peter Andersson, SonoffUsers

If GPIO0 is connected to ground on boot the ESP8266 goes into flash mode. GPIO0 will toggle the output so you can use a momentary switch which would solve the problem.

Regards

Phil


On Jul 9, 2018 9:33 PM, "Peter Andersson" <pet...@gmail.com> wrote:
Hi i posted a question here before, there i was told to connect the switch between GPIO 0(D3) and GND(G), but if the switch allows power to pass while booting the wemos d1 min wont boot.

Does any one have a idea what is wrong?


--
You received this message because you are subscribed to the Google Groups "SonoffUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peter Andersson

unread,
Jul 9, 2018, 4:40:29 PM7/9/18
to sonof...@googlegroups.com
im using a float switch that allows current to pass depending on the water level in a tank, sadly i have no way of turning it off while booting.
I also tried to use GPIO 2 (D4) but same result.


On Monday, July 9, 2018 at 10:37:27 PM UTC+2, Philip Knowles wrote:

If GPIO0 is connected to ground on boot the ESP8266 goes into flash mode. GPIO0 will toggle the output so you can use a momentary switch which would solve the problem.

Regards

Phil

On Jul 9, 2018 9:33 PM, "Peter Andersson" <pet...@gmail.com> wrote:
Hi i posted a question here before, there i was told to connect the switch between GPIO 0(D3) and GND(G), but if the switch allows power to pass while booting the wemos d1 min wont boot.

Does any one have a idea what is wrong?


--
You received this message because you are subscribed to the Google Groups "SonoffUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.

Philip Knowles

unread,
Jul 9, 2018, 5:01:02 PM7/9/18
to Peter Andersson, SonoffUsers

So when the float is up the contact is closed? Is connected directly from GPIO1 to ground without a pull up resistor? If not try a 4k7 resistor between ground and GPIO1 and connect the float switch between Vcc and GPIO1. GPIO1 now won't 'float' and will be high when float switch is closed and go low when open. Not sure it will fix it but worth a try


On Jul 9, 2018 9:40 PM, "Peter Andersson" <pet...@gmail.com> wrote:
im using a float switch that allows current to pass depending on the water level in a tank, sadly i have no way of turning it off while booting.
I also tried to use GPIO 1 (D4) but same result.


On Monday, July 9, 2018 at 10:37:27 PM UTC+2, Philip Knowles wrote:

If GPIO0 is connected to ground on boot the ESP8266 goes into flash mode. GPIO0 will toggle the output so you can use a momentary switch which would solve the problem.

Regards

Phil


On Jul 9, 2018 9:33 PM, "Peter Andersson" <pet...@gmail.com> wrote:
Hi i posted a question here before, there i was told to connect the switch between GPIO 0(D3) and GND(G), but if the switch allows power to pass while booting the wemos d1 min wont boot.

Does any one have a idea what is wrong?


--
You received this message because you are subscribed to the Google Groups "SonoffUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "SonoffUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers+unsubscribe@googlegroups.com.

Peter Andersson

unread,
Jul 9, 2018, 5:12:36 PM7/9/18
to SonoffUsers
There seems to be no GPIO1?
I was testing with 0 and 2 it seems.. but 2 gave the same result as 0.

Philip Knowles

unread,
Jul 9, 2018, 5:35:49 PM7/9/18
to Peter Andersson, SonoffUsers

That explains it. GPIO0 and GPIO2 need a pull up resistor to boot properly if being used with switches


To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers+unsubscribe@googlegroups.com.

Philip Knowles

unread,
Jul 9, 2018, 5:48:07 PM7/9/18
to Peter Andersson, SonoffUsers

If you have access to Rx you could try the option quite a way down this page http://www.forward.com.au/pfod/ESP8266/GPIOpins/ESP8266_01_pin_magic.html
I've used it before

Peter Andersson

unread,
Jul 10, 2018, 2:40:39 AM7/10/18
to SonoffUsers
I'm quite new to electronics what does it entail to to use the Rx?

Peter Andersson

unread,
Jul 10, 2018, 2:41:41 AM7/10/18
to SonoffUsers
According to the page i linked both GPIO0 and GPIO2 already have pull up resistors? (10k Pull-up)

Philip Knowles

unread,
Jul 10, 2018, 3:32:37 AM7/10/18
to Peter Andersson, SonoffUsers

To boot properly both GPIO 0 and 2 need to be high. GPIO 0 if held low when GPIO 2 is high at boot will make the ESP8266 go into flash mode. I suspect that your float switch is pulling GPIO 0 down on boot. The pull up resistor only works when the float switch is open - it pulls GPIO 0 to Vcc - when the float switch closes it pulls GPIO 0 to ground.
Electronically, using Rx is the same as using GPIO - pull up resistor etc but you need to change some options in the Sonoff before compiling to tell it to use Rx as input. I don't have the info to hand but the basics were in the link.
Using GPIO 2 is the easier option. If you ensure that GPIO 0 is always high (pull up resistor to Vcc) GPIO 2 is less likely to be a problem. I would look at the 'normal' position of the float switch too though. If most of the time the switch is at maximum level, if it's a NC contact put switch between Vcc and GPIO 2 and the resistor between GPIO 2 and ground. That will keep GPIO2 high. If it's a NO contact resistor should be between Vcc and GPIO 2 and switch between GPIO2 and ground. I think you originally said it was about pumping rainwater so the 'normal' position is with the float down. In which case it's the opposite of above. That should ensure that over 90% of time you get a clean boot. You're just trying to make sure GPIO2 is high most of the time. You may need to look at your switching logic though to make sure the output does what you want.


To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers+unsubscribe@googlegroups.com.

Peter Andersson

unread,
Jul 10, 2018, 5:29:28 AM7/10/18
to SonoffUsers
If we ponder that there is water in the tank when the wemos d1 reboots then everything should be fine, as the floatswitch is installed so that it does not allow current to flow when there is water.
But it seems like this is a major limitation in the design of this chip... if you can't control the value of GPIO0 on boot you have no control if it boots correctly or not..
Are there similar issues with the other GPIO's? or could i use one of them instead?

Philip Knowles

unread,
Jul 10, 2018, 1:48:27 PM7/10/18
to Peter Andersson, SonoffUsers

It's only GPIO 0 and 2 the problem is the limited number of GPIOs which are easily available on some devices. Rx and Tx are always available which is why I suggested  using Rx.


To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages