Hi guys
I’m building a level monitor for a tank using electron and wish for the updates to be in 5 minute intervals. I am pushing the data to Ubidots (working fine) and blynk (not working). My understanding coding is not that flash so please excuse me but I’m really hoping someone can help.
If the delay is between 1 and 10 seconds, updates come through to blynk OK. but I want the data to only be pushed after 5 minute intervals, as this is electron and I wish to conserve data. So I am finding that data is arriving perfectly on Ubidots server but just not updating on blynk. Is the blynk server timing out? I’ve extended the heartbeat timeout in blynkConfig.h from 10 to 333 but not helping.
Code works perfectly on Ubidots. So I assume the servers there don’t mind the large delays between data poles…
I also stumbled upon an article within Blynk support suggesting that looped delay in code will not work well with the Blynk servers, and to use timed events instead? so this would be with the milli(s) function? But then I read somewhere else that milli(s) function has issues also and to use "simpleTimer,h which is not in the particle library…
On the Blynk app faceplate end… I just have V coil set to “push”. also tried set to “2 seconds”.
blynk is great and really means a lot to me as part of my project - where am I going wrong? Can someone help me with a code example to get this working would be absolutely appreciated…
Thanks in advance guys.
here is my code:
> int TnkLvlPV_RAW = A0; //raw signal data from field
> float Tx01 = 0.0; //transmission tag
> char resultstr[64];
> void setup () {
> pinMode(TnkLvlPV_RAW,INPUT);
> Blynk.begin(auth);
> Serial.begin(115200);
> }
> void loop() {
> // Read alalogue value assigned to TAG "TankLevelPV_RAW"
> Tx01 = analogRead(TnkLvlPV_RAW);
> Tx01 = map(Tx01, 0, 4095, 0, 100); //scale the value to 0-100X
> sprintf(resultstr, "{\"value\":%.4f}",Tx01);
> delay(100);
> Spark.publish("Tx01", String(Tx01) + " %");
> Particle.publish("PostToUbidots", Tx01);
> Blynk.run();
> Blynk.virtualWrite(3, String(Tx01));
> ubidots.add("Tx01", Tx01);
> ubidots.sendAll();
> delay(300000);//send again in 5 minutes
> }








