-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Irsend doesn't work for pioneer #6100
Comments
I can control my TV LG via YTF IR Bridge without any problems btw. |
Try instead of 0 the value of your needed frequency. |
Here is the log: |
So, I'll add some information: S-hadinger tried to help me, he has pioneer VSX-c300 which uses same ir codes as my pioneer VSX-820. |
After lots of trial and error it appears that ir timing on pioneer is 5% shorter than Nec, probably due to a frequency of 40kHz instead of 38kHz. Duty cycle is also different which means it can't be done with current code. I'll prepare a lightweight PR next week to solve this. |
Why all the trouble to make pioneer work using the NEC protocol? Irremote supports pioneer as a seperate protocol so that will probably work just fine. All it needs is enabling it (optionally) in IRremoteESP8266.h and make an entry in Tasmota. It isn't supported yet because I hate the way this can be implemented as it will increase tasmota code with every protocol enabled while at the same time I see no easy way in making protocols configurable at compile time. Also see this: #5853 (comment) |
Pioneer is a 64 bit protocol. It's basically two NEC 32bit (typically both different) messages back to back. See https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Pioneer.cpp#L31 if you want to learn more. |
I understand your concerns. This was my first option but it doesn't work. Irremote is wrong, it takes the assumption that nec and Pioneer have the same timings but they don't. Most devices still work but some don't. Please look at my PR first, it's basically 2 lines of code, calling sendGeneric with different timings. I'll measure the code increase. |
@crankyoldgit believe me it does make a difference. I know about the 64 bits difference, most simple commands like Vol+ are still 32 bits. I have the proof that the same sendNec() command with NEC timings or Pioneer timings - the first one fails the second works. Most Pioneer equipment don't care but some do. |
Pioneer detailed timings : http://www.adrian-kingston.com/IRFormatPioneer.htm |
@s-hadinger I'm happy to add a 40kHz sending variant with different timing etc to IRremoteESP8266 if you want. Just log an issue etc. I'm hesitant to change the FM of the existing |
FYI, the duty cycle on the Oscilloscope (per link) is pretty darn close to 33%, which is what the NEC spec says it is, and is what is used by FYI, the micro-second timings difference for 38kHz@33% vs 40kHz@33% during a "mark" signal are: Sure, there is a difference, not arguing that, but it's 1 micro-second. But hey, your hardware and experience says it matters. I believe you. Happy to help/try it out for you etc. Due to the limitations of the ESP8266 hardware, the library uses software PWM (there is no hardware PWM at that resolution on the platform, except for the serial line), and thus the practical limit of resolution is 1usec granularity. i.e. fractional usecs are completely out. I draw the line at counting cpu cycles to go to that level of precision. ;-) If I was to bet where the timing problem was based on experience with all the issues reported to me with the library and expected-device compatibility, 90+% of the time it's a total length of a "mark" / "space" component of the signal, not the underlying FM (<10%) and so far only once the underlying duty cycle. |
Oh, before you ask, the above reported timings do not include the 5usec delay in switching the GPIO on and off. e.g. 6(on) + 14(off) + 5(overhead) == 25usec wavelength == 40kHz. |
Thanks for the detailed answer. I changed 3 things to make it work: timing, freq and duty cycle. Let me check now which one is important. |
After more tests, it's not the frequency nor the duty cycle, just the timing. Changing the tick from 560 microseconds to 530 microseconds makes it work. |
@crankyoldgit I didn't realize your are the author of IRRemoteESP8266. Awesome work! I love it! I submitted a PR to IRRemoteESP8266 to adjust both frequency and timing. As you mentioned, duty cycle has no impact. @Oprtyo confirmed it works with VSX-820 and it works also with my VSX-C300 (that worked also with sendNEC). |
Fix send IRSend for Pioneer devices (#6100)
I have YTF IR Bridge with latest Tasmota and reciever Pioneer.
When I press turn on on remote control i recieve:
22:16:01 IRR: Echo 0, RawLen 68, Overflow 0, Bits 32, Value 0xA55A38C7, Decode 3
22:16:01 RSL: tele/sonoff/RESULT = {"IrReceived":{"Protocol":"NEC","Bits":32,"Data":"0xA55A38C7","RawData":[8522,4252,536,1586,534,538,532,1586,534,540,532,542,528,1588,532,542,528,1588,532,542,532,1586,534,538,506,1614,508,1610,532,540,532,1590,532,542,524,544,536,538,532,1586,534,1584,534,1588,534,536,534,540,532,538,534,1588,532,1586,534,540,532,540,532,538,534,1588,532,1586,534,1586,530],"RawDataInfo":[67,67,0]}}
When I do:
IrSend {"Protocol":"NEC","Bits":32,"Data":"0xA55A38C7"} - nothing
Irsend 0,8522,4252,536,1586,534,538,532,1586,534,540,532,542,528,1588,532,542,528,1588,532,542,532,1586,534,538,506,1614,508,1610,532,540,532,1590,532,542,524,544,536,538,532,1586,534,1584,534,1588,534,536,534,540,532,538,534,1588,532,1586,534,540,532,540,532,538,534,1588,532,1586,534,1586,530 - nothing
I've found Hex for my device in the web:
0000 0068 0000 0022 0168 00b4 0016 0043 0016 0016 0016 0043 0016 0016 0016 0016 0016 0043 0016 0016 0016 0043 0016 0016 0016 0043 0016 0016 0016 0043 0016 0043 0016 0016 0016 0043 0016 0016 0016 0016 0016 0016 0016 0043 0016 0043 0016 0043 0016 0016 0016 0016 0016 0016 0016 0043 0016 0043 0016 0016 0016 0016 0016 0016 0016 0043 0016 0043 0016 0043 0016 06d9
decoded it in IrScrutinizer and got:
9032,4516,552,1681,552,552,552,1681,552,552,552,552,552,1681,552,552,552,1681,552,552,552,1681,552,552,552,1681,552,1681,552,552,552,1681,552,552,552,552,552,552,552,1681,552,1681,552,1681,552,552,552,552,552,552,552,1681,552,1681,552,552,552,552,552,552,552,1681,552,1681,552,1681,552,43982 - which is pretty similar to received data in console.
tried irsend 0, 9032,4516,552,1681,552,552,552,1681,552,552,552,552,552,1681,552,552,552,1681,552,552,552,1681,552,552,552,1681,552,1681,552,552,552,1681,552,552,552,552,552,552,552,1681,552,1681,552,1681,552,552,552,552,552,552,552,1681,552,1681,552,552,552,552,552,552,552,1681,552,1681,552,1681,552 - nothing
probably the problem in frequency, because my device use protocol Pioneer (not nec)...
what should i put instead of 0 (38kHz) to get 40?
Maybe there is smth. else I should do?
The text was updated successfully, but these errors were encountered: