Blynk Write Event and NodeRed

Have project with Blynk App on Android controlling some GPIO,s on SparkFun ESP8266 Thing - Dev Board connected to my WiFi. That project has been working great for 6 months. I also have a Raspberry Pi running Node-RED and Mosquitto MQTT Broker connected to my local network. All the nodes in the flow work except for Blynk Write Event. Not sure how to configure Blynk Write Event. Which URL should I use,Blynk cloud or local? The error on the node is disconnected. When I deploy that node is not properly configured. I am using Button virtual pin in the Blynk App project that connects to SF ESP8266. Do I have to create another project? Any help or direction would be greated appreciated.

Thanks Paul

1 Like

You don’t say if your Blynk project is on the cloud server or your own local server, but as you’ve not mentioned having a Blynk local server, I’ll assume that it’s on the cloud server.
In the Blynk Write Event node properties, create a new connection using the pencil icon at the side of the box that says “Add a new blynk-ws-client…”
Enter the Blynk Cloud URL and the Auth Code from your project on the phone…

Give this connection that’s the same as the one that you gave the device in the app project - this makes it easier in future. The best way is to copy and paste the auth code from the notification e-mail you received from Blynk, ensuring that you didn’t miss any characters or add any unwanted spaces.

That’s it - deploy the flow and it should say “connected to pin V…” at the bottom of the node.

A couple of things to remember though…
When you add a new Blynk node of any type it will assume that you want to use the same connection. This gets confusing if/when you add more devices, as each will have its own auth code and therefore it’s own connection in Node-Red. You will also need to choose the correct device in the widget properties in the app.

It’s nice and simple with just one device at both the app and Node-Red end, but requires the extra step of choosing the device in the app and the connection in Node-Red when you have more than one device in a project.

If you want to know more about using Node-Red and Blynk then you might find this helpful:

I’ll be adding another installment or two in the next week or so.

Pete.

Pete,

Thanks for the information, my Blynk project is on the cloud. This is the information configured for Write Event.(Not sure how to copy image of event node?)
Connection:blynk cloud server
Pencil info:
URL: ws://blynk-cloud.com/websockets
Auth Token from my Blynk project

Using Button Widget with Virtual PIn in App.
This is line of code from project: Blynk.begin(auth, ssid, pass, “blynk-cloud.com”, 80);
Plus my WiFi credentials:ssid,pass.

I have read your home automation project sveral times, great project and good information .
Write Event still shows disconnected.
Do I need to add “blynk-cloud.com”, 80); ?
Should I be using a Read Event? I tried but did not work.

Thanks Paul

If you have the correct URL, which is ws://blynk-cloud.com/websockets and the correct auth code then it should show as connected when you deploy the flow.

If it doesn’t then either you have the wrong Auth code, or your Raspberry Pi isn’t connecting to the internet. What happens if you ping blynk-cloud.com from your Raspberry Pi?

If you’re using Windows and want to take a screenshot then the best way is to use the Sniping Took to capture the area of the screen that you’re interested in.

If you want to send me a private message with your auth code, I can test it from my system.

Pete.

Pete,
I was able to ping blynk-cloud.com from Raspberry PI, you were correct about the auth code. I inadvertly included quotation marks. The node is now connected and everything works great! The Sniping Tool works great! I dragged the images (PNG) to this reply but they do not show correctly. I will have to work on that. Thank you very much and Happy Holidays.

Paul
image

1 Like

Good, glad you managed to get it working. It’s always good to have another Node-Red/MQTT/Blynk user joining us on the dark side!

Pete.

Pete,

Just getting started with NodeRed and MQTT. I got interested after reading your home automation project. Very powerful and great software. Hope to build small home automation project myself.

Thanks again

Paul

1 Like