[SOLVED] WidgetLED in Raspberry Pi2 iPhone Blynk App

I declare the variable v8 like a WidgetLED

var v8 = new blynk.WidgetLED(8);

and I put it to 255 for turn On the led,no?

v8.setValue(255);

I also test:

v8.turnOn();
v8.turnOn(‘read’, function() { v8.write(255);});

We are use the NodeJS in Raspberry Pi 2, , but the led not work in the APP

@FaramiR is that full code? Does other widgets work?

what about this https://github.com/vshymanskyy/blynk-library-js/blob/master/examples/nodejs/client-tcp.js does it work for you?

I have 5 esp8266, connect at raspberry by web socket. All data is in the raspberry, and Blynk only has a project.
I parse all data in Blynk , for show the información in the APP.
I have temperatures and others float variables. All is working OK, but the booleans not turn on the leds widgets

You can see my test in v8 / v9 / v10

function convertVar(value){
if (value == 1){
return true;
}
else {
return false;
}
}

//////////////****** Variables BLYNK *********//////////
var v1 = new blynk.VirtualPin(1);//estacion.lumens
var v2 = new blynk.VirtualPin(2);//estacion.tempext
var v3 = new blynk.VirtualPin(3);//estacion.lluvia
var v4 = new blynk.VirtualPin(4);//server.lumens_sp
var v5 = new blynk.VirtualPin(5);//modulo_s1.tempint
var v6 = new blynk.VirtualPin(6);//modulo_s1.subida_status
var v7 = new blynk.VirtualPin(7);//modulo_s1.bajada_status
//var v8 = new blynk.VirtualPin(8);//modulo_s1.noche_status
var v8 = new blynk.WidgetLED(8);
var v9 = new blynk.WidgetLED(9);//modulo_s1.lluvia_status
var v10 = new blynk.WidgetLED(10);//modulo_s1.modo_status
var v11 = new blynk.VirtualPin(11);//modulo_s1.tiemposubida_sp
var v12 = new blynk.VirtualPin(12);//modulo_s1.tiempobajada_sp
var v13 = new blynk.VirtualPin(13);//modulo_s1.appsubir_cmd
var v14 = new blynk.VirtualPin(14);//modulo_s1.appbajar_cmd
var v15 = new blynk.VirtualPin(15);//modulo_s1.bajadahorario_cmd
var v16 = new blynk.VirtualPin(16);//modulo_s1.nosensorlux_cmd
var v17 = new blynk.VirtualPin(17);//modulo_s1.temp_cmd
var v18 = new blynk.VirtualPin(18);//server.bajartodo_cmd
var v19 = new blynk.VirtualPin(19);//server.subirtodo_cmd
var v20 = new blynk.VirtualPin(20);//modulo_s2.tempint
var v21 = new blynk.VirtualPin(21);//modulo_s2.subida_status
var v22 = new blynk.VirtualPin(22);//modulo_s2.bajada_status
var v23 = new blynk.VirtualPin(23);//modulo_s2.noche_status
var v24 = new blynk.VirtualPin(24);//modulo_s2.lluvia_status
var v25 = new blynk.VirtualPin(25);//modulo_s2.modo_status
var v26 = new blynk.VirtualPin(26);//modulo_s2.tiemposubida_sp
var v27 = new blynk.VirtualPin(27);//modulo_s2.tiempobajada_sp
var v28 = new blynk.VirtualPin(28);//modulo_s2.appsubir_cmd
var v29 = new blynk.VirtualPin(29);//modulo_s2.appbajar_cmd
var v30 = new blynk.VirtualPin(30);//modulo_s2.bajadahorario_cmd
var v31 = new blynk.VirtualPin(31);//modulo_s2.nosensorlux_cmd
var v32 = new blynk.VirtualPin(32);//modulo_s2.temp_cmd


