If you experience connection problems, follow these steps:
- Check your wiring using the examples (TCP/HTTP Client or similar) provided with selected shield and hardware. Once you have some understanding how to configure connection, it's much easier to use Blynk.
- Try running Blynk default examples for your platform without modifications to see if it is working.
- Read carefully the example comments and explanations
- Check that your token is valid (copied from the App and doesn't contain spaces, etc.)
- If it doesn't work, try looking into serial debug prints.
- Done! Add your modifications and functionality. Enjoy Blynk!
Your application might be calling a delay() function or sleeps/cycles for a long time inside of the loop(), like this:
void loop()
{
...
delay(1000);
other_long_operation();
...
Blynk.run();
}
You should be aware that this can degrade performance of Blynk, or cause connection drops.
Note: This also applies to the BLYNK_READ & BLYNK_WRITE handlers!
If you need periodic actions, consider using some timer library, like shown in this example.
Your application may cause an enormous load on our server, please try avoiding sending data too fast.
For example, in this situation Blynk.run() will quickly finish processing incoming messages, and then new value is sent to the server immediately, causing high traffic:
void loop()
{
Blynk.virtualWrite(1, value);
Blynk.run();
}
You might be thinking about adding a delay(), but this creates another trouble.
If you need periodic actions, consider using some timer library, like shown in this example.
To enable debug prints on the default Serial, add on the top of your sketch (should be the first line ):
#define BLYNK_DEBUG // Optional, this enables lots of prints
#define BLYNK_PRINT Serial
And enable serial in setup():
Serial.begin(9600);
You can also use spare Hardware serial ports or SoftwareSerial for debug output (you will need an adapter to connect to it with your PC).
Note: enabling debug mode will slowdown your hardware processing speed up to 10 times.
Be sure to check the Basics page.