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
236 stars 125 forks source link

issue upload to arduino/esp8266 (nodemcu) #84

Closed lucasviniciu closed 4 years ago

lucasviniciu commented 4 years ago

/issue In file included from C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:11:0, from C:\Users\Lucas\AppData\Local\Temp\arduino_modified_sketch_510189\doorbell.ino:33: C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricProInterface.h:16:30: error: 'JsonDocument' has not been declared virtual void sendMessage(JsonDocument& jsonEvent); ^ C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricProInterface.h:17:13: error: 'DynamicJsonDocument' does not name a type virtual DynamicJsonDocument prepareEvent(const char deviceId, const char action, const char cause); ^ In file included from C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:12:0, from C:\Users\Lucas\AppData\Local\Temp\arduino_modified_sketch_510189\doorbell.ino:33: C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricProDeviceInterface.h:13:28: error: 'JsonDocument' has not been declared virtual bool sendEvent(JsonDocument& event) = 0; ^ C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricProDeviceInterface.h:14:13: error: 'DynamicJsonDocument' does not name a type virtual DynamicJsonDocument prepareEvent(const char deviceId, const char action, const char cause) = 0; ^ In file included from C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:15:0, from C:\Users\Lucas\AppData\Local\Temp\arduino_modified_sketch_510189\doorbell.ino:33: C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricProSignature.h:14:44: error: 'JsonDocument' has not been declared String calculateSignature(const char key, JsonDocument &jsonMessage) { ^ C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricProSignature.h: In function 'String calculateSignature(const char, int&)': C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricProSignature.h:15:20: error: request for member 'containsKey' in 'jsonMessage', which is of non-class type 'int' if (!jsonMessage.containsKey("payload")) return String(""); ^ C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricProSignature.h:16:72: error: 'serializeJson' was not declared in this scope String jsonPayload; serializeJson(jsonMessage["payload"], jsonPayload); ^ C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricProSignature.h: At global scope: C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricProSignature.h:36:32: error: 'JsonDocument' has not been declared bool verifyMessage(String key, JsonDocument &jsonMessage) { ^ C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricProSignature.h: In function 'bool verifyMessage(String, int&)': C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricProSignature.h:37:52: error: conversion from 'const char' to 'String' is ambiguous String jsonHash = jsonMessage["signature"]["HMAC"]; ^ C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricProSignature.h:37:52: note: candidates are: In file included from C:\Users\Lucas\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266/Arduino.h:243:0, from C:\Users\Lucas\AppData\Local\Temp\arduino_modified_sketch_510189\doorbell.ino:25: C:\Users\Lucas\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266/WString.h:58:9: note: String::String(const FlashStringHelper*) String(const FlashStringHelper str); ^ C:\Users\Lucas\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266/WString.h:58:9: note: no known conversion for argument 1 from 'const char' to 'const __FlashStringHelper' C:\Users\Lucas\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266/WString.h:56:9: note: String::String(const char) String(const char cstr = nullptr); ^ C:\Users\Lucas\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266/WString.h:56:9: note: no known conversion for argument 1 from 'const char' to 'const char' In file included from C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:15:0, from C:\Users\Lucas\AppData\Local\Temp\arduino_modified_sketch_510189\doorbell.ino:33: C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricProSignature.h: At global scope: C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricProSignature.h:42:32: error: 'JsonDocument' has not been declared String signMessage(String key, JsonDocument &jsonMessage) { ^ C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricProSignature.h: In function 'String signMessage(String, int&)': C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricProSignature.h:43:20: error: request for member 'containsKey' in 'jsonMessage', which is of non-class type 'int' if (!jsonMessage.containsKey("signature")) jsonMessage.createNestedObject("signature"); ^ C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricProSignature.h:43:58: error: request for member 'createNestedObject' in 'jsonMessage', which is of non-class type 'int' if (!jsonMessage.containsKey("signature")) jsonMessage.createNestedObject("signature"); ^ C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricProSignature.h:44:36: error: assignment of read-only location '"HMAC"[((int)"signature"[jsonMessage])]' jsonMessage["signature"]["HMAC"] = calculateSignature(key.c_str(), jsonMessage); ^ C:\Users\ass\Documents\Arduino\libraries\SinricPro\src/SinricProSignature.h:44:36: error: cannot convert 'String' to 'const char' in assignment C:\Users\ass\Documents\Arduino\libraries\SinricPro\src/SinricProSignature.h:46:49: error: 'serializeJson' was not declared in this scope serializeJson(jsonMessage, signedMessageString); ^ In file included from C:\Users\Lucas\AppData\Local\Temp\arduino_modified_sketch_510189\doorbell.ino:33:0: C:\Users\Lucs\Documents\Arduino\libraries\SinricPro\src/SinricPro.h: At global scope: C:\Users\ass\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:56:5: error: 'DynamicJsonDocument' does not name a type DynamicJsonDocument prepareResponse(JsonDocument& requestMessage); ^ C:\Users\ass\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:57:5: error: 'DynamicJsonDocument' does not name a type DynamicJsonDocument prepareEvent(const char deviceId, const char action, const char cause) override; ^ C:\Users\ass\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:58:22: error: 'JsonDocument' has not been declared void sendMessage(JsonDocument& jsonMessage) override; ^ C:\Users\ass\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:100:24: error: 'DynamicJsonDocument' has not been declared void handleRequest(DynamicJsonDocument& requestMessage, interface_t Interface); ^ C:\Users\ass\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:101:25: error: 'DynamicJsonDocument' has not been declared void handleResponse(DynamicJsonDocument& responseMessage); ^ C:\Users\ass\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:103:5: error: 'DynamicJsonDocument' does not name a type DynamicJsonDocument prepareRequest(const char deviceId, const char action); ^ C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:115:27: error: 'JsonDocument' has not been declared void extractTimestamp(JsonDocument &message); ^ In file included from C:\Users\Lucas\AppData\Local\Temp\arduino_modified_sketch_510189\doorbell.ino:33:0: C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:265:1: error: 'DynamicJsonDocument' does not name a type DynamicJsonDocument SinricProClass::prepareRequest(const char deviceId, const char action) { ^ C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:281:37: error: variable or field 'handleResponse' declared void void SinricProClass::handleResponse(DynamicJsonDocument& responseMessage) { ^ C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:281:37: error: 'DynamicJsonDocument' was not declared in this scope C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:281:58: error: 'responseMessage' was not declared in this scope void SinricProClass::handleResponse(DynamicJsonDocument& responseMessage) { ^ C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:290:36: error: variable or field 'handleRequest' declared void void SinricProClass::handleRequest(DynamicJsonDocument& requestMessage, interface_t Interface) { ^ C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:2Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricPro90:36: error: 'DynamicJsonDocument' was not declared in this scope C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:290:57: error: 'requestMessage' was not declared in this scope void SinricProClass::handleRequest(DynamicJsonDocument& requestMessage, interface_t Interface) { ^ C:\Users\Lucas\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:290:85: error: expected primary-expression before 'Interface' void SinricProClass::handleRequest(DynamicJsonDocument& requestMessage, interface_t Interface) { ^ exit status 1

this is my problem help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! `/* Example for how to use SinricPro Doorbell device:

// 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

endif

ifdef ESP32

include

endif

include "SinricPro.h"

include "SinricProDoorbell.h"

define WIFI_SSID "ass"

define WIFI_PASS "shi#assonsthher"

define APP_KEY "asskey"

define APP_SECRET "secretass"

define DOORBELL_ID "fu@#"

define BAUD_RATE 9600 // Change baudrate to your need

// change this to your button PIN // on NodeMCU D3 / GPIO-0 is flash button PIN so you can use the builtin flash button

define BUTTON_PIN 0

// checkButtonpress // reads if BUTTON_PIN gets LOW and send Event void checkButtonPress() { static unsigned long lastBtnPress; unsigned long actualMillis = millis();

if (actualMillis - lastBtnPress > 500) { if (digitalRead(BUTTON_PIN) == LOW) {

  Serial.printf("Ding dong...\r\n");
  lastBtnPress = actualMillis;

  // get Doorbell device back
  SinricProDoorbell& myDoorbell = SinricPro[DOORBELL_ID];

  // send doorbell event
  myDoorbell.sendDoorbellEvent();
}

} }

// setup function for WiFi connection void setupWiFi() { Serial.printf("\r\n[Wifi]: Connecting"); WiFi.begin(WIFI_SSID, WIFI_PASS);

while (WiFi.status() != WL_CONNECTED) { Serial.printf("."); delay(250); } IPAddress localIP = WiFi.localIP(); Serial.printf("connected!\r\n[WiFi]: IP-Address is %d.%d.%d.%d\r\n", localIP[0], localIP[1], localIP[2], localIP[3]); }

// setup function for SinricPro void setupSinricPro() { // add doorbell device to SinricPro SinricPro.add(DOORBELL_ID); // setup SinricPro SinricPro.onConnected([]() { Serial.printf("Connected to SinricPro\r\n"); }); SinricPro.onDisconnected([]() { Serial.printf("Disconnected from SinricPro\r\n"); }); SinricPro.begin(APP_KEY, APP_SECRET); }

// main setup function void setup() { pinMode(BUTTON_PIN, INPUT_PULLUP); // BUTTIN_PIN as INPUT Serial.begin(BAUD_RATE); Serial.printf("\r\n\r\n"); setupWiFi(); setupSinricPro(); }

void loop() { checkButtonPress(); SinricPro.handle(); }`

lucasviniciu commented 4 years ago

help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

sivar2311 commented 4 years ago

"ensure all dependent libraries are installed" Seems missing ArduinoJson

lucasviniciu commented 4 years ago

thanks man @sivar2311

lucasviniciu commented 4 years ago

DONT WORK !!!!!

lucasviniciu commented 4 years ago

hello yes all are installed JSON and the latest version

Obter o Outlook para iOShttps://aka.ms/o0ukef


De: Boris Jäger notifications@github.com Enviado: Friday, August 21, 2020 6:22:32 PM Para: sinricpro/esp8266-esp32-sdk esp8266-esp32-sdk@noreply.github.com Cc: lucasviniciu lucasvinicius.lv149@outlook.com; Author author@noreply.github.com Assunto: Re: [sinricpro/esp8266-esp32-sdk] issue upload to arduino/esp8266 (nodemcu) (#84)

"ensure all dependent libraries are installed" Seems missing ArduinoJson

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/sinricpro/esp8266-esp32-sdk/issues/84#issuecomment-678520413, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKRBTPY6M5PTUHUADDEFANDSB3QRRANCNFSM4QHVTMKQ.

sivar2311 commented 4 years ago

You have to check again! All errors are related to ArduinoJson ('JsonDocument' has not been declared, 'serializeJson' was not declared....) So wether

Please read here about installation

If you use VS-Code, please use the provided platformio.ini file from example folders. This includes a section to install required libraries automaticly.

sivar2311 commented 4 years ago

Due to inactivity I assume that the problem has been solved. For this reason, the issue will be closed now. If there are still errors or questions related to this topic, please reopen this issue.