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
XMP Protocol Support #1414
Comments
@alexyao2015 Yes, it should be do-able to implement the XMP protocol. However, reading those sites, I'm not to familiar with their protocol descriptions, so I'd like you to supply some data by following: https://github.com/crankyoldgit/IRremoteESP8266/wiki/Adding-support-for-a-new-IR-protocol Skimming the protocol descriptions, the protocol uses a I'll need the Raw data (per that Wiki page) to make sure I understand what the protocol is doing, and have something to test against. e.g. All the descriptions of a protocol pale to measuring the "real" thing. ;-) |
@crankyoldgit The following is an Excel spreadsheet of several different buttons from the XR2 remote specifically (should be the same as an XR11 as well). In each sheet, I pressed the button down once and held it down. Unfortunately with that sheet, I failed to correctly record the entire length of the 2 packets of data sent so it appears as 3 packets instead (in 1,2,1,3,1,3 order). Its the same data, however, it misses out on the crucial To supplement the spreadsheet, here are some button presses with more data with the 2 packets properly separated. You will notice that the packets here have a spacing of ~ Lastly in case I was not clear, the program IRScrutinizer has the ability to actually generate the raw timings without noise so you have a perfect spec of the protocol. Hope this helps! Please let me know if there is anything else you need. UP: DOWN: |
Thanks for that. That's given me some data to start with. I've got something sort-of working for decoding part of it. I really need some captures from |
* Add `sendXmp()` & `decodeXmp()`. - Add `IRrecv::matchMarkRange()` & `IRrecv::matchSpaceRange()` to support the new protocol. * Unit test coverage. - Decode real example. - Self decode. * Support checksum verification. **Note:** Repeat functionality probably not working properly. For #1414
Can you please download the branch: https://github.com/crankyoldgit/IRremoteESP8266/tree/xmp_support and try out the examples and let me know how it goes? I think it should detect it now. Sending with |
Oh, can you also supply the Xfinity device/model numbers etc that the remotes control via XMP? |
Unfortunately, I no longer have the devices that the remote controls. I just have the remotes on hand and have been more interested in being able to decode the data rather than the other way around. Thanks for the quick implementation of it! I'll give them a try nearing the week. Just thoughts, wouldn't reencoding the data be easier as you can simply generate clean raw signal using IRScrutinizer? From there, you can use that information to encode it? |
"Ground truth" (raw) data is better than "Synthesised" data. That way I'm implementing what the remote actually sends, not what another program thinks the remote actually sends. I'm not saying IRScruitinizer has it wrong, but if there is an error in it's implementation, then I'd just be re-implementing that error. i.e. It's better to go to the original source for the data. |
@crankyoldgit Hi again! I still haven't been able to try the lastest code, but reading through the commit, I noticed in the test, only part of the data was included. The data coming in there was split into two pieces with a delay in between. Those two pieces of information were not separate independent presses but rather came from a single press. I rerecorded the same presses again with the extra delay between the two pieces of information to be extra clear. I hope this clears up some confusion. The only change here is the space of ~ UP: DOWN: |
A gap of 82ms is pretty much another message. i.e. Its a long long time in IR messages. I think it's a repeat. But the code (value) is different. Reading up on it, XMP does some funky stuff with changing the value when there is a |
It essentially is 2 pieces of information. There is the first piece before the pause that starts with a header message (call this code 1) followed by a space of The spreadsheet has the pieces of data with a short timeout between packets of information. For example, row by row is code 1 followed by code 2, 1, and 3. Between each code is a missing space that I described earlier. So each code is row 1, 13000 space, row 2, 82000 space, row 3, 13000 space, row 4. Following is a repeat of the button. The repeats are the same as other protocols as it continues to repeat the 1, 13000 space, 3 message until the button is released. |
Thanks for the info about your spreadsheet., Any chance you can covert them like you did in #1414 (comment) ? Per http://www.hifi-remote.com/wiki/index.php/XMP paragraph 3:
We may be able to deduce your code (3) from the code (1) value. (I haven't looked at it yet. But this is why I think repeats may be currently broken, and are not as simple as you think) Each of your code (1), code (2), & code (3) are 32 bits. Which leads to 96 bits of data. We can do 96 bits but not as a single integer (biggest is 64 bits). If we generate the checksum nibble on the fly, we can reduce each code to 28 bits, so 84 bits. Ideally we want to shave another 20 bits to get it to fit in a 64 bit integer, rather than going to a I'd still like some data recorded via IRrecvDumpV3 etc. |
Sorry I still haven't gotten a chance to run IRrecvDumpV3 since it would require me to solder some headers to my device and I haven't gotten around to doing that yet. With regards to how you can convert the codes, it's simply the same as just adding the respective spaces between each row as described. From there, the only difference is just a surrounding []. Is there something else you would need from that data? The checksum seems to be described in the irp notation in the description of the XMP protocol provided as C1 and C2. A description of the IRP notation can be found here. |
Hi @crankyoldgit I finally got around to testing this with IRrecvDumpV3 on the xmp_support branch and it does seem to be decoding it perfectly! The only issue is that it's not differentiating the repeats like it should when I hold a button down for an extended period of time. I'm holding these buttons down for approximately 3 sec. Down:Timestamp : 000210.812 Library : v2.7.15Protocol : XMP Timestamp : 000210.932 Protocol : XMP Timestamp : 000211.053 Protocol : XMP Timestamp : 000211.173 Protocol : XMP Timestamp : 000211.293 Protocol : XMP Timestamp : 000211.413 Protocol : XMP Timestamp : 000211.533 Protocol : XMP Timestamp : 000211.654 Protocol : XMP Timestamp : 000211.774 Protocol : XMP Timestamp : 000211.894 Protocol : XMP Timestamp : 000212.014 Protocol : XMP Timestamp : 000212.135 Protocol : XMP Timestamp : 000212.255 Protocol : XMP Up:Timestamp : 000366.184 Library : v2.7.15Protocol : XMP Timestamp : 000366.304 Protocol : XMP Timestamp : 000366.424 Protocol : XMP Timestamp : 000366.544 Protocol : XMP Timestamp : 000366.664 Protocol : XMP Timestamp : 000366.785 Protocol : XMP Timestamp : 000366.905 Protocol : XMP Timestamp : 000367.025 Protocol : XMP Timestamp : 000367.145 Protocol : XMP Timestamp : 000367.265 Protocol : XMP Timestamp : 000367.386 Protocol : XMP Timestamp : 000367.506 Protocol : XMP Timestamp : 000367.626 Protocol : XMP |
First off, thanks for that data & confirmation. It's really helpful. It will allow me to construct "correct" synthetic repeat messages. I'll work on that soon.
Um, it looks to me as if it is. e.g.
I've highlighted the bits that change from the original & the repeats. That doesn't seem to be the case. e.g. First two messages captured. The first is the "key press", the next ones are the "repeats". i.e. Different codes. |
Any idea how those bits are found? Is it some checksum or is there a way to predict what the repeat bits will be so that you can report that it's repeated like NEC? |
Now that I have some ground truth data, I'll try to work out exactly that based on the XMP specs. As I said earlier:
|
* Correctly identify potential XMP repeat messages. * Use the correct values for an XMP message when sending a repeat. * Refactor the existing code. * Add unit tests that confirm the additions/changes. Fixes #1414
Hey ya, can you please download and test the latest commit to that branch, and let me know how it goes?
will produce a "Down" message with a value of |
The repeat nibble (4 bits) is the 3rd Most Significant Nibble in the second 32-bit data segment.
Yes and Yes. Yes, There is also a checksum. Two in fact. One of which needs to be recalculated when repeating a msg code. And Yes, a "repeat" can be detected using the mask above. i.e. |
I just tested the latest version and its a huge success! Awesome work. Repeats are now identified correctly. There is one quirk, but I'm not sure if its within the scope of this project or not. The xfinity button on the remote sends 2 different codes instead of a single code like all the other buttons. Not sure if supporting that would be outside of this project, but either way, the current work is awesome! Short press:Timestamp : 000198.502 Library : v2.7.15Protocol : XMP Timestamp : 000198.622 Protocol : XMP (Repeat) Timestamp : 000199.212 Protocol : XMP Long press:Timestamp : 000225.577 Library : v2.7.15Protocol : XMP Timestamp : 000225.697 Protocol : XMP (Repeat) Timestamp : 000225.818 Protocol : XMP (Repeat) Timestamp : 000225.939 Protocol : XMP (Repeat) Timestamp : 000226.059 Protocol : XMP (Repeat) Timestamp : 000226.179 Protocol : XMP (Repeat) Timestamp : 000226.299 Protocol : XMP (Repeat) Timestamp : 000226.420 Protocol : XMP (Repeat) Timestamp : 000226.541 Protocol : XMP (Repeat) Timestamp : 000226.661 Protocol : XMP (Repeat) Timestamp : 000226.782 Protocol : XMP (Repeat) Timestamp : 000226.902 Protocol : XMP (Repeat) Timestamp : 000227.024 Protocol : XMP (Repeat) Timestamp : 000227.144 Protocol : XMP (Repeat) Timestamp : 000227.264 Protocol : XMP (Repeat) Timestamp : 000227.842 Protocol : XMP |
I also wanted to mention that the xfinity button sends codes that are also used by other buttons, but its only an "xfinity" button press if both those codes are sent in a given time. |
It's kind-of out of scope. // Short Press
irsend.sendXmp(0x170F443E1D002000, kXmpBits, 1); // Including a single(1) repeat
irsend.sendXmp(0x170F443E1100E000);
// or
// Long Press
irsend.sendXmp(0x170F443E1D002000, kXmpBits, 14); // Including 14 repeats
irsend.sendXmp(0x170F443E1100E000); Oh, and thanks for the confirmation it's working. |
* Add `sendXmp()` & `decodeXmp()`. - Add `IRrecv::matchMarkRange()` & `IRrecv::matchSpaceRange()` to support the new protocol. * Support checksum verification and calculation. * Correctly identify potential XMP repeat messages. * Use corrected values for an XMP message when sending a repeat. * Unit test coverage. - Decode real example. - Self decode. - Decode & detect a real repeat message. - Sending repeat messages. - Housekeeping. Fixes #1414
_v2.7.16 (20210324)_ **[Features]** - ToshibaAC: Swing handling and `setRaw()` improvements. (#1423 #1424 #1425) - Support for XMP (Xfinity) protocol. (#1414 #1422) - ToshibaAC: Adjust inter-message gap timing to improve matching. (#1420 #1421) - Ecoclim: Add detailed A/C support (#1397 #1415) **[Misc]** - [ESP32] Fix `addApbChangeCallback(): duplicate func` kernel msgs (#1434 #1435) - refactor ir_Fujitsu (#1419) - refactor ir_Whirlpool (#1416) - refactor ir_Vestel (#1413) - refactor ir_Trotec (#1412)
## _v2.7.16 (20210324)_ **[Features]** - ToshibaAC: Swing handling and `setRaw()` improvements. (#1423 #1424 #1425) - Support for XMP (Xfinity) protocol. (#1414 #1422) - ToshibaAC: Adjust inter-message gap timing to improve matching. (#1420 #1421) - Ecoclim: Add detailed A/C support (#1397 #1415) **[Misc]** - [ESP32] Fix `addApbChangeCallback(): duplicate func` kernel msgs (#1434 #1435) - refactor ir_Fujitsu (#1419) - refactor ir_Whirlpool (#1416) - refactor ir_Vestel (#1413) - refactor ir_Trotec (#1412)
FYI, the aforementioned changes have been included in the new v2.7.16 release for the library. |
I have XR15v2 remote and have all the buttons' timings from LIRC and also have a working LIRC.conf file. Of course some of the buttons are intended to operate the external attached device i.e. television. Interestingly, this remote CAN switch to RF transmission from IR. Is this useful to you? |
Hi, I have a beginner question. I see you define the Space step = 135 while the Wifi page states "XMP uses one burst pair to encode numbers 0 to 15, with an on duration of 210uS, and off duration of 760uS + n x136uS where n takes on values of 0 to 15" |
Hi thanks for creating this library!
Is there any chance we could get support for the XMP protocol?
This is a protocol used commonly by Comcast/Xfinity remotes.
For this specific protocol, here are codes that allow you to generate raw IR data for this protocol. As well as the program that can be used to take those codes and generate raw IR data and also decode raw IR.
Here is a description of the protocol.
Lastly, here are some implementations of the XMP protocol that may help with implementation:
DecodeIR
Linux Kernel
Thanks for reading and taking a look! Hope this will help with implementing it here!
The text was updated successfully, but these errors were encountered: