From 97a68a247ecd6466ae15bdd6c8941a4de39f7d75 Mon Sep 17 00:00:00 2001 From: Florian <1technophile@users.noreply.github.com> Date: Tue, 11 Jul 2017 20:38:30 +0200 Subject: [PATCH] integrate V2.X.X of irremote esp8266 library (#72) * Compatibility with IRRemoteESP8266 V2 --- .travis.yml | 2 +- ZgatewayIR.ino | 11 ++++++----- libraries/IRremote | 2 +- libraries/IRremoteESP8266 | 2 +- libraries/pubsubclient | 2 +- libraries/rcswitch | 2 +- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index c442ec6..54e86dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ install: - wget https://github.com/z3t0/Arduino-IRremote/archive/2.1.0.zip -O /tmp/IRremote.zip - unzip /tmp/IRremote.zip -d /usr/local/share/arduino/libraries - rm -rf /usr/local/share/arduino/libraries/RobotIRremote - - wget https://github.com/markszabo/IRremoteESP8266/archive/v1.2.0.zip -O /tmp/IRremoteESP8266.zip + - wget https://github.com/markszabo/IRremoteESP8266/archive/v2.1.1.zip -O /tmp/IRremoteESP8266.zip - unzip /tmp/IRremoteESP8266.zip -d /usr/local/share/arduino/libraries - git clone https://github.com/ekstrand/ESP8266wifi /usr/local/share/arduino/libraries/ESP8266wifi - wget https://github.com/knolleary/pubsubclient/archive/v2.6.zip -O /tmp/pubsubclient.zip diff --git a/ZgatewayIR.ino b/ZgatewayIR.ino index b73f973..6fa77d4 100644 --- a/ZgatewayIR.ino +++ b/ZgatewayIR.ino @@ -29,6 +29,8 @@ #ifdef ESP8266 #include + #include // Needed if you want to send IR commands. + #include // Needed if you want to receive IR commands. IRrecv irrecv(IR_RECEIVER_PIN); IRsend irsend(IR_EMITTER_PIN); #else @@ -92,7 +94,7 @@ void MQTTtoIR(char * topicOri, char * datacallback) { // IR DATA ANALYSIS //send received MQTT value by IR signal boolean signalSent = false; - unsigned long data = 0; + uint64_t data = 0; String strcallback = String(datacallback); trc(String(datacallback)); int s = strcallback.length(); @@ -111,7 +113,7 @@ void MQTTtoIR(char * topicOri, char * datacallback) { else if(strstr(topicOri, "IR_GC") != NULL){ // sending GC data from https://irdb.globalcache.com trc("IR_GC"); //buffer allocation from char datacallback - unsigned int GC[count+1]; + uint16_t GC[count+1]; String value = ""; int j = 0; for(int i = 0; i < s; i++) @@ -134,7 +136,7 @@ void MQTTtoIR(char * topicOri, char * datacallback) { else if(strstr(topicOri, "IR_Raw") != NULL){ // sending Raw data trc("IR_Raw"); //buffer allocation from char datacallback - unsigned int Raw[count+1]; + uint16_t Raw[count+1]; String value = ""; int j = 0; for(int i = 0; i < s; i++) @@ -157,7 +159,7 @@ void MQTTtoIR(char * topicOri, char * datacallback) { //We look into the subject to see if a special Bits number is defined String topic = topicOri; int valueRPT = 0; - int valueBITS = 0; + unsigned int valueBITS = 0; int pos = topic.lastIndexOf(IRbitsKey); if (pos != -1){ pos = pos + +strlen(IRbitsKey); @@ -255,7 +257,6 @@ void MQTTtoIR(char * topicOri, char * datacallback) { boolean result = client.publish(subjectGTWIRtoMQTT, datacallback); if (result){ trc(F("MQTTtoIR OK ack published")); - trc(String(data)); }; } irrecv.enableIRIn(); // ReStart the IR receiver (if not restarted it is not able to receive data) diff --git a/libraries/IRremote b/libraries/IRremote index 841e77a..eb7a0be 160000 --- a/libraries/IRremote +++ b/libraries/IRremote @@ -1 +1 @@ -Subproject commit 841e77a642120f47e0b71e8c6e39a9054aa6fd3c +Subproject commit eb7a0bee7d3e3b5d8927dfc47138bb85bf486eb1 diff --git a/libraries/IRremoteESP8266 b/libraries/IRremoteESP8266 index 0222d97..bad6676 160000 --- a/libraries/IRremoteESP8266 +++ b/libraries/IRremoteESP8266 @@ -1 +1 @@ -Subproject commit 0222d973678aaf91f155884250f46472ba2cb2ee +Subproject commit bad6676cae050cc8874768250be68b1c84c74ac6 diff --git a/libraries/pubsubclient b/libraries/pubsubclient index f46d001..dddfffb 160000 --- a/libraries/pubsubclient +++ b/libraries/pubsubclient @@ -1 +1 @@ -Subproject commit f46d0011ee92b4af9ee2a815da59b6c453f081a4 +Subproject commit dddfffbe0c497073d960f3b9f83c8400dc8cad6d diff --git a/libraries/rcswitch b/libraries/rcswitch index f820d2e..cf4b005 160000 --- a/libraries/rcswitch +++ b/libraries/rcswitch @@ -1 +1 @@ -Subproject commit f820d2e46ab227ac800960b57cdefc8f912006c6 +Subproject commit cf4b0053d72bbfa6831d6ff636dbd249ec385cff