My project supports 5 devices, which choosed using “Selector device” widget. Yesterday I refreshed authtocken on an first device.
After this my project cannot to connect to the Blynk cloud. Ping blynk-cloud.com is OK.
I did a new simple project Blinc Led and this project cannot to connect to the Blynk cloud.
Before changin authtocken all worked nice. What it can be?
May be connection to tthe cloud is blocked for my account?
Dmitriy, I enabled debug hardware: #define BLYNK_PRINT Serial #define BLYNK_DEBUG
but in console I see nothing exept: Connecting to klg Connecting to Blynk cloud
How You can see there are nothing messages about IP, port and other parameters.
Why?
I don’t think you are using it correctly anyhow… Blynk.connect() is a command that tries to connect… the command to check connection status is Blynk.connected()
Put Blynk.connect(); immediately after the Blynk.config(auth); in your sketch. If you don’t do this Blynk will try to connect once you hit Blynk.run() in the code and in such case calling Blynk.connected() earlier will give you wrong status.
Move #define BLYNK_PRINT Serial and #define BLYNK_DEBUG before the first #include.
Thanks bilbobg.
I did all Your suggestions and got:
Connecting to klg
[75392] Connecting to klg
[78395] Connected to WiFi
[78395] IP: 192.168.1.228
WiFi connected
Connecting to Blynk cloud
[78395]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.5.0 on ESP8266
[78516] Connecting to blynk-cloud.com:8442
Blynk.connect() = 0
[92238] Connecting to blynk-cloud.com:8442
LED on V1: on
[106262] Connecting to blynk-cloud.com:8442
LED on V1: off
[120261] Connecting to blynk-cloud.com:8442
LED on V1: on
Debug messages apears now, but connection to the cloud no