Erst einmal hallo. Das ist mein erster Post hier, ein Fehler treibt mich hierher. Ich versuche ein Beispiel zur Steuerung eines ESP8266 Boards nachzumachen, es kommt aber besagter Fehler.
Die Fehlerausgabe des Compilers ist sehr lang, deshalb habe ich es als Textdatei angehängt. Mein Quelltext lautet:
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include "fauxmoESP.h"
#include "credentials.h"
#define SERIAL_BAUDRATE 115200
#define LED 2
fauxmoESP fauxmo;
// -----------------------------------------------------------------------------
// Wifi
// -----------------------------------------------------------------------------
void wifiSetup() {
// Set WIFI module to STA mode
WiFi.mode(WIFI_STA);
// Connect
Serial.printf("[WIFI] Connecting to %s ", WIFI_SSID);
WiFi.begin(WIFI_SSID, WIFI_PASS);
// Wait
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(100);
}
Serial.println();
// Connected!
Serial.printf("[WIFI] STATION Mode, SSID: %s, IP address: %s\n", WiFi.SSID().c_str(), WiFi.localIP().toString().c_str());
}
void setup() {
// Init serial port and clean garbage
Serial.begin(SERIAL_BAUDRATE);
Serial.println();
Serial.println();
// Wifi
wifiSetup();
// LED
pinMode(LED, OUTPUT);
digitalWrite(LED, HIGH);
// You can enable or disable the library at any moment
// Disabling it will prevent the devices from being discovered and switched
fauxmo.enable(true);
// Add virtual devices
unsigned char device_1 = fauxmo.addDevice("Arduino");
//unsigned char device_2 = fauxmo.addDevice("light two");
//unsigned char device_3 = fauxmo.addDevice("light three");
//unsigned char device_4 = fauxmo.addDevice("light four");
// fauxmoESP 2.0.0 has changed the callback signature to add the device_id, this WARRANTY
// it's easier to match devices to action without having to compare strings.
fauxmo.onMessage([](unsigned char device_id, const char * device_name, bool state) {
Serial.printf("[MAIN] Device #%d (%s) state: %s\n", device_id, device_name, state ? "ON" : "OFF");
digitalWrite(LED, !state);
});
//fauxmo.renameDevice(device_2, "light five");
}
void loop() {
// Since fauxmoESP 2.0 the library uses the "compatibility" mode by
// default, this means that it uses WiFiUdp class instead of AsyncUDP.
// The later requires the Arduino Core for ESP8266 staging version
// whilst the former works fine with current stable 2.3.0 version.
// But, since it's not "async" anymore we have to manually poll for UDP
// packets
fauxmo.handle();
static unsigned long last = millis();
if (millis() - last > 5000) {
last = millis();
Serial.printf("[MAIN] Free heap: %d bytes\n", ESP.getFreeHeap());
}
}
Ich versuche dieses Beispiel nachzumachen:
Das verwendete Board ist (Achtung Link zur Bezugsquelle)
Hier die gewünschten Links zu den sources:
https://bitbucket.org/xoseperez/fauxmoesp/downloads/
Verwendete Arduino IDE ist 1.8.5
Es scheint sich um einen Typfehler long int zu handeln?
Edit Lösung:
Die ESPAsyncTCP-Library hat in der Version von vor 16 Tagen ein Update bekommen, bei dem einige (sehr viele) Variablen von var auf long int geändert wurden. Mit einer alten Version aus März! geht es. der Link hierzu ist
Die funktionierende Version heißt "ESPAsyncTCP-9af5ab0399318599820c4711acae0518dd09d89f.zip"
Fehlerausgabe.txt (31 KB)