-
Notifications
You must be signed in to change notification settings - Fork 835
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
Added Old Vestel A/C support (56 Bits) with full functions. #607
Conversation
First off, wow. Thanks for tackling adding a full on send/decode/class for this new protocol. I'll start a code review in a minute. |
Fixing travis issues now... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will do for now. I'll take a look after we get it passing Travis.
(sorry for all the nitpicks. It's really good. I'm impressed!)
FYI, |
9 am here. Will continue next day. 👍 |
i.e. Ran `clang-gormat -style=google` over code.
- Add a setRaw() that accepts a uint64_t. - Should correct travis build issues now.
Use IRHaierAC::timeToString() instead.
- Add some extra fan speed modes.
@EUA I've done some cleanup, fixed a few things, added support for the code examples, and added basic unit tests for it. Doing some reading on the structure bit packing, it's "implementation dependent" which means we really shouldn't use it. e.g. Different compilers and architectures could produce problems. Also, when writing the unit tests, I noticed there are no class methods to set any of the clock/timer options. They are optional, but the should be added at some time. Can you supply some other values for valid codes (and what they mean) so I can add some more tests? |
About packing, yes this is old and not a meaningful thing to talk in 2019. Sad to hear it again. I want to talk about it (as a msc computer engineer.) Sorry. If you don't like or can't use it at this point, you can simply reject the code. I don't gonna use some other "compatible" method for implement it. I just picked the best. For timer features, I actually don't see any possible benefit of such an implementation. Well, Vestel AC has off-timer (30 min, 1hr,2hr,3hr 5hr). Also has option to program turn on and turn off selected time but in 10 minutes interval. If you really want I could add it. I can send IRecvDumpV2 outputs later. Can I paste here or??? |
Now realized that... Code flipped some how at IRrecvDumpV2...
becomes
Everything works proper, nothing changed at all but I swear yesterday (and my whole development) it's F441E001FEE201... |
I am really scared... My perception of real is altered for a while. Just like traveling parallel universes... But I approximate and find the problem. Than, this thing became a bug.
auto_analyse_raw_data.py output still show the old notation:
|
Auto modes exist but Fan mode is different than that. Doesn't make heat or cold. about |
I read up on a number of issues about it last night. The BitField operations are endian-dependant. i.e. Different architectures can cause it to "flip" etc. The AVR/ESP/x86 all share the same endian-ness so we are fine there. However, I did read the one of Microsoft's compiler/IDE environments does treat bitfield packing differently to GCC on the same arch. i.e. produces different bit packing. I do know some people/project that do use this library with that compiler env. so ultimately we should probably change it (not for this PR). Also, we have no control of which architecture the CI/Travis uses. As the unit tests compile outside of the AVR cross-compiler, we do need to cater for that. Currently, they are using x86 it seems so all is fine for now. I'll probably re-code it to the correct bit-shifting/masking in a later PR. |
Added AutoMode function for easy switch.
My guess is you used the wrong bitordering in the FYI, nothing changed from 2.5.3 to 2.5.4 that would have affected this. My guess is you were looking at it character by character, than as a whole uint64_t. This is why unit tests are good. ;-) |
I typically prefer to use a named constant than rather plain number, especially if it used in more than one place. 16 is the value which is the temp offset. kVestelACMinTempH is in effect that value. i.e. it is the lowest temp that can be represented (i.e. 0b0000 in the message). TL;DR: I don't really care. :) |
Fix incorrect determination of if VESTEL uses uint8[] for state. It doesn't. It uses uint64_t instead. Should fix incorrect reporting in IRrecvDumpV2. Add unit tests to ensure it is correct. * Fix a metric tonne of linter issues.
src/ir_Vestel.cpp
Outdated
std::string IRVestelAC::toString() { | ||
std::string result = ""; | ||
#endif // ARDUINO | ||
if (remote_state.power == 0x00) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct? I don't see anything that ever sets this to 0
. only 0xF
or 0xC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. This is main difference to identify normal command stack or time stack.
If remote_state.power byte is not set, that means we are decoding time command.
I don't add any reset for that bits since not planning to implement timing functions.
I reset it using t_not_used.
But using power=0x00 might be better idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My vote is to use power
rather than not_used
as clearly it is used.
Can you give me a code for a timer message so I can build some unit tests around it and fix toString() to reflect that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just add new remote state for time.. So switching is not needed anymore.
Here is the some codes. "Mesg Desc" shows the time command function :)
Timestamp : 000008.851
Encoding : VESTEL_AC
Code : 2D6570B8EE201 (56 bits)
Mesg Desc.: Time Command - Time : 5:45, Turn On: 14:00, Turn Off: 23:00
Library : v2.5.4
Raw Timing[115]:
+ 3022, - 9080, + 546, - 1536, + 526, - 466, + 526, - 492,
+ 526, - 468, + 526, - 492, + 524, - 468, + 524, - 494,
+ 524, - 504, + 540, - 492, + 524, - 1538, + 526, - 468,
+ 524, - 492, + 526, - 466, + 552, - 1536, + 526, - 1536,
+ 526, - 1570, + 542, - 492, + 524, - 1538, + 550, - 1538,
+ 524, - 1536, + 526, - 494, + 524, - 466, + 526, - 468,
+ 524, - 1574, + 540, - 1536, + 550, - 1536, + 526, - 468,
+ 550, - 1536, + 526, - 492, + 526, - 468, + 524, - 492,
+ 526, - 518, + 526, - 1536, + 552, - 1536, + 550, - 1536,
+ 526, - 494, + 550, - 1538, + 526, - 492, + 524, - 1538,
+ 526, - 504, + 540, - 466, + 526, - 1536, + 526, - 1536,
+ 526, - 468, + 550, - 1538, + 524, - 468, + 524, - 1538,
+ 550, - 1574, + 540, - 468, + 550, - 1538, + 526, - 492,
+ 524, - 468, + 526, - 466, + 526, - 468, + 524, - 494,
+ 524, - 468, + 546
uint16_t rawData[115] = {3022, 9080, 546, 1536, 526, 466, 526, 492, 526, 468, 526, 492, 524, 468, 524, 494, 524, 504, 540, 492, 524, 1538, 526, 468, 524, 492, 526, 466, 552, 1536, 526, 1536, 526, 1570, 542, 492, 524, 1538, 550, 1538, 524, 1536, 526, 494, 524, 466, 526, 468, 524, 1574, 540, 1536, 550, 1536, 526, 468, 550, 1536, 526, 492, 526, 468, 524, 492, 526, 518, 526, 1536, 552, 1536, 550, 1536, 526, 494, 550, 1538, 526, 492, 524, 1538, 526, 504, 540, 466, 526, 1536, 526, 1536, 526, 468, 550, 1538, 524, 468, 524, 1538, 550, 1574, 540, 468, 550, 1538, 526, 492, 524, 468, 526, 466, 526, 468, 524, 494, 524, 468, 546}; // VESTEL_AC 2D6570B8EE201
uint64_t data = 0x2D6570B8EE201;
Timestamp : 000053.163
Encoding : VESTEL_AC
Code : 2EA50018F3201 (56 bits)
Mesg Desc.: Time Command - Time : 5:46, Timer Mode Off After 03:00
Library : v2.5.4
Raw Timing[115]:
+ 3100, - 9076, + 550, - 1534, + 528, - 490, + 528, - 464,
+ 528, - 490, + 528, - 464, + 528, - 490, + 528, - 466,
+ 526, - 502, + 542, - 464, + 554, - 1534, + 528, - 490,
+ 528, - 464, + 552, - 1534, + 528, - 1534, + 528, - 464,
+ 528, - 526, + 542, - 1534, + 552, - 1534, + 528, - 1536,
+ 526, - 1534, + 528, - 466, + 528, - 464, + 528, - 492,
+ 526, - 1572, + 542, - 1534, + 528, - 490, + 528, - 490,
+ 526, - 466, + 528, - 490, + 528, - 464, + 528, - 466,
+ 526, - 502, + 542, - 464, + 528, - 490, + 528, - 490,
+ 528, - 466, + 552, - 1534, + 528, - 490, + 528, - 1534,
+ 528, - 526, + 542, - 490, + 554, - 1534, + 528, - 466,
+ 552, - 1534, + 528, - 464, + 552, - 1536, + 552, - 1534,
+ 528, - 1570, + 544, - 490, + 528, - 1534, + 528, - 466,
+ 526, - 490, + 528, - 466, + 528, - 490, + 528, - 490,
+ 526, - 466, + 550
uint16_t rawData[115] = {3100, 9076, 550, 1534, 528, 490, 528, 464, 528, 490, 528, 464, 528, 490, 528, 466, 526, 502, 542, 464, 554, 1534, 528, 490, 528, 464, 552, 1534, 528, 1534, 528, 464, 528, 526, 542, 1534, 552, 1534, 528, 1536, 526, 1534, 528, 466, 528, 464, 528, 492, 526, 1572, 542, 1534, 528, 490, 528, 490, 526, 466, 528, 490, 528, 464, 528, 466, 526, 502, 542, 464, 528, 490, 528, 490, 528, 466, 552, 1534, 528, 490, 528, 1534, 528, 526, 542, 490, 554, 1534, 528, 466, 552, 1534, 528, 464, 552, 1536, 552, 1534, 528, 1570, 544, 490, 528, 1534, 528, 466, 526, 490, 528, 466, 528, 490, 528, 490, 526, 466, 550}; // VESTEL_AC 2EA50018F3201
uint64_t data = 0x2EA50018F3201;
Yes verified that code reversal is fixed :) Happy now. I implemented date timer setting but do not verify if they are work. Only current pitfall is using same VestelACState remote_state for both type of commands. Or we can use another remote_time_state for timing operations. |
Ah. So there is an entirely different 56bit message layout if it's timer related vs. a change mode/temp/etc message? If so, Yuck. |
They call it as hug in Linux kernel anymore... :) Yes. Only CRC bits and t_footer are in same place :) Might be it's better to use different internal state named like remote_time_state for timing operations. Will add/change it tomorrow. Than it's done... |
- Make sure IRVestelAC::send() knows which state to send. * Set the type of command to send to be the type of the last method type used. e.g. If a time(r) function was used last, send a Time message, otherwise a normal mode message is sent. - Clean up/standardise the timer human readable text. - Add missing timer get() functions. Rename set() functions to common names. - Add unit tests to cover pretty much all the missing and new class methods. - Add real capture data for unit tests.
_v2.5.5 (20190207)_ **[Bug Fixes]** - Fix decoding of Samsung A/C Extended messages. (#610) - Fix IRMQTTServer example to work with GPIO0 as IR_RX (#608) - Fix incorrect #define usage. (#597, #596) **[Features]** - Add deep decoding/construction of Daikin2 messages (#600) - Added Old Vestel A/C support (56 Bits) with full functions. (#607) **[Misc]** - Add ControlSamsungAC example code. (#599) - Add how to send a state/air-con to IRsendDemo.ino (#594)
_v2.5.5 (20190207)_ **[Bug Fixes]** - Fix decoding of Samsung A/C Extended messages. (#610) - Fix IRMQTTServer example to work with GPIO0 as IR_RX (#608) - Fix incorrect #define usage. (#597, #596) **[Features]** - Add deep decoding/construction of Daikin2 messages (#600) - Added Old Vestel A/C support (56 Bits) with full functions. (#607) **[Misc]** - Add ControlSamsungAC example code. (#599) - Add how to send a state/air-con to IRsendDemo.ino (#594)
This has been included in the new v2.5.5 release of the library. |
Complete Vestel A/C support (56 Bits)