blynkkk / blynk-library

Blynk library for IoT boards. Works with Arduino, ESP32, ESP8266, Raspberry Pi, Particle, ARM Mbed, etc.
https://blynk.io
MIT License
3.83k stars 1.39k forks source link

virtualWrite function problem using BlynkApiLinux as device #389

Closed mrshu2 closed 6 years ago

mrshu2 commented 6 years ago

Blynk library version: 0.5.0 Blynk server: local installation, version 0.29.5, using docker container IDE: Atom/Platform.IO IDE version: 0.6.0 (building using console make command) Board type: linux (ubunru xenial) Additional modules: none

Scenario, steps to reproduce

I'm trying to use LinuxDesktop as Blynk device. Blynk project consists of a Button (V1) and a ValueDisplay (V0). But I've got unexpected results (nothing displayed in the corresponding widget) adding the following lines to main.cpp file in linux subdirectory: BLYNK_READ(V0) { Blynk.virtualWrite(0, 17.05); }

Expected Result

17.05 in ValueDisplay

Actual Result

Nothing in ValueDisplay. Disconnect state of the device. Blynk library 0.4.10 works correct for this simple case. But more complex widgets like Map or Table don't work at all. Using BLYNK_DEBUG_ALL and BLYNK_DEDUG macros I've found that the problem localized in the "nested run() skipping" condition due to "Waiting run() cycle" (BlynkProtocol.h). Setting BLYNK_MSG_LIMIT=0 eliminates the problem and all widgets work well. But this is partial solution