Advanced Warning - next library update will send ESP pins low on bootup

Edit by @Costas the next library update will fix an issue affecting ESP’s when you use direct pin access i.e. when you are not using Virtual pins. If you don’t want to read the thread just click this link for the details Advanced Warning - next library update will send ESP pins low on bootup

Hello blynkers,

first of all i love blynk. I just discovered it and it handles so many thing for me in just one solution (dyndns, authentication, ui,…)

I am currently running a nodemcu connected to a double relay board using GPIO 4 and 5 to control it. I have a reduced UI only featuring 2 push buttons and a stream from my webcam.

In normal operation everything works great, but after a power loss I noticed that one of the relay was permanently pulled up. When I press the corresponding button once and release it also the relay goes off.

So I removed the button and added a new one and now guess what the other relay does…

I also noticed that when no app is connected (app is in stop mode [top right corner]) there is no problem, but as soon as i hit play the relay pulls up (as mentioned only after power loss).

Always the relay connected to the button created first (doesn’t matter how many buttons I have) pulls up.

I think this might be a bug.

BTW: i tried different GPIOs and digitalwrite already but as mentioned as long as no app is connected there is no issue so its most likely not a hardware thing.

Below “my” code:

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "xxxxxx";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "xxxx";
char pass[] = "xxxx";

void setup()
{
  // Debug console
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
}

void loop()
{
  Blynk.run();
}

thanks for your support

It’s not a bug, you should use Search option, this issue is covered with at least 10 different topics. You should use virtual pins and set relay states, you can also use Blynk.syncall() to sync the relay state with button state in your app after boot.

Hi zodiac, thanks for your answer. I did use the search function and I did read at least 4 of the 10. And it is not exactly the same issue and I am using virtual pins as work around.

But that’s not what blynk is all about. If I would like to use a lot of code and work arounds I’d not use blynk.

There is the option to use gipos directly and either it should be in the documentation that the status is “random” at boot which makes it useless for many applications or it is a bug.

So I kindly ask for blynk to fix it or tell me if I did something wrong or document the features of the direct use of gpio.

There is an option to use GPIO pins directly, but then it will act exactly like it’s acting now, one of them will go high on boot. So if you want to avoid that, use virtual pins and proper code. There is no other way to solve this issue, and there is nothing that Blynk should fix there. Blynk is not codeless platform, so use the code, all cases are very well covered by documentation.

Only certain ESP8266 GPIO’s go HIGH on reboot. Just test which ones or use an Arduino when none of them go HIGH.

No, one will always go high on boot. No matter which ESP you are using, or what GPIO you are addressing, Blynk app will pull it up on boot. I’ve checked that out. Virtual pins are the only way to go with ESP and Blynk.

Virtual pins ARE a Blynk invention and primary process… NOT a workaround :stuck_out_tongue_winking_eye:

As for what Blynk is about… don’t make such hasty assumptions. Blynk is an IoT application that provides a GUI and ease of communication between you and your IoT hardware. Yes, that can be done to a limited level without much coding, but that is really only for getting your feet wet, so to speak, or for less complicated projects.

If you really want to see your Blynk projects shine, you will need to learn how to use all those “coding” commands and Virtual pins that Blynk took all that time to create and document. Now, why do YOU think they did all that if it is “just” a workaround? :thinking:

The developers always read these posts… so, if they feel that you have found an issue, then they will get involved.

As for your issues… I don’t find you post very clear as to the precise nature of said issue.

ESP devices have known situations where various pins boot HIGH.

Or perhaps some of your App’s button states are being activated upon App start for a logical reason, etc…

If you have truly read through all the documentation, and much of the forum, and have updated to all the current versions of Library and App, and still see a reproducible “issue” then please clearly document and provide App settings of such, so others can try to duplicate it.

1 Like

I have changed the category to issues and errors based on your comment.

GPIO 4 and 5 are both “safe” pins AFAIK.

I have noticed some strange entries right at the end of some project listings shown in the API regarding pin status.

@Georg1811 Please don’t put your topic in Issues and Errors, because we are not speaking of bug here. I’ve already changed category to Help with your projects, so if you really want help, it should be in right category. Reporting non-existing bugs would not help for sure.

Like the other guys say if you want to build a decent project then you will need to use virtual pins (and code). Some widgets only work with virtual pins. If you are looking at a fairly basic project you don’t need to do any coding.

1 Like

that was me as per one of my earlier comments. it smells like a bug to me.

I have tried all possible combinations, one will go high no matter what. And I gave up on using GPIO pins directly because of that, it’s much easier to set relay state, use virtual pins and sync, and there is no problem at all.

You just confirmed the bug.

Yes, I can see… Sorry, @Georg1811, my bad.

Well this ‘bug’ exists for at least last 6-7 months, so I didn’t consider it to be a bug at all. You learned me that using virtual pins is much safer, and that’s definitely truth.

Virtual pins are far superior to physical pins for coders but the OP doesn’t want to code.

Me neither. And I ended up with 400k of code :slight_smile:

2 Likes

Thank you all for your answers. As said by Costas I was looking for a looking at a fairly basic project.

The only thing i wanted to do is use one button to control one relay with a nodemcu.

Sounds basic to me. I just discovered that after boot one pin (and i tried GPIO 4, 5, 12, 13, 14) goes high when the blynkapp connects. (reproduce able)

I did solve it myself by using virtual pins which are by far superior. So I didn’t need help with my project.

But to let the developers know i posted it in Issues and Errors. I am sorry if I didn’t describe the problem enough to make it reproduce able.

So if it is not a bug it is solved.

1 Like

@Georg1811 with no real coding i.e. not even pinMode() my ESP (WeMos D1 Mini) and without Blynk the pin status on bootup is shown as:

 0: 1
 2: 1
 4: 1
 5: 1
12: 1
13: 1
14: 1
15: 0
16: 0

So if I wanted a couple of relays to be off on bootup with Blynk I would pick GPIO 15 and 16. 16 is not ideal as it’s part of the deepSleep() function.

I initially added 2 buttons to Blynk in switch mode on GPIO 15 and 16.

They do exactly what I would expect i.e. same as without Blynk on reboot and then high and low when the Blynk buttons are pressed.

I then added 2 more (GPIO 4 and 5) and they work fine too.

Obviously digital pins have the limitation that the Blynk state isn’t remembered between reboots, hence the need for virtual pins or code to store state in EEPROM etc.

I’m not a big user of relays directly attached to MCU’s and I suppose they could give different results but all looks to be working fine here.

Please advise if you have different results.

Hi Costas, thank you for your efforts. What I don’t get is why only one relay pulls up.

It is always the one with the button created first.
I tried with 4 relays and it’s only one and it doesn’t matter which pin it is connected to. They even change.

Example:

I created 4 push buttons:
Button 1 - GPIO4
Button 2 - GPIO5
Button 3 - GPIO12
Button 4 - GPIO13

When I boot up all relays are off.
When I connect the app (play button top right corner) the relay on GPIO 4 pulls up.
When I press the button once the relay goes off again.

I deleted Button 1 and created it again and pull the plug of the psu.

Now, when I connect the app the relay on GPIO 5 pulls up and so on…

but if it is not reproduce able with WeMos it might be a nodemcu issue only.

Thanks