I am using the default example code in blynk and as soon as my esp8266 connects to WiFi the gpio4 is pulled low while other pins remain high this is very irritating pls help
You’ll need to give us a few clues…
What flavour of ESP8266?
Exactly which example code?
When you say GPIO4, do you really mean GPIO4, or the pin labelled D4?
How are you establishing that GPIO4 is low and all others are high?
What version of the Blynk library, ESP Core and app (and which OS - Android or iOS) are you using?
Pete.
This information may be useful. Describes GPIO behavior on startup.
http://rabbithole.wwwdotorg.org/2017/03/28/esp8266-gpio.html
One of our regulars made a nice at-a-glance chart of an ESP8266 GPIO boot state. I forgot the link, but keep the chart handy.
Clearly shows that GPIO4 normally boots LOW… topic solved
Thx but is there anything that I can do after booting should I digital write the pin high??
Nodemcu v0.9
Node MCU example code in boards WiFi in bunk library
I mean gpio4
I have attached a relay module which turns on on being pulled low
Blynk library’s 5.4
Espcore2.4.2
Android
That is typically how it is done, but don’t forget to declare it as an output first.
Also after updating my blynk library when the board connects to internet all pins are getting pulled low
Thx
That makes much more sense than just one pin being pulled low at startup, which is why I asked how you’d established that it was just one pin.
In void setup just declare the pinMode as OUTPUT, then set it to HIGH.
Pete.
Thx
As soon as I launch my project button attached to gpio4 turns on that represents low state of the pin u should give a choice to whether when the project is launched the button is turned on or off
Blynk library v5.4
Nodemcuv0.9
Espcore 2.4.2
Example code boards WiFi/nodemcu
Well, in effect you are given this option, by swapping the 0/1 for a 1/0 and swapping ON/OFF for OFF/ON
Pete.
I didn’t mean this I have swapped 1 with 0 and 0 with one but the button turns on ( becomes coloured to be precise )
https://drive.google.com/file/d/1v-Q0Zsro-iP-cr60HMiH54u2piw3pfnG/view?usp=drivesdk watch this for understanding better
can u post your full code please
Difficult to understand what the video is showing, as the device appears to be offline.
If you want to overcome that then use virtual pins.
Pete.
See the button at the bottom as soon as I launch my project it turns on doesn’t matter if device is online or not and pls explain how to use Virtual pins
Search the forum, or look at some of the sketch builder examples.
Pete.
but what about the problem that only one switch turns on by itself and others dont
It may have something to do with the App Preview you created and linked to the project. Try erasing the App Preview located in My Apps.
I would not create an App preview until you have finished the project, and got everything working as it should.