Hi,
I’m using a Fishino to control 2 sunblinds locally with physicall up/down buttons and remotely via 2 sliders on Blynk IOS App. All is working perfectly except one annoying case.
If I move to 0 the slider (extreme left of range 0…10) after a push from Arduino the event is not detected.
Any another action move to 1, move to right etc… works.
I don’t know if the problem is the IOS App or the public Blynk server but Arduino receive no event so very hard to troubleshoot from my side. I’m using v0.5.2 library and very last IOS App tested from both an iPhone and iPad.
Herewith the code related to Blynk management.
Very basic with all events reported to serial. blynkPush sync the Blynk Server with actual Motor position
void blynkPush()
{
LOG("Blynk Push");
Blynk.virtualWrite(V1, float(Motor1.position)/K);
Blynk.virtualWrite(V2, float(Motor2.position)/K);
}
BLYNK_CONNECTED()
{
LOG("Blynk Connected");
blynkPush();
}
BLYNK_WRITE_DEFAULT()
{
int pin = request.pin;
int value = param.asInt();
LOG("Blynk Pin: " + pin);
LOG("Blynk Value: " + value);
switch (pin) {
case V1:
if (!Motor1.run) Motor1.go(value*K);
break;
case V2:
if (!Motor2.run) Motor2.go(value*K);
break;
}
ok, so if I understand correctly: if you change the Vpin value to 0 then BLYNK_WRITE is not activated? Im rather new to this all as well, so I don’t see why as the value clearly changes. perhaps its a bug? Anyway have you tried setting the max slider value to 0.1-10 ?
another thing you can try is using BLYNK_WRITE(V1) directly and see if that works.
edit: by the way: thank you! You’ve inadvertently solved one of my problems. Before reading this post I wasn’t aware of blynk_write_default() and as I have 49 pins to manage I had 49 instances of blynk_write().
Hi,
I’ve tried many changes but no luck. My feeling is it’s a bug I cannot troubleshoot because happening on App (IOS) and/or server side. I’m using this setup since 9 months without problems so maybe introduced with new Blynk versions
In that case either change the topic type from ‘need help’ to ‘report issue’ (if that is possible?)
If its not possible then create a new topic an give thorough explanation of what you did.
Fact btw that it all worked until a recent Blynk update is also a rather dead give away that a bug was introduced (although granted it is theoretically possible that at the same time a hardware bug initiated).
What exactly are you pushing? Pls check with logs
Does the value on server (you can check via http api) reflect the change from this push?
Does slider in the app reflect the change from this push?
I’ve completed my investigation installing also a local Blynk server for sniffing traffic and in my opinion there is a bug in the App (I tried IOS only) with slider widget
Summarizing:
When a Slider is set to send data on release only, it doesn’t send any change to Blynk server moving to the edges (0 or 255) after the Hardware has called a Blynk.virtualWrite.
I tried a lot of workarounds without success:
change from horizontal to vertical sliders
change borders from 0…10 to -10…0
disabling data mapping
…
Changing “send data on release only” to OFF it works but it requires some very bad code to process just the last value.
Now I cannot do more because no way to debug the App internals.
I’ve tried with Android and the bug is not present.
Please have a look to this video
showing on the bottom Android App vs iOS in the middle.
Basically iOS doesn’t always trigger an event when the slider is moved to zero if the previous event is generated elsewhere.