Help with button command on relay

you should begin using virtual pins, and do not use digital pins anymore from the app, it is quite lame stuff. you can write much better / robust code with virtual pins.

All code does something and what you have is bad code, remove it.

@wanek I think for now the OP should kick off with physical pins until they know a bit more coding and how ESP’s work. Then they can advance to the more complex and more powerful virtual pins.

Arduino said:
" Downloading ‘https://raw.githubusercontent.com/blynkkk/blynk-library/master/library.properties
… done.
Latest version: 0.5.0"

At this moment I’m so confused:

Nothing work!!!

after ESP power on, at 5 or 6 seconds, ALL relay is ON

I revert to initial settings and same, all relays is ON… maibe it is too late for work: 4am…

For the most common relays, active LOW, and safe pins that is the default for ESP’s.

It will also be the default when Blynk issues the next default for any widgets tied to digital pins.

You need to use digitalWrite() properly and virtualSync() if you don’t want pins to be LOW after the ESP boots.

ok, after a short private conversation with the op, it is clear he has some problems with the lib sructure also. he will open a topic on the romanian forum, as he has some difficulties with english.

at least, this is what i’ve suggested :slight_smile:

1 Like

@Costas, @wanek, appreciate your response and attempts to make me understand how Blynk works and digital outputs, but what I do not understand is: why if two digitally buttons have worked well, then it does not work anymore.

And if it is as you say, use additional code lines, then in Blynk presentation should NOT write “Direct pin manipulation with no code writing”. :slight_smile:

I was excited about the ease of using this application, being ignorant of programming languages, and as a mediocre user of arduino, but it starts to pass me :slight_smile:

I understand Blynk’s work and I will try to study, and I hope to clarify certain things.

the issue can be multiple:

  • bad library structre (this is for sure based on the pm)
  • defective jumper wire between mcu / relay boards
  • defective relay board
  • etc

as i suggested, please open a new topic on the romanian section, if you wish, or we can continue here. just do not cross post.

@mircea there is a bug in 0.5.0 relating to digital pins whereby the library was not iterating through a pinMode() loop that should set all pins LOW for widgets tied to digital pins. The bug is fixed in the master copy of the library and will be available in the next library update.

It’s not Blynk’s problem that most relays were designed to be active LOW and therefore will be ON when the ESP boots up.

I never say this… I understand this think well. I is my job to try many inputs, depending on hardware,no problem.

Thanks to @wanek, project go to the right direction. :+1:

I added right code line, in right place and everything works fine. Also help me to have updated applications (Blynk and Arduino).

From now on the sun shines on my street :sunny:

1 Like