//////////////****** Lecturas BLYNK *********//////////
v1.on('read', function() { v1.write(variables["estacion.lumens"]);});
v2.on('read', function() { v2.write(variables["estacion.tempext"] + " C");});
v3.on('read', function() { v3.write(variables["estacion.lluvia"]);});
v4.on('read', function() { v4.write(variables["server.lumens_sp"]);});
v5.on('read', function() { v5.write(variables["modulo_s1.tempint"] + " C");});
v6.on('read', function() { v6.write(variables["modulo_s1.subida_status"]);});
v7.on('read', function() { v7.write(variables["modulo_s1.bajada_status"]);});
v8.turnOn();
//v8.turnOn('read', function() { v8.write(variables["modulo_s1.noche_status"]);});
v9.turnOn('read', function() { v9.write(255);});
v10.setValue(180);
//v10.turnOff('read', function() { v10.write(variables["modulo_s1.modo_status"]);});
//v10.on('read', function() { v10.write(variables["modulo_s1.modo_status"]);});
v11.on('read', function() { v11.write(variables["modulo_s1.tiemposubida_sp"]);});
v12.on('read', function() { v12.write(variables["modulo_s1.tiempobajada_sp"]);});
v13.on('read', function() { v13.write(variables["modulo_s1.appsubir_cmd"]);});
v14.on('read', function() { v14.write(variables["modulo_s1.appbajar_cmd"]);});
v15.on('read', function() { v15.write(variables["modulo_s1.bajadahorario_cmd"]);});
v16.on('read', function() { v16.write(variables["modulo_s1.nosensorlux_cmd"]);});
v17.on('read', function() { v17.write(variables["modulo_s1.temp_cmd"] + " C");});
v18.on('read', function() { v18.write(variables["server.bajartodo_cmd"]);});
v19.on('read', function() { v19.write(variables["server.subirtodo_cmd"]);});
v20.on('read', function() { v20.write(variables["modulo_s2.tempint"] + " C");});
v21.on('read', function() { v21.write(variables["modulo_s2.subida_status"]);});
v22.on('read', function() { v22.write(variables["modulo_s2.bajada_status"]);});
v23.on('read', function() { v23.write(variables["modulo_s2.noche_status"]);});
v24.on('read', function() { v24.write(variables["modulo_s2.lluvia_status"]);});
v25.on('read', function() { v25.write(variables["modulo_s2.modo_status"]);});
v26.on('read', function() { v26.write(variables["modulo_s2.tiemposubida_sp"]);});
v27.on('read', function() { v27.write(variables["modulo_s2.tiempobajada_sp"]);});
v28.on('read', function() { v28.write(variables["modulo_s2.appsubir_cmd"]);});
v29.on('read', function() { v29.write(variables["modulo_s2.appbajar_cmd"]);});
v30.on('read', function() { v30.write(variables["modulo_s2.bajadahorario_cmd"]);});
v31.on('read', function() { v31.write(variables["modulo_s2.nosensorlux_cmd"]);});
v32.on('read', function() { v32.write(variables["modulo_s2.temp_cmd"]);});

Yes, it work for me. All is OK, less the Widget LED

Hi, i have the same problem. I work with a Raspberry Pi and NodeJS… and IOS 9 with an iPhone 6.

#!/usr/bin/env node

var Blynk = require('/home/pi/node_modules/blynk-library-js');

var AUTH = '********'; 

var blynk = new Blynk.Blynk(AUTH, options = {
  connector : new Blynk.TcpClient()
});

var v1 = new blynk.VirtualPin(1);
var v2 = new blynk.VirtualPin(2);
var v8 = new blynk.WidgetLED(8);
var v9 = new blynk.WidgetLED(9);

v1.on('write', function(param) {
  console.log('V1:', param);
});
v2.write(255);
v8.turnOn();
v9.setValue(255);


blynk.on('connect', function() { console.log("Blynk ready."); });
blynk.on('disconnect', function() { console.log("DISCONNECT"); });

**** I tried with all components and works well with everyone except with LED … :cry:
Thanks in advance!!!

@vshymanskyy please have a look.

Please try this code:

#!/usr/bin/env node

var Blynk = require('/home/pi/node_modules/blynk-library-js');

var AUTH = '********'; 

var blynk = new Blynk.Blynk(AUTH, options = {
  connector : new Blynk.TcpClient()
});

var v1 = new blynk.VirtualPin(1);
var v2 = new blynk.VirtualPin(2);
var v8 = new blynk.WidgetLED(8);
var v9 = new blynk.WidgetLED(9);

v1.on('write', function(param) {
  console.log('V1:', param);
});

blynk.on('connect', function() {
  console.log("Blynk ready.");
  v2.write(255);
  v8.turnOn();
  v9.setValue(255);
});
blynk.on('disconnect', function() { console.log("DISCONNECT"); });

You can only send commands when connected…

Works, thank you very much !!!

I what editor o program do you use that ?