Comments (18)
Yes, the receiver part was not implemented yet. I edited the description for now, and I will implement it later
from irremoteesp8266.
Cool. Looking forward to it. Do you think it will be hard to implement, and where do you see the challenges?
Would you be interested in some more complex example sketches, like supporting sending Pronto Hex codes which are popular on the web? (I am working on it.)
from irremoteesp8266.
Well I have no experience with timers and interrupts on ESP8266, so that will be a pretty big challenge for me :D Also someone else started to implement it, and got issues with the receiving part: http://www.esp8266.com/viewtopic.php?f=33&t=3357#p19122 So it probably won't be easy
from irremoteesp8266.
Yes, PaulDG's comment reads like he got receiving working by using https://sui77.wordpress.com/2011/05/27/use-any-arduino-pin-for-transmission-with-the-irremote-libary-by-soft-pwm/ plus some changes he describes on the page you linked. Did you try that?
Also it looks like https://github.com/sh4d0w12/esp8266_irlib/blob/master/user/user_main.c does what we'd need, maybe you can make use of that too?
from irremoteesp8266.
Not yet, I don't have too much time right now. And originally I only needed the sending part (I recorded the codes with Arduino previously), that's why I did not implemented it back then.
from irremoteesp8266.
This works for me, it gives the raw timings. From there it could be hooked into the existing decoding algorithms.
#define receiver_pin 2
#define max_pulses 700
unsigned int raw_array[max_pulses];
volatile bool is_on; // volatile = set by ISR
volatile unsigned long this_change_micros; // volatile = set by ISR
bool was_on;
unsigned long this_loop_micros, previous_loop_micros, previous_change_micros = 0;
unsigned int i_pulses, i = 0;
// Keep isr() as short as possible
void isr() {
this_change_micros = micros();
is_on = digitalRead(2);
}
void setup() {
Serial.begin(115200);
pinMode(receiver_pin, INPUT);
was_on = digitalRead(receiver_pin);
is_on = was_on = previous_loop_micros = 0;
previous_change_micros = this_change_micros = micros();
attachInterrupt(receiver_pin, isr, CHANGE);
}
void loop() {
this_loop_micros = micros();
if (was_on != is_on && i_pulses < max_pulses) {
raw_array[i_pulses++] = (this_change_micros - previous_change_micros);
previous_change_micros = this_change_micros;
previous_loop_micros = this_loop_micros;
was_on = is_on;
}
if (is_on && i_pulses > 0 && (i_pulses == max_pulses || (this_loop_micros - previous_loop_micros) > 100000)) {
for (i = 1; i < i_pulses; i++) {
if (raw_array[i - 1] > 10000) // Assuming that everything above 10ms indicates a repeat
Serial.println("");
if (i % 2 == 0)
Serial.print("-");
else
Serial.print("+");
Serial.print(raw_array[i]);
Serial.print(" ");
}
Serial.println("-99999");
i_pulses = 0;
}
}
from irremoteesp8266.
Thanks for the code. I tried it yesterday, but it didn't worked for me. It seemed as loop() would stop after a couple of minute and I didn't have time to debug it yet. But the interrupt part certainly works, so I will try to rewrite the receiving part of the library using it.
from irremoteesp8266.
Guys anything new regarding the receive part? we need a way to receive raw value and decode it to be used within the system.
Appreciate your hard work
from irremoteesp8266.
Same here. Any progress on enabling the receiver part? Would be amazing!
from irremoteesp8266.
So I tried @probonopd sketch. instead of GPIO2 I used GPI14 on an ESP-12.
It is working now but everything i get doesn't look like distinct IR codes form my remote (this is pressing 3 times the same button):
+4384 -630 +491 -629 +491 -629 +494 -626 +491 -628 +493 -629 +491 -628 +493 -627 +492 -628 +1610 -627 +1610 -627 +1606 -628 +1611 -627 +1607 -629 +1607 -628 +1610 -627 +1609 -626 +495 -626 +492 -627 +1609 -628 +1608 -628 +492 -628 +496 -623 +496 -624 +494 -628 +1610 -626 +1610 -626 +492 -628 +493 -627 +1611 -624 +1612 -626 +1608 -629 +1610 -625 +38854
-9044 +2152 -629 -99999+9016 -4389 +624 -497 +624 -496 +623 -497 +623 -497 +622 -498 +624 -495 +624 -497 +623 -499 +621 -1611 +625 -1613 +622 -1613 +623 -1613 +623 -1613 +623 -1614 +624 -1611 +625 -1612 +624 -495 +624 -496 +625 -495 +625 -1612 +623 -1613 +625 -496 +624 -496 +622 -495 +626 -1613 +624 -1611 +625 -1612 +624 -498 +623 -496 +625 -1614 +623 -1610 +625 -1613 +623 -99999
+9041 -4384 +630 -493 +626 -494 +626 -491 +629 -490 +630 -491 +627 -493 +627 -493 +627 -492 +628 -1607 +629 -1609 +627 -1606 +628 -1610 +625 -1609 +628 -1606 +627 -1608 +630 -1607 +627 -493 +627 -1608 +628 -1608 +629 -1606 +628 -1608 +627 -493 +628 -1607 +628 -491 +628 -1607 +628 -492 +627 -493 +627 -494 +625 -493 +626 -1609 +629 -491 +628 -1607 +627 -38854
+9042 -2151 +629 -99999
from irremoteesp8266.
If your expecting the same EXACT bunch of #'s to appear then this will not happen, I do not know the coding of your remote, but all these #'s do look good, they are all +- a few counts from one another, you need to feed this data into a decoder and you will I think get real keypresses out!
from irremoteesp8266.
Alright. This helps me out a lot since I know now where to go. The problem is, as of now, there doesn't seem to be any compatible IR decoder for the ESP8266 as they all rely on the AVR/io.h and AVR/interrupt.h. And this is exactly the same problem why IRremote.h doesn't work in the first place.
So, I'm receiving IR signals but sadly I can't do anything with them on the ESP8266.
Isn't there a way to get the io.h and interrupt.h working on the ESP8266?
from irremoteesp8266.
@ildr3him the fact that you got these codes shows that they were received properly without the need for AVR/io.h or AVR/interrupt.h. It is not simply a matter of feeding these timings into the decoding software (which should not need AVR/io.h or AVR/interrupt.h) in order to get it decoded.
However, note that markszabo mentioned the receiving code stops working after a couple of minutes which could be an indication for a leak somewhere. So I haven't given up hope yet for markszabo to find some time and implement the receiving :-)
from irremoteesp8266.
Hi everyone !
I'm happy to announce that I have just finished to implement the IR decoder on ESP8266 Arduino ! It works perfectly with my Panasonic & Samsung remote controls !
I need to clean my code & finish to test the IR sending and I'll publish the code this week !
For now, I must go to sleep , it's late in France ;)
ir decode on esp
from irremoteesp8266.
@sebastienwarin these are great news!! I can't wait to try it out :)
from irremoteesp8266.
I just publish my library with the receiving part : https://github.com/sebastienwarin/IRremoteESP8266
Have fun ;)
from irremoteesp8266.
@sebastienwarin you are them man! :D
from irremoteesp8266.
Sorry guys, I didn't have the time to contribute to this, but great job, thank you 👍
I'm new to github, so is there any way to merge your work to my repo with giving you the credits? I think you should submit a pull request, but I'm not sure
from irremoteesp8266.
Related Issues (20)
- IRHaierAC160 light toggle only working every 2nd time
- Unable to include C libraries HOT 3
- How to get or find CarrierAc 32 bit protocol? HOT 1
- Common AC Control - Swing turn on HOT 1
- Toshiba AC Remote Control B Support HOT 1
- Feature Request: De'Longhi Pinguino PAC N82 ECO IR Protocol HOT 5
- DAIKIN IRHVAC Off Issue. HOT 1
- The implementation and declaration of some functions differs from the function call HOT 4
- Coolix protocol "fan only mode" sends "dry mode" command instead HOT 1
- Support for Carrier RG56CMI-WRAC1 HOT 1
- Got error messages in Arduino IDE v3.0.1(ESP32C3) something like timerAlarm or void gpio_intr() HOT 1
- making a ir hub HOT 1
- FUNIKI AC remote (85 bits) need to be supported!
- Support for 'quiet' mode in COOLIX protocol
- Using any other mode than "Cool" causes AC to turn off. HOT 6
- Solution to AC remote giving different data for same button pressed HOT 2
- timer-related functions in IRrecv.cpp need to be updated HOT 2
- [XIAO_ESP32C6] IRrecv.cpp:246:3: error: 'timerAlarmEnable' was not declared in this scope; did you mean 'timerAlarm'? HOT 3
- Add compatibility with ESP32 Espressif 3.x HOT 1
- Support for LG AKB75735421 (for models newer than 2022) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from irremoteesp8266.