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

Send mqtt message

Hi,

I created a virtual button on android side.
My question : is it possible to send a mqtt message when i click on that button ?
i would like the standalone server to manage that mqtt message without using esp8266 level ?
thanks in advance

Not really.
Normally, you’d use something like Mosquitto and Node-Red on a local server, and the Blynk plug-in for Node-Red. In that situation, pressing a widget button attached to a virtual pin will allow you to send an MQTT message from Node-Red without the need for any additional hardware.

Pete.

thanks now node-red installed and plugin as well
Do you know which port is the webhook port of Blynk localserver ?

It’s all there in the help screen, assuming that you’re using the correct plugin…

Pete.

hi-again

here is the version : 0.0.3

Capture

blynk-websockets-client is grey , does it means that it is not installed ?

regards

That’s not the Blynk plugin that I use.

I would un-install that and install the node-red-contrib-blynk-ws version 1.04 instead.
This is available in the palette manager.

Pete.

If youre new to Node-Red then you might find this useful…

Pete.

do you have the same grey on your side for the client?

Yes, that’s to indicate that this isn’t a node that will appear in list of nodes on the left hand side of the screen because it’s the core background process for the contrib.

Pete.

ok good the last !
i did that kind of test

image

Try to click on a button (Virtual V0) on my android and receive information in the nodered debug window
but even if i received that kind of information in the node-red-cli when i click on the button

22 Oct 20:47:34 - [info] [blynk-ws-client:test] writeEvent: -> cmd {“type”:20,“typeString”:“HW”,“msgId”:21,“len”:6,“msgLength”:11,“body”:“vw\u00000\u00001”,“operation”:“vw”,“pin”:“0”,“value”:“1”,“array”:[“1”]}
22 Oct 20:47:34 - [info] [blynk-ws-client:test] writeEvent: -> cmd {“type”:20,“typeString”:“HW”,“msgId”:22,“len”:6,“msgLength”:11,“body”:“vw\u00000\u00000”,“operation”:“vw”,“pin”:“0”,“value”:“0”,“array”:[“0”]}

nothing appears in the nodered debug window

do you know why ?

ok i find the solution
i replaced “readevent” node with “writeevent” node and it is ok
thx

1 Like