You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IRremote8266 2.8.6
esp32 Board library 3.0.4 (Bug only happens on 3.* and works fine on 2.*
Describe the bug
There seems to be a difference in the Timer Implementation in the newest esp32 library breaking the code in this library see Error below.
d:\Daten\Benutzer\Lars\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp: In function 'void gpio_intr()':
d:\Daten\Benutzer\Lars\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp:246:3: error: 'timerAlarmEnable' was not declared in this scope; did you mean 'timerAlarm'?
246 | timerAlarmEnable(timer);
| ^~~~~~~~~~~~~~~~
| timerAlarm
d:\Daten\Benutzer\Lars\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp: In member function 'void IRrecv::enableIRIn(bool)':
d:\Daten\Benutzer\Lars\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp:362:21: error: too many arguments to function 'hw_timer_t* timerBegin(uint32_t)'
362 | timer = timerBegin(_timer_num, 80, true);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\Lars\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.4\cores\esp32/esp32-hal.h:84,
from C:\Users\Lars\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.4\cores\esp32/Arduino.h:36,
from d:\Daten\Benutzer\Lars\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.h:10,
from d:\Daten\Benutzer\Lars\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp:6:
C:\Users\Lars\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.4\cores\esp32/esp32-hal-timer.h:35:13: note: declared here
35 | hw_timer_t *timerBegin(uint32_t frequency);
| ^~~~~~~~~~
d:\Daten\Benutzer\Lars\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp:371:3: error: 'timerAlarmWrite' was not declared in this scope; did you mean 'timerWrite'?
371 | timerAlarmWrite(timer, MS_TO_USEC(params.timeout), ONCE);
| ^~~~~~~~~~~~~~~
| timerWrite
d:\Daten\Benutzer\Lars\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp:375:23: error: too many arguments to function 'void timerAttachInterrupt(hw_timer_t*, void (*)())'
375 | timerAttachInterrupt(timer, &read_timeout, false);
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Lars\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.4\cores\esp32/esp32-hal-timer.h:50:6: note: declared here
50 | void timerAttachInterrupt(hw_timer_t *timer, void (*userFunc)(void));
| ^~~~~~~~~~~~~~~~~~~~
d:\Daten\Benutzer\Lars\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp: In member function 'void IRrecv::disableIRIn()':
d:\Daten\Benutzer\Lars\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp:401:3: error: 'timerAlarmDisable' was not declared in this scope
401 | timerAlarmDisable(timer);
| ^~~~~~~~~~~~~~~~~
d:\Daten\Benutzer\Lars\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp: In member function 'void IRrecv::resume()':
d:\Daten\Benutzer\Lars\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp:429:3: error: 'timerAlarmDisable' was not declared in this scope
429 | timerAlarmDisable(timer);
| ^~~~~~~~~~~~~~~~~
exit status 1
To Reproduce
Use newest ESP32 Library and try to compile any of the Example Programs
Example code used
#include<WiFi.h>#include<PubSubClient.h>#include<IRremoteESP8266.h>#include<IRsend.h>#include<ir_Coolix.h>#include<ArduinoOTA.h>// OTA-Bibliothek hinzufügen#include<esp32-hal-timer.h>// WLAN-Konfigurationconstchar*ssid="xxxx";
constchar*password="xxxx";
unsigned longpreviousMillis=0; // Variable, um den letzten Zeitpunkt zu speichernconstunsigned longinterval=90000; // 1,5 Minuten in Millisekunden// MQTT-Konfigurationconstchar*mqtt_server="192.168.xxx.xxx";
constchar*topic_mode="/Klima_Wohnen/mode";
constchar*topic_temp="/Klima_Wohnen/solltemp";
constchar*topic_ifeel="/Klima_Wohnen/isttemp";
intsenstemp;
// IR-Sende-Pinconstuint16_tkIrLed=2; // GPIO4, kann entsprechend angepasst werdenIRCoolixACac(kIrLed); // Instanz der KlimaanlageWiFiClientespClient;
PubSubClientclient(espClient);
// Funktion zur Verarbeitung eingehender MQTT-Nachrichtenvoidcallback(char*topic, byte*payload, unsigned intlength) {
StringmessageTemp;
for (inti=0; i<length; i++) {
messageTemp+= (char)payload[i];
}
if (String(topic) ==topic_mode) {
intmode=messageTemp.toInt();
switch (mode) {
case0:
ac.off();
break;
case1:
ac.on();
ac.setMode(kCoolixCool);
break;
case2:
ac.on();
ac.setMode(kCoolixHeat);
break;
case3:
ac.on();
ac.setMode(kCoolixAuto);
break;
default:
break;
}
ac.send();
}
if (String(topic) ==topic_temp) {
uint8_ttemperature=messageTemp.toInt();
ac.setTemp(temperature);
ac.send();
}
if (String(topic) ==topic_ifeel) {
senstemp=messageTemp.toInt();
}
}
// WLAN verbindenvoidsetup_wifi() {
delay(10);
Serial.println();
Serial.print("Verbinde mit WLAN: ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() !=WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WLAN verbunden");
Serial.print("IP Adresse: ");
Serial.println(WiFi.localIP());
}
// MQTT wiederverbindenvoidreconnect() {
while (!client.connected()) {
Serial.print("Verbinde mit MQTT...");
if (client.connect("ESP8266Client")) {
Serial.println("verbunden");
client.subscribe(topic_mode, 1);
client.subscribe(topic_temp, 1);
client.subscribe(topic_ifeel, 1); // Stelle sicher, dass wir auf dieses Topic auch abonnieren
} else {
Serial.print("Fehler, rc=");
Serial.print(client.state());
Serial.println(" erneut versuchen in 5 Sekunden");
delay(5000);
}
}
}
// OTA Initialisierungvoidsetup_ota() {
ArduinoOTA.setHostname("IR-Klimaanlage");
// Optional: OTA Passwort setzenArduinoOTA.setPassword("xxxx");
ArduinoOTA.onStart([]() {
Stringtype;
if (ArduinoOTA.getCommand() ==U_FLASH) {
type="Sketch";
} else { // U_SPIFFStype="Filesystem";
}
// Ausgeben von Informationen, was aktualisiert wirdSerial.println("Start updating "+type);
});
ArduinoOTA.onEnd([]() {
Serial.println("\nEnde des OTA-Updates");
ESP.restart();
});
ArduinoOTA.onProgress([](unsigned intprogress, unsignedinttotal) {
Serial.printf("Fortschritt: %u%%\r", (progress / (total / 100)));
});
ArduinoOTA.onError([](ota_error_terror) {
Serial.printf("Fehler[%u]: ", error);
if (error==OTA_AUTH_ERROR) {
Serial.println("Authentifizierungsfehler");
} elseif (error==OTA_BEGIN_ERROR) {
Serial.println("Fehler beim Starten");
} elseif (error==OTA_CONNECT_ERROR) {
Serial.println("Verbindungsfehler");
} elseif (error==OTA_RECEIVE_ERROR) {
Serial.println("Empfangsfehler");
} elseif (error==OTA_END_ERROR) {
Serial.println("Fehler beim Abschluss");
}
});
ArduinoOTA.begin();
}
voidsetup() {
Serial.begin(115200);
setup_wifi();
client.setServer(mqtt_server, 1883);
client.setCallback(callback);
setup_ota(); // OTA Setup hinzufügenac.begin();
ac.on(); // Einschalten der Klimaanlageac.setMode(kCoolixAuto); // Starten im Automatikmodusac.setTemp(24); // Standardtemperatur einstellenac.send(); // Sende initiale Befehle
}
voidifeel() {
ac.setSensorTemp(senstemp);
ac.setZoneFollow(true);
ac.send();
}
voidloop() {
unsigned longcurrentMillis=millis(); // Aktuelle Zeit in Millisekundenif (!client.connected()) {
reconnect();
}
if (currentMillis-previousMillis >= interval) {
previousMillis=currentMillis; // Aktualisiere den letzten Zeitpunktifeel(); // Rufe die Funktion auf
}
client.loop();
ArduinoOTA.handle(); // OTA-Handler in der Loop-Funktion
}
Version/revision of the library used
IRremote8266 2.8.6
esp32 Board library 3.0.4 (Bug only happens on 3.* and works fine on 2.*
Describe the bug
There seems to be a difference in the Timer Implementation in the newest esp32 library breaking the code in this library see Error below.
To Reproduce
Use newest ESP32 Library and try to compile any of the Example Programs
Example code used
I have followed the steps in the Troubleshooting Guide & read the FAQ
Yes no apliccable solution found
Has this library/code previously worked as expected for you?
yes worked fine for ESP8266 and Works with my ESP32 if i downgrade the esp32 library from 3.0.4 to 2.0.17
Other useful information
It works fine with the older esp32 library tested with 2.0.17
Bug only happens on 3.*
The text was updated successfully, but these errors were encountered: