I have an arduino uno R3, and a raspberry pi with a sensehat mounted on it. The arduino has 2 sensors on it, a DHT22 sensor, and a Grove Temperature Sensor V1.2.The arduino is connected to the Raspberry Pi serially.
As you can see, data is sent from the arduino and the raspberry pi’s sensehat into influxdb. Grafana then pulls data from influxdb when needed, and is used to visualise the data.
Recently, my project requirements had changed, and it is an absolute MUST for me to use Blynk in this project. Hence, I want to integrate blynk into my current workflow somehow.
I want to be able to plot values sent from my sensors onto the blynk dashboard, but I am new to blynk and have no idea how to.
I have 2 questions:
Is it possible to get blynk to pull data directly from influxdb? I haven’t been able to find documentation for this yet.
If 1) is not possible, how do I modify my node-red workflow to include writing data to blynk? I am somewhat clueless, as the documentation that I could find did not help me.
First of all, are you planning on spending $99 per month on a Blynk subscription?
If not, then you’ll probably be using a free Blynk subscription, which limits you to 30,000 data points every 30 days, or about one data point every 1.5 minutes. This is the total across all datastreams, so if you had two data sources you wanted to plot then it would be one update every 3 minutes maximum.
No, you’d need to push the data to Blynk.
The simplest way would be with the Blynk IoT contrib for Node-Red, although you could also use Blynk’s new MQTT functionality.
Hi Pete, thanks for your timely and helpful response.
I did not know about the limits of blynk’s free tier, and I am not willing to spend money for a subscription.
However, I currently have 7 different values that I would like to plot (which I assume are datastreams). Each value is also being updated every 1s too. This will definitely be more than 30,000 messages per month.
I’ve managed to create a local blynk server on my raspberry pi using IOTstack (which i already was using for my previous workflow).
Currently I am facing some trouble relating to the authentication token.
Basically, I am not sure how to link my raspberry pi to a device on the blynk local server. Every source that I can find online talks about uploading a sketch to the device, but I am not sure how I can upload a sketch onto the raspberrypi.
The questions I have now are:
How do I link my raspberry pi to a device?
Does the local server have any sort of drawback or complications that I am not aware of?
The Blynk local server you’ve installed uses Blynk legacy, not Blynk IoT.
Blynk legacy is discontinued and unsupported, and is a totally separate entity to Blynk IoT. It uses a different app, which is no longer available in the app/play stores.
It is potentially possible, if you’re using an Android device, to find an old APK file and access the Legacy app that way, but the app may not be supported on modern phones running current versions of Android.
The last few releases of the Legacy app were crippled to prevent new user accounts being created, which is something you’d need to be able to do if starting from scratch like you are.
The Blynk IoT contrib for Node-Red won’t work for Blynk Legacy, and Blynk Legacy has no MQTT support.
Although there are undoubtedly some people still running Blynk Legacy local server, it’s going to be extremely difficult for you to get started with a Legacy installation at this point. It’s made more complex because Gmail and Google messaging services - which are used by the Legacy server, have changed their protocols and the Legacy server code has not been updated to support these changes. It hasn’t been updated to run on the latest versions of Java, or to fix security vulnerabilities either.
Hi Pete, greatly appreciate your informative response.
Thanks to your last reply, I now understand that Blynk local server is not a viable option, so I will have to use the cloud server.
I know that there is a 30k messages limit per month on the cloud server, so I will reduce the interval for datastreams from 1s to 15min. Hopefully, I will not run into any limit issues.
I now need help with 2 things:
How do I link my raspberry pi with blynk? Once again, I’m not sure how to upload sketches onto the pi.
What nodered library should I use? How would my flow in nodered look like? Do I need to transform my data in any way? Currently, it is sent to influxdb in JSON format.
Any help would be appreciated. If you have any external resources (eg. Other forum posts) feel free to link them too.
You don’t need to upload sketches to the Pi.
Install the Blynk IoT contrib from the Node-Red palette.
In Blynk web console create a template, with the virtual datastreams you need, then create a device from that template.
This will give you your template ID and auth token which you use to create a connection in the Node-Red contrib.
You will use the Blynk IoT Write node to write data to the virtual datastream(s) that you’ve created. This can be handled dynamically by specifying the datastream in the message, or in a static way with the datastream defined in the node. The message payload needs to contain the single data value you want to send to Blynk.
This topic explains a bit more. It was originally written for Blynk IoT, but the last post covers some of the changes with Blynk IoT, although the basic principals are the same…