Connecting to blynk.cloud:443 Secure connection failed

The boad is adafruit feather esp32-s2 reverse TFT

When I have this sentence in my sketch:

GFXcanvas16 canvas(240, 135);

the following problem occurs:

[219104] Connecting to blynk.cloud:443

[219223] Secure connection failed

when I comment it out there is no problem, but I need the canvas to draw on the tft screen,i have no idea why this problem happen,the full sketch is below:

/*************************************************************
  Blynk is a platform with iOS and Android apps to control
  ESP32, Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build mobile and web interfaces for any
  projects by simply dragging and dropping widgets.

    Downloads, docs, tutorials: https://www.blynk.io
    Sketch generator:           https://examples.blynk.cc
    Blynk community:            https://community.blynk.cc
    Follow us:                  https://www.fb.com/blynkapp
                                https://twitter.com/blynk_app

  Blynk library is licensed under MIT license
 *************************************************************
  Blynk.Edgent implements:
  - Blynk.Inject - Dynamic WiFi credentials provisioning
  - Blynk.Air    - Over The Air firmware updates
  - Device state indication using a physical LED
  - Credentials reset using a physical Button
 *************************************************************/

/* Fill in information from your Blynk Template here */
/* Read more: https://bit.ly/BlynkInject */
#define BLYNK_TEMPLATE_ID "TMPL5Ha8P_nqx"
#define BLYNK_TEMPLATE_NAME "Quickstart Template"

#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#define BLYNK_PRINT Serial
// #define BLYNK_DEBUG

#define APP_DEBUG

// Uncomment your board, or configure a custom board in Settings.h
//#define USE_ESP32_DEV_MODULE
//#define USE_ESP32C3_DEV_MODULE
#define USE_ESP32S2_DEV_KIT
//#define USE_WROVER_BOARD
//#define USE_TTGO_T7
//#define USE_TTGO_T_OI

#include "BlynkEdgent.h"
#include "Adafruit_SHTC3.h"
#include "Adafruit_MAX1704X.h"
#include <Adafruit_NeoPixel.h>
#include "Adafruit_TestBed.h"
#include <Adafruit_ST7789.h> 
#include "Adafruit_GFX.h"
// #include <Fonts/FreeSans12pt7b.h>

// GFXcanvas16 canvas(240, 135);// here is the problem statment
bool bmefound = false;
extern Adafruit_TestBed TB;

Adafruit_MAX17048 lipo;
Adafruit_ST7789 display = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);

BlynkTimer timer;

Adafruit_SHTC3 shtc3 = Adafruit_SHTC3();
double Indoor_temp;
double Indoor_humid;

void readTemperatureAndHumidity() {
  sensors_event_t humidity, temp;
  shtc3.getEvent(&humidity, &temp); // populate temp and humidity objects with fresh data

  Serial.print("Temperature: ");
  Serial.print(temp.temperature);
  Serial.println(" degrees C");

  Serial.print("Humidity: ");
  Serial.print(humidity.relative_humidity);
  Serial.println("% rH");
  Indoor_temp = temp.temperature;
  Indoor_humid = humidity.relative_humidity;
  Blynk.virtualWrite(V5, Indoor_humid);
  Blynk.virtualWrite(V6, Indoor_temp);
}

void setup()
{
  
  // // turn on the TFT / I2C power supply
  // pinMode(TFT_I2C_POWER, OUTPUT);
  // digitalWrite(TFT_I2C_POWER, HIGH);

  // pinMode(NEOPIXEL_POWER, OUTPUT);
  // digitalWrite(NEOPIXEL_POWER, HIGH);
  // delay(10);
  
  // TB.neopixelPin = PIN_NEOPIXEL;
  // TB.neopixelNum = 1; 
  // TB.begin();
  // TB.setColor(WHITE);

  // display.init(135, 240);           // Init ST7789 240x135
  // display.setRotation(3);
  // canvas.setFont(&FreeSans12pt7b);
  // canvas.setTextColor(ST77XX_WHITE); 
  ///////////////////////////////////////////////////////////////
  Serial.begin(115200);
  delay(5);

  // will pause Zero, Leonardo, etc until the serial console opens
  Serial.println("SHTC3 test");

  if (!shtc3.begin()) {
    Serial.println("Couldn't find SHTC3");
    while (1) delay(1);
  }

  Serial.println("Found SHTC3 sensor");
  delay(100);

  
  timer.setInterval(1000, []()
                    { Blynk.virtualWrite(V0, millis() / 1000); });
  timer.setInterval(5000L, readTemperatureAndHumidity);
    BlynkEdgent.begin();
}



void loop() {
  BlynkEdgent.run();
  timer.run();
 
  // readTemperatureAndHumidity();
  delay(1);
}

Have you tried it with a non-Edgent sketch?

Pete.

non-edgent version works :smiley:

Your Edgent sketch included this line of code…

but no definitions for the pins that are represented by TFT_CS, TFT_DC and TFT_RST

For the sketch to have compiled these definitions needed to be somewhere in your code, and im guessing that you placed them somewhere within the .h files for the Edgebt sketch (not a good idea) or you’ve failed to include these lines from your sketch when you posted your code to the forum.

I’m guessing that whatever pins you defined as TFT_CS, TFT_DC and TFT_RST are conflicting with the pins defined in Settings.h for the board type you’ve selected (#define USE_ESP32S2_DEV_KIT in this case).

Pete.