Repository navigation
Add MWM support - #557
Add MWM support#557
Conversation
Adding support for Disney's Made With Magic IR protocol, formerly known as Glow With the Show.
Added command mode2_decode needs the mark and space methods from IRsend_test.h to inject events based on received timing data.
MWM devices typically wait 30ms between messages, so increase footer to that length. We're re-using the state field for MWM messages, but since payload field is 4-bits with a minimum of 3 bytes, we only need 18 bytes. Reworked definition of state field in union to use only what we really need for what's defined.
|
First off, wow. Congratulations on doing this. Adding a protocol and unit tests is a huge feat. I'll get on to a code review of it shortly. FYI, the travis checks failed with the following automated linter errors. We'll need to correct them before merging etc.: |
crankyoldgit
left a comment
There was a problem hiding this comment.
First off, again. wow. I've only got really small nit-pick comments and improvements. Top stuff!
Please add yourself to https://github.com/markszabo/IRremoteESP8266/blob/master/.github/Contributors.md etc. You've earned it!
A few minor house-keeping things to add in addition:
Please add MWM to:
https://github.com/markszabo/IRremoteESP8266/blob/master/src/IRutils.cpp#L131
and
https://github.com/markszabo/IRremoteESP8266/blob/master/src/IRutils.cpp#L172
| irsend.makeDecodeResult(); | ||
| ASSERT_TRUE(irrecv.decode(&irsend.capture)); | ||
| EXPECT_EQ(MWM, irsend.capture.decode_type); | ||
| EXPECT_EQ(8*sizeof(short_expected)/sizeof(short_expected[0]), irsend.capture.bits); |
There was a problem hiding this comment.
Minor style nitpick:
| EXPECT_EQ(8*sizeof(short_expected)/sizeof(short_expected[0]), irsend.capture.bits); | |
| EXPECT_EQ(8 * sizeof(short_expected) / sizeof(short_expected[0]), irsend.capture.bits); |
| @@ -0,0 +1,106 @@ | |||
| // Quick and dirty tool to decode GlobalCache (GC) codes | |||
There was a problem hiding this comment.
I think the description here doesn't match what the program does, nor who the author is. ;-)
Please update and maybe include a usage example.
My guess from skimming the code is it takes STDIN in the form of lines with "space nnnn" or "pulse nnnn" where nnnn is the duration. One per line etc. Correct?
|
Thanks for the review! I'm working through the list now; hope to push changes soon. When it's good, I'm happy to squash the commits if you prefer. |
|
I'll end up squashing in the final "Squash and merge" on github. Thanks for getting on to it quickly. Plus, thanks again for writing unit tests. <3 <3 ;-) |
For simplicity and maintenance, just stick with the max length for state field
|
OK, travis is probably failing due to the googletest issues I had locally. I'm not sure how to resolve that; I'm not familiar with submodules or how to revert to the version that was working before my changes. |
|
Yeah, I've never included the There are a few |
|
Hmm. Compiles and runs as expected on my machine. Weird. |
* Update IRMQTTServer for MWM support. * Fix some cpplint.py found issues. * Adjust the MWM banner. * Anchor the googletest library to v1.8.x to solve c++11 issues.
**[Bug Fixes]** - Add missing send() method to IRPanasonicAC class. (#545) - Add missing sendWhirlpoolAC() to IRMQTTServer.ino (#558) **[Features]** - Add IR receiving support to IRMQTTServer. (#543) - Pioneer support (#547) - Add support for a second LG protocol variant. (#552) - Support for short Panasonic A/C messages. (#553) - Add support for Panasonic CKP series A/Cs. (#554) - Experimental timer/clock support for Panasonic A/Cs. (#546) - Add Made With Magic (MWM) support (#557) **[Misc]** - Grammar and typo fixes (#541, #549) - Increase Panasonic A/C message tolerances. (#542) - Added command mode2_decode in tools/ (#557) - General code style cleanup (#560)
**[Bug Fixes]** - Add missing send() method to IRPanasonicAC class. (#545) - Add missing sendWhirlpoolAC() to IRMQTTServer.ino (#558) **[Features]** - Add IR receiving support to IRMQTTServer. (#543) - Pioneer support (#547) - Add support for a second LG protocol variant. (#552) - Support for short Panasonic A/C messages. (#553) - Add support for Panasonic CKP series A/Cs. (#554) - Experimental timer/clock support for Panasonic A/Cs. (#546) - Add Made With Magic (MWM) support (#557) **[Misc]** - Grammar and typo fixes (#541, #549) - Increase Panasonic A/C message tolerances. (#542) - Added command mode2_decode in tools/ (#557) - General code style cleanup (#560)
|
This is now live in the new v2.5.2 release of the library. |
Disney's Made With Magic (also known as Glow With The Show) accessories use IR to communicate, both receiving commands within areas of the park, and to synchronize with each other.
Signaling is basically 2400bps serial modulated onto IR, with mark=0 and space=1, 1 start bit (mark), 8-bits LSB-first data, 1 stop bit (space), with mark being full 38 kHz modulation and space being completely off. I adapted the Lasertag decoder, since its manchester encoding was closest to the full-bit signaling used here.
I have not tested this on an ESP8266. I tested receive using a hardware IR receiver (SiliconDust HDHomeRun) that transmits timing data over the network, received and translated to human-readable pulse/space timings via LIRC's mode2 command, piped into the mode2_decode tool that I've also adapted from gc_decode. I have not tested transmit, but converted real decoded commands into theoretical timings by hand for the unit tests.
Since the messages have variable lengths, and the encoding seems to support up to 18 bytes, I've re-used the state field in decode_results, but added some logic to use only 18 bytes for the field if no AC decoders are compiled in.
I changed getRClevel's use of match() from 3 fixed levels to accepting a variable number -- the worst case in this format is 9 consecutive marks or spaces.
I removed protected from IRsendTest's mark and space methods to support directly calling them in the mode2_decode tool, allowing me to directly inject multi-bit durations.