Hi, I just started using Blynk and have been able to integrate it into my project. On the hardware side I’m using a Teensy 3.2 with several sensors plus an Adafruit Bluefruit LE SPI board for Blynk over BLE. There were some issues getting this all working but now I have all the sensors displaying data on my iPhone in the Blynk app using BLE. Looks great, graphing widget is fantastic, and loving what Blynk can do.
So my issue is that whenever I call Blynk.virtualWrite in my Arduino code I notice a delay of about 100 ms. I have 5 virtual pins pushing so I call virtualWrite 5 times. This starts to add up to about half a second delay with each full sensor report. I’ve already spread the virtualWrites so I’m only doing 1 per main loop and then only 1 every 200 ms minimum so only doing about 5 virtualWrites per second so I don’t think I’m flooding. I don’t use any delay() in my own code.
Th reason this delay is a problem is that one of the sensors requires a raw reading at minimum 20 times a second. I was able to get that rate no problem before integrating Blynk, including using the exact same hardware setup but using Adafruit’s BlueFruit app to receive data over Bluetooth locally. But now with Blynk I’m getting only 9 fps which is interfering with my ability to process this particular sensor at the resolution required.
Is this delay for virtualWrite normal? Is there a way to prevent my app from freezing for 1/10th of a second with each call to virtualWrite? I’m thinking this might be a side effect of having to push data through Blynk’s server, or maybe it’s just an issue with Bluetooth LE. Perhaps there’s a setting I’m missing somewhere that prevents Blynk from holding up my app while it waits for the round trip from the server?
Thanks for any help!