Hello! I have been working with Blynk and an Arduino Nano IoT, and I can get the Arduino connected to the internet and the Blynk system, but the program keeps repeating the connection process and the device does not come online in the app. The output looks as such:
[2039] IP: 10.19.25.106
[2040]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.5.8 on Arduino
[2041] Connecting to blynk.cloud:80
[2235] Ready (ping: 80ms).
[7429] Connecting to blynk.cloud:80
[7595] Ready (ping: 100ms).
[12789] Connecting to blynk.cloud:80
[13515] Ready (ping: 411ms).
Does anyone know how to fix this problem? The rest of my code is pasted below.
/*************************************************************
This is a simple demo of sending and receiving some data.
Be sure to check out other examples!
*************************************************************/
/* Fill-in information from Blynk Device Info here */
#define BLYNK_TEMPLATE_ID "TMPL2KjH8xvc2"
#define BLYNK_TEMPLATE_NAME "Quickstart Device"
#define BLYNK_AUTH_TOKEN "btp4xkQ5LnEqo8OcX3qEuHEUPzm8rfZz"
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT SerialUSB
#include <SPI.h>
#include <WiFiNINA.h>
#include <BlynkSimpleWiFiNINA.h>
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "*********"; // I'm not putting my ssid and password here
char pass[] = "**********";
BlynkTimer timer;
// This function is called every time the Virtual Pin 0 state changes
BLYNK_WRITE(V0)
{
// Set incoming value from pin V0 to a variable
int value = param.asInt();
// Update state
Blynk.virtualWrite(V1, value);
}
// This function is called every time the device is connected to the Blynk.Cloud
BLYNK_CONNECTED()
{
}
// This function sends Arduino's uptime every second to Virtual Pin 2.
void myTimerEvent()
{
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V2, millis() / 1000);
}
void setup()
{
// Debug console
Serial.begin(9600);
//Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
// You can also specify server:
Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass, "blynk.cloud");
//Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass, IPAddress(64,225,16,22), 8080);
// Setup a function to be called every second
timer.setInterval(1000L, myTimerEvent);
}
void loop()
{
Blynk.run();
timer.run();
// You can inject your own code or combine it with other sketches.
// Check other examples on how to communicate with Blynk. Remember
// to avoid delay() function!
}