[SOLVED] WidgetLED in Raspberry Pi2 iPhone Blynk App

Hello, This is my first time here on Blynk, I’m creating a project using Raspberry Pi2, Blynk iPhone App. I’m running blynk script using node. Everything is working fine except when I try to turn on LED using virtual pin on App using the following script. As soon I run the script with below line I’m getting error. How to turn on/off led widget using script in raspberry pi? Thank you for your help!

var vD1OpenLED = new blynk.WidgetLED(64);
^
TypeError: undefined is not a function
at Object. (/home/pi/GarageDoors.js:25:18)
at Module._compile (module.js:460:26)
at Object.Module._extensions…js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3

Hi. The led widget is not yet added to js library. I’ll add it soon and notify you :slight_smile:

Thank you!!

What other widgets that are still not supported in js library ?

Do you have examples for each widget in js that are currently supported ?

Thank you once again!

I’d like to bump this. Is there any documentation on how to use each widget in js? I’m completely new to nodejs but apart from the 1 example here https://github.com/vshymanskyy/blynk-library-js, I haven’t been able to find anything else.

You can use blynk.WidgetLED, just like blynk.VirtualPin.
it’s APi is described here: https://github.com/vshymanskyy/blynk-library-js/blob/master/blynk.js#L354

Thanks for that, that’s really useful. I tried to put it to use

var blynkLib = require('/usr/local/lib/node_modules/blynk-library'),

var AUTH = 'xxxxxxxxx';

var blynk = new blynkLib.Blynk(AUTH);

var v2 = new blynk.WidgetLED(2);   //power led

v2.turnOn();

I’m not sure what I’m doing wrong. The led does not light up on the app when I run the code.

We have the same problem, not work the WidgetLed when active it form Raspberry Pi.
We have tried this code, in the Virtual Pin 8

var v8 = new blynk.WidgetLED(8);
v8.setValue(255);

Here other alternatives tested, but none works…

var v8 = new blynk.WidgetLED(8);
v8.TurnOn

How we can to light up the led in the APP ??? Thanks

Is that cloud or local server?

Sorry, It´s in local server, running in a Raspberry Pi.

What app version and server version?

The APP is the last, 2.3 (16 May).

For server we use NodeJs, version v0.10.29

thanks :wink:

I mean Blynk server version.

We use the NodeJs in the Raspberry for connect to Blynk Server, in the cloud. I have not a Local Blynk server.
Sorry for the confusion.

Are ok. It could be a bug introduced in latest Blynk server - https://github.com/blynkkk/blynk-server/issues/207. Investigating.

Ok, thanks for all. I waiting the solution for check my project !!

Regards

HI friend. I have seen that you have closed the case https://github.com/blynkkk/blynk-server/issues/2075.

But WidgetLEd don´t work for me. Do you know where is the problem? Can you check it?

Regards

It is not so simple. Usual process is

make fix -> test fix -> deploy fix with many other changes.

It will take at least few days.

Ok, no problem.

Thank you so much.

HI Dmiitriy,
There are any news about this post? I checked it now, but still not work

Thanks

@FaramiR issue was fixed and deployed. Please show me your code you are using.