Understanding node-red-contrib-blynk-websockets

Hi All.
I’m playing with node-red-contrib-blynk-websockets and a Arduino MKR. I have a question.

If I inject for example a number to a virtual pin from node-red, this value will be send to app, to arduino or to the two at same time?

I need switch on-off a output directly from node-red, without app.

Regards,

Jaume Nogues
rPrim Tech School
Barcelona

the Node-red websockets will send it to both , The app and your hardware - Arduino MKR - in same time.

Try this flow:

[{"id":"1cc59b92.2d3664","type":"inject","z":"22ab1451.c65d5c","name":"On","topic":"","payload":"1","payloadType":"str","repeat":"","crontab":"","once":false,"x":470,"y":340,"wires":[["5d68415.851e1c"]]},{"id":"f657eef2.03214","type":"inject","z":"22ab1451.c65d5c","name":"Off","topic":"","payload":"0","payloadType":"str","repeat":"","crontab":"","once":false,"x":470,"y":420,"wires":[["5d68415.851e1c"]]},{"id":"5d68415.851e1c","type":"blynk-websockets-out-write","z":"22ab1451.c65d5c","name":"","pin":"1","client":"2fa4f650.84b19a","x":660,"y":380,"wires":[]},{"id":"2fa4f650.84b19a","type":"blynk-websockets-client","z":"","name":"Test","path":"ws://YOUR_SERVER(local, blynk):8082/websockets","key":"YOUR_BLYNK_KEY"}]

You need to inject string value to project virtual port. This value will be send to mobile application and also to connected hardware. But after some checks, this value is transmitted only to app and no to the hardware. Maybe I’ve something wrong.

EDIT: There is need to sync data on HW side.

Hi Fisero,

I need help how to use button on node red to switch on / off virtual Pin

Thanks

mef

Use flow I’ve posted before, import it:
Update blnyk connection and then click on blue squers on injects nodes.

This is my flow
[{“id”:“ccc78c3d.b1c46”,“type”:“inject”,“z”:“ea506f02.55213”,“name”:“On”,“topic”:"",“payload”:“1”,“payloadType”:“str”,“repeat”:"",“crontab”:"",“once”:false,“x”:270,“y”:126,“wires”:[[“56bab128.19766”]]},{“id”:“cb4140a0.27a7f”,“type”:“inject”,“z”:“ea506f02.55213”,“name”:“Off”,“topic”:"",“payload”:“0”,“payloadType”:“str”,“repeat”:"",“crontab”:"",“once”:false,“x”:270,“y”:206,“wires”:[[“56bab128.19766”]]},{“id”:“56bab128.19766”,“type”:“blynk-websockets-out-write”,“z”:“ea506f02.55213”,“name”:"",“pin”:“22”,“client”:“54b96cd1.f23f04”,“x”:460,“y”:166,“wires”:[]},{“id”:“54b96cd1.f23f04”,“type”:“blynk-websockets-client”,“z”:"",“name”:“WASISTech InspireOne”,“path”:“ws://blynk-cloud.com:8082/websockets”,“key”:“mytokenkey”}]

button on Blynk android app is on but it is not trigering BLYNK_WRITE(V22).


Thanks for your help.

HW is not triggered by changes coming from node-red via websocket. I’ve found this problem last week too. Resolution is using Syncing. In HW I’ve implemented function like this which is periodically triggered (by timer etc.):

MyTimerHandler(){  
    Blynk.syncVirtual(V22);
}

Okay thanks a lot for your help.

cheer

mef