Ошибка компиляции для платы выхода NodeMCU 1.0 (модуль ESP-12E) 1 - PullRequest
0 голосов
/ 04 апреля 2020

Здравствуйте, я пытался сделать этот проект, и я получаю статус завершения 1 ошибка

мой код:

#include <WiFi.h>
#include <WiFiClientSecure.h>
#include "ArduinoJson.h"
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>





LiquidCrystal_I2C lcd(0x27,20,4);




WiFiClientSecure client;

unsigned long checkerStartTime = 300000;

void setup() {
  Serial.begin(115200);
  while (! Serial);
  lcd.begin();
  lcd.backlight();
  unsigned long wifiStart = millis();
  WiFi.begin("NETGEAR75", "rusticelephant208");
  while (WiFi.status() != WL_CONNECTED) {
    if (millis() - wifiStart > 10000) 
  Serial.println("Connected Wifi...");
   }
}

void loop() {

  if (millis() - checkerStartTime > 300000) {// 1hr timer
    checkerStartTime = millis();
    if (WiFi.status() != WL_CONNECTED)
    if (client.connect("cdc.gov", 443)) {
      Serial.println("connected to cdc...");

      String http = String("GET https://www.cdc.gov/coronavirus/2019-ncov/map-cases-us.json HTTP/1.1\r\nHost: cdc.gov\r\nConnection: close\r\nAccept: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n\r\n");
      client.print(http);
      Serial.println("requesting...");
      //let's wait for something to come back... only a few seconds
      unsigned long startTime = millis();
      while (millis() - startTime < 5000) {
        if (client.available()) {
          Serial.println("From Server");
          break;
        }
      }
      delay(1000);
      String jsonData = client.readStringUntil('{');

      jsonData = "{";
      startTime = millis();
      while (millis() - startTime < 1000) {
        if (client.available()) {
          jsonData.concat(char(client.read()));
          startTime = millis();
        }
      }
      client.stop();

      //https://arduinojson.org/v6/assistant/
      DynamicJsonDocument doc(20000);
      // Deserialize the JSON document
      deserializeJson(doc, jsonData);
      JsonObject obj = doc.as<JsonObject>();

      String cases = obj["data"];

      for (int i = 0; i < obj["data"].size(); i++) {
        String names = obj["data"][i]["Name"];
        //Serial.print(names);
        //Serial.print(" ");
        String cases = obj["data"][i]["Cases Reported"];
        //Serial.println(cases);
        if (names == "Florida") {
          Serial.print("Cases in Ohio = ");
          Serial.println(cases);


          lcd.setCursor(3, 0);
          lcd.println("Covid 19 Status");
          lcd.println("");
          lcd.println("");
          lcd.println("Cases Reported in: ");
          lcd.print("-> ");
          lcd.println(names);
          lcd.print("-> ");
          lcd.print(cases);
         }
      }
    }
  }
}   

и код ошибки, который я получаю,

Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"

In file included from C:\Users\moghd\OneDrive\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi\src/WiFiClientSecure.h:41:0,

                 from C:\Users\moghd\OneDrive\Desktop\arduino\sketch_apr04a\sketch_apr04a.ino:3:

C:\Users\moghd\OneDrive\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:262:36: error: expected ')' before '*' token

     WiFiClientSecure(ClientContext *client, const X509List *chain, unsigned cert_issuer_key_type,

                                    ^

C:\Users\moghd\OneDrive\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:264:35: error: expected ')' before '*' token

     WiFiClientSecure(ClientContext* client, const X509List *chain, const PrivateKey *sk,

                                   ^

C:\Users\moghd\OneDrive\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:38:5: error: 'BearSSL::WiFiClientSecure::~WiFiClientSecure()' marked override, but does not override

     ~WiFiClientSecure() override;

     ^

C:\Users\moghd\OneDrive\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:43:9: error: 'int BearSSL::WiFiClientSecure::connect(const String&, uint16_t)' marked override, but does not override

     int connect(const String& host, uint16_t port) override;

         ^

C:\Users\moghd\OneDrive\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:48:12: error: 'size_t BearSSL::WiFiClientSecure::write_P(const char*, size_t)' marked override, but does not override

     size_t write_P(PGM_P buf, size_t size) override;

            ^

C:\Users\moghd\OneDrive\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:60:12: error: 'size_t BearSSL::WiFiClientSecure::peekBytes(uint8_t*, size_t)' marked override, but does not override

     size_t peekBytes(uint8_t *buffer, size_t length) override;

            ^

C:\Users\moghd\OneDrive\Desktop\arduino\sketch_apr04a\sketch_apr04a.ino: In function 'void setup()':

C:\Users\moghd\OneDrive\Desktop\arduino\sketch_apr04a\sketch_apr04a.ino:27:46: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

   WiFi.begin("NETGEAR76", "rusticelephant208");

                                              ^

Multiple libraries were found for "LiquidCrystal_I2C.h"
 Used: C:\Users\moghd\OneDrive\Documents\Arduino\libraries\LiquidCrystal_I2C-master
 Not used: C:\Users\moghd\OneDrive\Documents\Arduino\libraries\LiquidCrystal_I2C-1.1.2
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Как мне это исправить? Я попытался перезапустить все, и ничего не работает. я создаю этот код для извлечения данных json и отображения его на экране i2 c lcd. ESP8266, 20 на 4 I2 C LCD - используемое оборудование.

...