Guess you asked @wiipro? (as I have only one slider: on V11)
yes
I see that sometimes virtual write to pin 1 is coming to the app with a value = 0 when you are dragging the thumb of the slider, and itās usual in the app - sometimes it even comes 2 times during 1 sec.
Thats strange, hmmmm. It doesnt make senseā¦ Iām not sending any values 2 times per sec, only one time/2secs and iām only updating gauges and value displays. Also, iāve checked it right know, and thereās nothig which can send 0 from HW. Only actual value of slider. I will send you new log ASAP. Intial value of slider will be 255 and not 0 as before, because i thing that affected this in bad way.
Sometimes it is two times per second, usually - one time per 2. Here is log for virtual write to pin 1
00:34:29 messageId = 42232, actionId = 20, value = 2vw10
00:34:31 messageId = 42244, actionId = 20, value = 2vw10
00:34:31 messageId = 42251, actionId = 20, value = 2vw10
00:34:33 messageId = 42263, actionId = 20, value = 2vw10
00:34:34 messageId = 42270, actionId = 20, value = 2vw10
00:34:35 messageId = 42282, actionId = 20, value = 2vw10
00:34:37 messageId = 42294, actionId = 20, value = 2vw10
00:34:38 messageId = 42301, actionId = 20, value = 2vw10
00:34:39 messageId = 42313, actionId = 20, value = 2vw10
00:34:41 messageId = 42325, actionId = 20, value = 2vw10
00:34:42 messageId = 42332, actionId = 20, value = 2vw10
00:34:43 messageId = 42344, actionId = 20, value = 2vw10
00:34:45 messageId = 42357, actionId = 20, value = 2vw10
00:34:46 messageId = 42364, actionId = 20, value = 2vw10
00:34:47 messageId = 42376, actionId = 20, value = 2vw10
00:34:49 messageId = 42388, actionId = 20, value = 2vw10
00:34:50 messageId = 42395, actionId = 20, value = 2vw10
00:34:51 messageId = 42407, actionId = 20, value = 2vw10
00:34:53 messageId = 42419, actionId = 20, value = 2vw10
00:34:53 messageId = 42426, actionId = 20, value = 2vw10
Ok, Iāll wait for a new log
Sended
Almost the same story - a lot of virtual write with value=255 , except that sometimes appās receives not only 255, but some other values
Could you attach here the screenshot of your sliderās settings?
BTW: this is the function iām calling every 2 seconds.
void push()
{
#ifndef TEST
DateTime now = rtc.now();
#endif
bool high = false;
bool low = false;
double watertemp = temp.getTemp();
byte airtemp = dht.readTemperature();
byte humidity = dht.readHumidity();
#ifndef BT
if (watertemp > 35 && high == false) {
Blynk.email("AquaDuino Temp Warning", "Water temperature is too high(>35Ā°C)");
high = true;
}
if (watertemp < 35 && high == true) {
high = false;
}
if (watertemp <22 && low == false) {
Blynk.email("AquaDuino Temp Warning", "Water temperature is too low(<22Ā°C)");
low = true;
}
if (watertemp >22 && low == true) {
low = false;
}
#endif
Blynk.virtualWrite(V4, watertemp);
Blynk.virtualWrite(V5, airtemp);
Blynk.virtualWrite(V6, humidity);
#ifndef TEST
Blynk.virtualWrite(V14, now.hour());
Blynk.virtualWrite(V15, now.minute());
byte MM = now.minute();
byte HH = now.hour();
int min = MM * 60;
long hod = HH *3600L;
secnow = hod + min;
#endif
}
I also tried setting timer to 10secs, but it doesnāt help tho. This function is the only one that is timed.
EDIT:
OK I GOT IT! somewhere deep in my 800 lines of code was hidden one broken line which caused the troubles! Works great now guys. Sorry for bothering you with this shitty question.
mine still likes to run out of my finger sometimesā¦
Iām investigating your log - it also has some strange things, but most probably caused by some applicationās bugs, iāll later inform you.
Most of the time it is a bad sketch rather than a bad library that causes the problem and I started a post 1 hour ago to ask for your sketch. Then I thought better of it and cancelled the post.
I know and actually i was checking it three time line by line, but i was little sleepy, because Iāve done that at around 11PM so i didnāt noticed it.
Who knows? The device itself runs fine and does what it is supposed to do, but Iām not a professional programmer. I wouldnāt be surprised if something would hide between over 1000 linesā¦ (not including screen graphics bitmaps). Letās wait for @BlynkAndroidDev findings, then we will be able to pinpoint possible bug.
Try a 10 line slider sketch.
@vshymanskyy could it be because of a kind of āloopā? To summarize:
this is called periodically (10secs),
Blynk.virtualWrite(V11, (int)(Tc_set * 2.0));
that is because Tc__set can be changed from hardware side too
this one is called by widget āon releaseā:
BLYNK_WRITE(V11) { // Blynk Temp SET slider
int pinValue = param.asInt();
pinValue = constrain(pinValue, 10, 50);
Tc_set = (float)pinValue / 2.0;
delay(200);
Blynk.virtualWrite(V5, Tc_set); // this is a display widget
delay(200);
Serial.print(F("Restoring preset temperature threshold: Tset "));
Serial.println(Tc_set, 1);
}
At most it works, but sometimes it āgets illā I have to play with the slider for a while to catch it.
@Costas: I assume it just works
As I thought @marvin7, a bad sketch.
If you are dragging the slider when the 10s timer kicks in you get the crazy slider performance.
You would need to stop the timer in the slider function and then restart it at the end of the slider function.