Skocz do zawartości

esp32 błąd biblioteki


Pomocna odpowiedź

Napisano

Posiadam esp32 C3 DevkitC 02 v1.1  W arduino 1.8.13 na linuksie wybieram płytkę ESP32C3 DevModule. Wgrywam próbny szkic

/*
 *  This sketch sends data via HTTP GET requests to data.sparkfun.com service.
 *
 *  You need to get streamId and privateKey at data.sparkfun.com and paste them
 *  below. Or just customize this script to talk to other HTTP servers.
 *
 */

#include <WiFi.h>

const char* ssid     = "your-ssid";
const char* password = "your-password";

const char* host = "data.sparkfun.com";
const char* streamId   = "....................";
const char* privateKey = "....................";

void setup()
{
    Serial.begin(115200);
    delay(10);

    // We start by connecting to a WiFi network

    Serial.println();
    Serial.println();
    Serial.print("Connecting to ");
    Serial.println(ssid);

    WiFi.begin(ssid, password);

    while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
    }

    Serial.println("");
    Serial.println("WiFi connected");
    Serial.println("IP address: ");
    Serial.println(WiFi.localIP());
}

int value = 0;

void loop()
{
    delay(5000);
    ++value;

    Serial.print("connecting to ");
    Serial.println(host);

    // Use WiFiClient class to create TCP connections
    WiFiClient client;
    const int httpPort = 80;
    if (!client.connect(host, httpPort)) {
        Serial.println("connection failed");
        return;
    }

    // We now create a URI for the request
    String url = "/input/";
    url += streamId;
    url += "?private_key=";
    url += privateKey;
    url += "&value=";
    url += value;

    Serial.print("Requesting URL: ");
    Serial.println(url);

    // This will send the request to the server
    client.print(String("GET ") + url + " HTTP/1.1\r\n" +
                 "Host: " + host + "\r\n" +
                 "Connection: close\r\n\r\n");
    unsigned long timeout = millis();
    while (client.available() == 0) {
        if (millis() - timeout > 5000) {
            Serial.println(">>> Client Timeout !");
            client.stop();
            return;
        }
    }

    // Read all the lines of the reply from server and print them to Serial
    while(client.available()) {
        String line = client.readStringUntil('\r');
        Serial.print(line);
    }

    Serial.println();
    Serial.println("closing connection");
}

I mam taki błąd 

UWAGA: Kategoria '' w bibliotece ESP RainMaker jest nieprawidłowa. Ustawiono na 'Uncategorized'
UWAGA: Kategoria '' w bibliotece WiFiProv jest nieprawidłowa. Ustawiono na 'Uncategorized'
Szkic używa 661010 bajtów (50%) pamięci programu. Maksimum to 1310720 bajtów.
Zmienne globalne używają 33140 bajtów (10%) pamięci dynamicznej, pozostawiając 294540 bajtów dla zmiennych lokalnych. Maksimum to 327680 bajtów.
esptool.py v4.2.1
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP32-C3 (revision 3)
Features: Wi-Fi
Crystal is 40MHz
MAC: 58:cf:79:1e:f3:a4
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00003fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x000b5fff...
Compressed 12944 bytes to 9297...
Writing at 0x00000000... (100 %)
Wrote 12944 bytes (9297 compressed) at 0x00000000 in 0.4 seconds (effective 252.2 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.1 seconds (effective 311.7 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.2 seconds (effective 404.0 kbit/s)...
Hash of data verified.
Compressed 678880 bytes to 413180...
Writing at 0x00010000... (3 %)
Writing at 0x0001b7d0... (7 %)
Writing at 0x000251a4... (11 %)
Writing at 0x0002c979... (15 %)
Writing at 0x000324f3... (19 %)
Writing at 0x00039708... (23 %)
Writing at 0x0003f6e6... (26 %)
Writing at 0x000455a4... (30 %)
Writing at 0x0004b305... (34 %)
Writing at 0x00051130... (38 %)
Writing at 0x000573ce... (42 %)
Writing at 0x0005cfe9... (46 %)
Writing at 0x0006309f... (50 %)
Writing at 0x00068b4a... (53 %)
Writing at 0x0006eb1f... (57 %)
Writing at 0x00074bb0... (61 %)
Writing at 0x0007a893... (65 %)
Writing at 0x00080863... (69 %)
Writing at 0x00086ba2... (73 %)
Writing at 0x0008cfa2... (76 %)
Writing at 0x00093443... (80 %)
Writing at 0x000999c0... (84 %)
Writing at 0x0009f745... (88 %)
Writing at 0x000a7445... (92 %)
Writing at 0x000adfc7... (96 %)
Writing at 0x000b4518... (100 %)
Wrote 678880 bytes (413180 compressed) at 0x00010000 in 10.2 seconds (effective 531.7 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

 

14 minut temu, ethanak napisał:

Gdzie ten błąd?

UWAGA: Kategoria '' w bibliotece ESP RainMaker jest nieprawidłowa. Ustawiono na 'Uncategorized'
UWAGA: Kategoria '' w bibliotece WiFiProv jest nieprawidłowa. Ustawiono na 'Uncategorized'

 

#define KONTAKTRON 18
 
void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
 
  pinMode(KONTAKTRON, INPUT_PULLUP); //Kontaktron jako wejście
  
  digitalWrite(LED_BUILTIN, LOW); //Dioda wyłączona
  
}
 
void loop() {
  if (digitalRead(KONTAKTRON) == LOW) { //Jeśli czujnik zwarty
 //Stan OK - dioda swieci caly czas
    digitalWrite(LED_BUILTIN, HIGH);
  } else {
    digitalWrite(LED_BUILTIN, HIGH);
    delay(1000);//Stan ALARM - dioda  mruga
    digitalWrite(LED_BUILTIN, LOW);
    delay(1000);
  }
}

Wbudowania dioda nie miga.

@Michal88 raz, że upewniłbym się czy LED_BUILTIN odpowiada 8. A dwa, to "adresowalny LED RGB" jest aliasem na "ciut bardziej skomplikowany". Czyli nie miga się nim tak po prostu przełączając pin. Na podlinkowanej przez Ciebie stronie w stopce jest do pobrania schemat. W nim widać, że dioda to SK68XXMINI-HS. A po wklejeniu tego do wyszukiwarki od razu znajduje się dokumentacja tej diody. W niej jest opisany protokół komunikacji z owym elementem. Bo RGB, czyli masz tam trzy diody w jednej obudowie, z których można uzyskać wszelkie kolory tęczy, wysyłając do diody odpowiednie polecenie.

To tyle co widzę na szybko. Myślę, że jak się postarasz z wyszukiwarką, to znajdziesz gdzieś gotowy przykład do Twojej płytki i/lub info o bibliotece, która komunikację zrobi za Ciebie.

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

To działa

Bądź aktywny - zaloguj się lub utwórz konto!

Tylko zarejestrowani użytkownicy mogą komentować zawartość tej strony

Utwórz konto w ~20 sekund!

Zarejestruj nowe konto, to proste!

Zarejestruj się »

Zaloguj się

Posiadasz własne konto? Użyj go!

Zaloguj się »
×
×
  • Utwórz nowe...