sinricpro / esp8266-esp32-sdk

Library for https://sinric.pro - simple way to connect your device to Alexa, Google Home, SmartThings and cloud
https://sinric.pro
Other
231 stars 124 forks source link

Error compiling ESP8266 #150

Closed NorberMV closed 3 years ago

NorberMV commented 3 years ago

Could someone help me with this error, I´ve been serching in the documentation, making sure that all the dependent libraries are installed and nothing works, I have the ESP8266 module Wemos D1 mini. When i try to compile the IDE shows the following error: **Arduino:1.8.9 (Windows 10), Tarjeta:"WeMos D1 R2 & mini, 80 MHz, 115200, 4M (3M SPIFFS)"

Opciones de compilación cambiadas, reconstruyendo todo In file included from C:\Users\W\Documents\Arduino\libraries\SinricPro\src/SinricProInterface.h:13:0,

             from C:\Users\W\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:11,

             from C:\Users\W\AppData\Local\Temp\arduino_modified_sketch_930545\Relay.ino:29:

C:\Users\W\Documents\Arduino\libraries\SinricPro\src/SinricProId.h: In member function 'void SinricProId::copy(const uint8_t*, size_t)':

C:\Users\W\Documents\Arduino\libraries\SinricPro\src/SinricProId.h:132:109: error: there are no arguments to 'min' that depend on a template parameter, so a declaration of 'min' must be available [-fpermissive]

 void copy(const uint8_t other[], size_t size) { memcpy(_data._data, other, min(sizeof(_data._data), size)); }

                                                                                                         ^

C:\Users\W\Documents\Arduino\libraries\SinricPro\src/SinricProId.h:132:109: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)

exit status 1 Error compilando para la tarjeta WeMos D1 R2 & mini.

Este informe podría contener más información con "Mostrar salida detallada durante la compilación" opción habilitada en Archivo -> Preferencias. ** This is the example I´ve trying to compile, the Relay example:

`/*

// Uncomment the following line to enable serial debug output //#define ENABLE_DEBUG

ifdef ENABLE_DEBUG

   #define DEBUG_ESP_PORT Serial
   #define NODEBUG_WEBSOCKETS
   #define NDEBUG

endif

include

ifdef ESP8266

   #include <ESP8266WiFi.h>

endif

ifdef ESP32

   #include <WiFi.h>

endif

include "SinricPro.h"

include "SinricProSwitch.h"

define WIFI_SSID ""

define WIFI_PASS ""

define APP_KEY "" // Should look like "de0bxxxx-1x3x-4x3x-ax2x-5dabxxxxxxxx"

define APP_SECRET "" // Should look like "5f36xxxx-x3x7-4x3x-xexe-e86724a9xxxx-4c4axxxx-3x3x-x5xe-x9x3-333d65xxxxxx"

define SWITCH_ID "" // Should look like "5dc1564130xxxxxxxxxxxxxx"

define BAUD_RATE 115200 // Change baudrate to your need

define RELAY_PIN D5 // Pin where the relay is connected (D5 = GPIO 14 on ESP8266)

bool onPowerState(const String &deviceId, bool &state) { digitalWrite(RELAY_PIN, LOW); // set pin state return true; // request handled properly }

void setup() { pinMode(RELAY_PIN, OUTPUT); // set relay-pin to output mode digitalWrite(RELAY_PIN, HIGH); WiFi.begin(WIFI_SSID, WIFI_PASS); // start wifi

SinricProSwitch& mySwitch = SinricPro[SWITCH_ID]; // create new switch device mySwitch.onPowerState(onPowerState); // apply onPowerState callback SinricPro.begin(APP_KEY, APP_SECRET); // start SinricPro }

void loop() { SinricPro.handle(); // handle SinricPro commands }`

sivar2311 commented 3 years ago

Please use lastes Arduino ESP core version (2.7.4)

NorberMV commented 3 years ago

Ok @sivar2311 , could this be the problem?

sivar2311 commented 3 years ago

I think that IS the problem.

NorberMV commented 3 years ago

Yes, that´s solve the problem, thanks!