Hi everyone.
I´m developing an application to test a valve with Blynk. This will open and close the valve and count the cycle until the valve fail.
I need to save the number of cycle the system run and send this to the responsable for test. How can I set up Blynk to do this?
By saving the values on the server you automatically have up to 3 months historical data available which can be accessed via the API and downloaded in csv format.
You can use Webhooks to send the data direct to Google Sheets.
By default raw data storage is disabled (as it consumes disk space a lot). When you enable it, every Blynk.virtualWrite command will be saved to DB. You will need to install PostgreSQL Database (minimum required version is 9.5) to enable this functionality:
Hi there.
I´m using virtualWrite and syncVirtual(). But I need to assign the value in a vitrual pin to a variable when the system is turned on.
I try it in many ways but nothing is working.
My code is like this:
BLYNK_CONNECTED()
{
Blynk.syncVirtual(V0, V1);
}
BLYNK_WRITE(V0)
{
db_ciclos = param.asLong();
}
BLYNK_WRITE(V1)
{
contador = param.asLong();
}
BLYNK_WRITE(V2)
{
nr_ciclos = param.asLong(); // assigning incoming value from pin V2 to a variable
Blynk.virtualWrite(V0, nr_ciclos);
lcd.setCursor(0, 1);
lcd.print("Nr. Ciclos:");
lcd.setCursor(12, 1);
lcd.print(nr_ciclos);
// process received value
}
BLYNK_WRITE(V3)
{
start_buttom = param.asInt();
}
I define the variables as global variables as you said.
The problem is when I restart the system I want to variables db_ciclos and contador assume the values on the Blynk server. But both of then return 0 when it´s called.
Yes that’s right it’s only the V0 and V1 sync that prints the values. If you now set V3 as a slider and virtualWrite db_ciclos to V0, V4 as slider with virtualWrite contador to V1 and remove V2 from the sync you will hopefully see that the slider values are being retrieved from the server when you reboot the ESP.