Hello:)
The problem is that Blynk fails to connect.
The development environment is as follows
• M5stack Core2(ESP32) + WiFi
• Blynk 2.0
• Blynk server(blynk-cloud.com)
• Blynk Library version 1.1.0 + PlatformIO + VisualStudio Code
First of all, I am Japanese, so please forgive my poor English.
I am planning to use M5stack for robot development.
Since I am new to blynk, I tried with blynk 2.0 quick template but it is still OFFLINE.
First of all, I didn’t write any blynk program and just tried to see if it would go ONLINE. That is the code below.
But it still does not go ONLINE at all.
In the middle of the code, I tried to display the connection result on the LCD, but it fails.
I thought the network at home was bad, so I tried cellular via tethering on my phone, but still no luck.
I want to get ONLINE first, so I need everyone’s help.
#include <Arduino.h>
#include <M5Core2.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#define BLYNK_TEMPLATE_ID "TEMPLATE"
#define BLYNK_DEVICE_NAME "M5stack"
#define BLYNK_AUTH_TOKEN "TOKEN"
#define BLYNK_PRINT Serial
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "SSID";
char pass[] = "PASS";
char server[] = "blynk-cloud.com";
int port = 8080;
void setup()
{
M5.begin();
M5.Lcd.setTextSize(2);
M5.Lcd.setCursor(0, 0);
M5.Lcd.printf("Blynk connection... ");
Serial.begin(115200);
WiFi.begin(ssid, pass);
Blynk.config(auth, server, port);
bool result = Blynk.connect();
if (result != true){
M5.Lcd.printf("FAIL");
}else{
M5.Lcd.printf("SUCCESS");
}
}
void loop()
{
Blynk.run();
}