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.81k stars 1.38k forks source link

Blynk.begin() blocks thread until it connected to Wi-Fi #540

Closed SNMetamorph closed 2 years ago

SNMetamorph commented 2 years ago

Blynk library version: 1.0.0 from Platform.IO registry IDE: VSCode + Platform.IO Board type: ESP8266 with Arduino framework

Expected Result

Being able to doing these thing asynchoniously or at least set timeout for connection. For example, in init() we may call Blynk.begin(), and then in loop() check had device connected or not

Actual Result

While thread locked in Blynk.begin(), device is completely unusable for other things.

SNMetamorph commented 2 years ago

Can use Blynk.connectWiFi(), Blynk.config(), Blynk.connect() for this.