Esp8266 SSL compile error

I’m doing some experiments with Blynk and an ESP8266_01 board, I have compiled ESP8266_Standalone example without errors, but if I try to compile ESP8266_Standalone_SSL, compilation ends with a series of errors.

I’m using latest 0.5.3 library version, I can not figure out where the problem is.

xtensa-lx106-elf-g++ -o .pioenvs\esp01_1m\src\main.cpp.o -c -fno-rtti -fno-exceptions -std=c++11 -Os -mlongcalls -mtext-section-literals -falign-functions=4 -ffunction-sections -fdata-sections -Wall -DF_CPU=80000000L -D__ets__ -DICACHE_FLASH -DPLATFORMIO=30600 -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP01 -DARDUINO=10805 -DARDUINO_BOARD=\"PLATFORMIO_ESP01_1M\" -DLWIP_OPEN_SRC -U__STRICT_ANSI__ -Isrc -I.piolibdeps\Time_ID44 -IC:\Users\paolo\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266WiFi\src -I.piolibdeps\Blynk_ID415\src -IC:\Users\paolo\.platformio\packages\framework-arduinoespressif8266\tools\sdk\include -IC:\Users\paolo\.platformio\packages\framework-arduinoespressif8266\tools\sdk\libc\xtensa-lx106-elf\include -IC:\Users\paolo\.platformio\packages\framework-arduinoespressif8266\cores\esp8266 -IC:\Users\paolo\.platformio\packages\framework-arduinoespressif8266\tools\sdk\lwip\include -IC:\Users\paolo\.platformio\packages\framework-arduinoespressif8266\variants\generic src\main.cpp

In file included from src\main.cpp:37:0:
.piolibdeps\Blynk_ID415\src/BlynkSimpleEsp8266_SSL.h: In member function 'bool BlynkArduinoClientSecure<Client>::connect()':
.piolibdeps\Blynk_ID415\src/BlynkSimpleEsp8266_SSL.h:70:34: error: there are no arguments to 'time' that depend on a template parameter, so a declaration of 'time' must be available [-fpermissive]
time_t now = time(nullptr);
^
.piolibdeps\Blynk_ID415\src/BlynkSimpleEsp8266_SSL.h:70:34: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
.piolibdeps\Blynk_ID415\src/BlynkSimpleEsp8266_SSL.h:73:29: error: there are no arguments to 'time' that depend on a template parameter, so a declaration of 'time' must be available [-fpermissive]
now = time(nullptr);
^
.piolibdeps\Blynk_ID415\src/BlynkSimpleEsp8266_SSL.h:76:33: error: there are no arguments to 'gmtime_r' that depend on a template parameter, so a declaration of 'gmtime_r' must be available [-fpermissive]
gmtime_r(&now, &timeinfo);
^
.piolibdeps\Blynk_ID415\src/BlynkSimpleEsp8266_SSL.h:77:43: error: there are no arguments to 'asctime' that depend on a template parameter, so a declaration of 'asctime' must be available [-fpermissive]
String ntpTime = asctime(&timeinfo);
^
.piolibdeps\Blynk_ID415\src/BlynkSimpleEsp8266_SSL.h: In instantiation of 'bool BlynkArduinoClientSecure<Client>::connect() [with Client = WiFiClientSecure]':
.piolibdeps\Blynk_ID415\src/Blynk/BlynkProtocol.h:203:17:   required from 'bool BlynkProtocol<Transp>::run(bool) [with Transp = BlynkArduinoClientSecure<WiFiClientSecure>]'
src\main.cpp:58:13:   required from here
.piolibdeps\Blynk_ID415\src/BlynkSimpleEsp8266_SSL.h:70:34: error: 'time' was not declared in this scope
time_t now = time(nullptr);
^
.piolibdeps\Blynk_ID415\src/BlynkSimpleEsp8266_SSL.h:73:29: error: 'time' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
now = time(nullptr);
^
.piolibdeps\Blynk_ID415\src/BlynkSimpleEsp8266_SSL.h:70:34: note: 'time' declared here, later in the translation unit
time_t now = time(nullptr);
^
.piolibdeps\Blynk_ID415\src/BlynkSimpleEsp8266_SSL.h:75:19: error: 'tm timeinfo' has incomplete type
struct tm timeinfo;
^
.piolibdeps\Blynk_ID415\src/BlynkSimpleEsp8266_SSL.h:76:33: error: 'gmtime_r' was not declared in this scope
gmtime_r(&now, &timeinfo);
^
.piolibdeps\Blynk_ID415\src/BlynkSimpleEsp8266_SSL.h:77:43: error: 'asctime' was not declared in this scope
String ntpTime = asctime(&timeinfo);
^
*** [.pioenvs\esp01_1m\src\main.cpp.o] Error 1

perhaps you can share your code as well?

1 Like

Sure, as I said, I’m trying to compile ESP8266_Standalone_SSL example, so a very simple code

/*************************************************************
  Download latest Blynk library here:
    https://github.com/blynkkk/blynk-library/releases/latest

  Blynk is a platform with iOS and Android apps to control
  Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build graphic interfaces for all your
  projects by simply dragging and dropping widgets.

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

  Blynk library is licensed under MIT license
  This example code is in public domain.

 *************************************************************
  This example runs directly on ESP8266 chip.

  Note: This requires ESP8266 support package:
    https://github.com/esp8266/Arduino

  Please be sure to select the right ESP8266 module
  in the Tools -> Board menu!

  Change WiFi ssid, pass, and Blynk auth token to run :)
  Feel free to apply it to any other example. It's simple!
 *************************************************************/

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266_SSL.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";

void setup()
{
  // Debug console
  Serial.begin(9600);

  Blynk.begin(auth, ssid, pass);
}

void loop()
{
  Blynk.run();
}

Are you using the latest ESP8266 Arduino Core?

I think this is dedicated to the ESP32

Try using this

bl

@AbuJarrah no this is for ESP8266

1 Like

I’m using platformIO for coding, libraries are managed by the platform, I checked the library
used by platformIO and the version is 2.4.1. that should be the last stable.

# ESP8266 platform
# ------------------------------

# For more info:
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification

name = ESP8266 Modules
version = 2.4.1

Could you try it with Arduino IDE? It might be a Platformio issue…

I’ll try Arduino IDE as soon as I can and I’ll get back at you.

Thanks for support :slight_smile:

Finally I installed Arduino IDE and compiled the examples successfully. I have to report the problem to PlatformIO support.