[Solved] Value Widget Displaying Old Data

There appears to be a phantom value update issue again. I read it was suppose to be cleared up back in August but that’s not what I’m seeing now. I’m running 2.5.6 IOS app, and Blynk Lib v0.4.0. Using Blynk cloud…

It happens with both number values (example: 0…99) and text (example: ON or OFF). Whatever is on display when app. is stopped gets displayed correctly when started again. For instance, if ON was being displayed it is correct when app. is restarted. However, changing the condition on the hardware to have OFF sent causes it to toggle back and forth between ON and OFF. The value control is set to update (BLYNK_READ) every 5 seconds. It seems to finally stabilize after ~30 seconds to the correct state. For a number example: if you increment it by 1, it will show the update then switch back to the old number and do this for a few cycles then finally stay at new number. In other cases, the update will stabilize then out of the blue, a really old value will appear.

Note: I’ve checked for other Blynk.virtualWrite(s) to the channels and dump each update to the screen to ensure value being sent is correct. There definitely appears to be stale data being buffered.

UPDATE:
Did some more experimenting. After I ran the project, I went back and changed the wording from
ON to UN and OFF to UFF, with the last state before quitting being ON. After uploading and changing hardware to send UFF, the message cycled between ON and UFF. This definitely proves there is something happening between iphone app and blynk cloud server holding old data.

Hello. Thank you for detailed explanation. Do you have Android to check issue there?

Unfortunately, I do not have an android.

I get why there is buffering (popoulate widget for offline hardware or for storing variables on server for virtual channels). For graph and history widgets, more that one value being bufferred makes sense but why have more than one for simple value widgets? :thinking:

It could be just iOS issue. Most probably it is. There is no chance value could be buffered on server side. As it is processed within 1 thread always.

Anyway we starting active iOS dev phase tomorrow. So I hope within few weeks this issue will be gone. Stay tuned. A lot of new updates are coming :slight_smile:.

Dmitriy,

Thanks for looking into this and I await the new IOS release. The Blynk Team has truly created a Wonderful Product…

FYI

I updated Blynk app. to 2.5.7 but the issue is still there.

@minnkid yes, we haven’t start it yet. It is in our tracker. I’ll update this ticket when issue will be fixed.

Hi, @minnkid
You seem to have some strange issue I can’t reproduce. Please provide more info, like what iPhone model and iOS version you have? Does similar issues appear on other types widget? Also, what internet connection quality you have on iPhone?

Here is what I’ve tried:

  1. Have a Value Display widget assigned to the virtual pin. Run the project.
  2. The virtual pin is periodically updated with Blynk.virtualWrite function (the number is constantly incremented)
  3. Stop the project, wait some time and run again.
    For me, the Value Display widget shows correct values.
    Here is video from my iPhone:
    https://www.dropbox.com/s/sluuf1voegjpxdk/valueWidget.mov

Any thoughts on what’s different with your project?

Hi Eugene,

First off, I’m using an iPhone 5 with IOS 10.2. My internet speed is 5Mbit and its only happening on value widgets.

Looking at the video, it seems your application is running a timer on the hardware. When you stopped the Blynk app. then restarted, the value jumped from 5 to 10. This indicates your pushing values from your application to the server.

In my setup, the value widget are set to fire from 5 to 15 secs (non-push) which causes the BLYNK_READ(virtual pin) routine to be called. Within that routine, I perform a Blynk.virtualWrite(virtual pin,value). This is important since the updates do not happen unless the application is OPEN and RUNNING. I believe someone posted something that if the app. was running and then closed out on the phone (press home button), the server would keep retrieving values from the hardware in the background. That is not the case and can easily be proved by dumping values out to the monitor within the BLYNK_READ() routine. You will see once the app. is closed, the monitor will stop transmitting updates.

It definitely seems tied to the value present when first starting the blynk app. The updates will toggle between the new value and the old one. If the new value keeps being transmitted, eventually the old value will disappear.

Thanks @minnkid for your collaboration.

You are right about BLYNK_READ - it is triggered by application in case the application is active. It is intended so and documented so. But this is all it does - triggers your code to run according to Frequency parameter.

From the application prospective there is no difference whether you wrote Blynk.virtualWrite() inside BLYNK_READ block or not - the function pushes the value to the application.

I will play more and keep it here updated.

Eugene,

I decided to try a few things to see if the problem could be corrected.

  1. Deleted iphone blynk app. then rebooted iphone --> problem still there.
  2. Deleted entire blynk project, created new project with new auth code. --> problem still there.

One thing that was interesting is the value widgets would blink from Blank to the new value posted from hardware. I guess that makes sense since the starting value would be blank on a new project. Another item to note, I’m changing text color on alarm conditions for two of the value fields. The color change works and remains in proper state from normal to alarm condition but the value flips back and forth. Not sure if that helps track down whats going on.

Thanks @minnkid
We partly reproduced the issue (Value Widget loosing its value) and there gonna be a fix in upcoming 2.6.1

It appears the 2.6.1 update took care of both value and property update issues.

Thanks

1 Like