BLYNK
BLYNK.IO       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Set Propertys of an buttton with a Digital pin

I was making a projekt with a GUI and after finishing the GUI I was finding Bylnk,
and think “It’s perfect for my projekt”.

PS:Arduino has possibility for a GUI.

NodeMCU or ESP32 would be my choice, using the C++ library.
Also, you should use the new version of Blynk, as the version you are using will be retired soon.

Pete.

I cant use them because:

  1. My projekt needs an graphical interface.
  2. I want to use python and linux.
  3. It isn’t a only blynk project (I was using Blynk to deaktivate a alarm).

Well, most people use Blynk as their UI, but you can also run a webserver if you wish.

Pete.

Actualy I am trying to use blynk and the raspberry pi for output(so they do the same).

You should probably explain exactly what it is that you’re trying to achieve, because your one line cryptic comments aren’t helping us to help you.

Pete.

Forgot wat i sayd:
Actualy I am trying to use blynk and the raspberry pi for output(so they do the same).

I am trying to (de)akivate a alarm with two buttons.
If i press one button (in push mode) it should turn red and the other ones white.
(So I know what state the alarm has)

Because I dont know (and nobody explayns) how to read a virtuel pin.
So do I use a Digital Pin but I dont know how to change propertys of an widget
with a Digital Pin.

I don’t understand what this means.
Are you saying that the RPInhas a screen attached and you need to display the same data on it as the Blynk app?

Or are you simply wanting to use Blynk to control the GPIOs on the Pi?

Pete.

help

You won’t get any useable help unless you explain in clear, understandable terms, exactly what it is that you’re trying to achieve with your project.

Saying “forget what I said” and “ignore what I said” results in people doing exactly that!

Pete.

Ok I need help by this,

I am trying to (de)akivate a alarm with two buttons.
If i press one button (in push mode) it should turn red and the other ones white.
(So I know what state the alarm has)

Because I dont know (and nobody explayns) how to read a virtuel pin.
So do I use a Digital Pin but I dont know how to change propertys of an widget
with a Digital Pin.

And It makes errors wenn I make (NameError: Name V2 is not defined or something)

‘blynk.set_property(V2, “offBackColor”, “#000000”)’

I am back tommorow,
It’s late (Where I live).

You’re trying to program a Pi, using Python, so C++ syntax won’t work.

As I’ve said before, the Pi is an awful choice of MCU for most Blynk projects. They are expensive, require an operating system to be installed, are slow to boot, need beefy power supply and are extremely hard on SD cards (which leads to failures in the long term).

I’ve suggested an alternative, much simpler MCU which is cheaper, doesn’t need an SD card, has lower power consumption and can be programmed in C++
In response, you’ve made some cryptic comments about requiring a graphical UI, but you won’t elaborate on that - so it’s impossible to know what sort of MCU is really required.

I certainly can’t help you any further unless you elaborate on the UI side of the project requirement.

Pete.

1 Like

@Doom_guy Old Blynk Python support was very basic, but here is what you need to look at to figure it out…

As far as I recall with RPi/Python/Blynk there was no direct GPIO control, all that is done with vPins and whatever Python GPIO library you chose to use.

Instructions are minimal, and there are some limited examples in the Blynk Python library. But nothing I could see on how to properly use set_property so you will have to look into the library and compare/extrapolate it for yourself.

image

New Blynk Python is still pending…

1 Like

OK, looks like you may have been close…

As in other examples, try without the V

blynk.set_property(2, "offBackColor", "#000000")

Hello,
It works with only an number (but I did it already).
But there are only vituel pins included, I need Digital pins.

PS: Please stop saying Arduino (MCU) is better than a raspberry pi.

Arduino’s are an awful choice of board in my opinion, and if you re-read what I wrote you’ll see that I suggested a NodeMCU or ESP32, neither of which are made by Arduino.

It seems that what you are trying to achieve with your combination of hardware, programming language and digital pins isn’t achievable. You’ll need to change at least one of those choices to achieve the result you require.

But’ as you clearly aren’t interested in my thoughts on the matter I’ll bow-out and leave you to it.

Good lick with your project.

Pete.

Ok,

But then can someone tell me how to read virtuel pins in python blynklib.

It is in the library examples I already posted above. Particularly

You can also try searching this forum for Python examples, but there are very few.

1 Like