sui77 / rc-switch

Arduino lib to operate 433/315Mhz devices like power outlet sockets.
1.91k stars 659 forks source link

Are protocol 3 and 5 the same? #53

Open fingolfin opened 8 years ago

fingolfin commented 8 years ago

PR #11 added protocol 5. In the pull request, it is explained that the signals from the remote were already "incorrectly" recognized as protocol 3, but that sending did not work using protocol 3.

Well, the same was the case for me, until I tweaked protocol 3 in PR #33. After that tweak, we have this:

    { 100, { 30, 71 }, {  4, 11 }, {  9,  6 } },    // protocol 3
...
    { 500, {  6, 14 }, {  1,  2 }, {  2,  1 } },    // protocol 5

If one changes things to a uniform base unit of 100us, we get:

    { 100, { 30, 71 }, {  4, 11 }, {  9,  6 } },    // protocol 3
    { 100, { 30, 70 }, {  5, 10 }, { 10,  5 } },    // protocol 5

Note how close the values are. Indeed, close enough that the fuzzy matching implemented in rc-switch may ignores the difference.

As a result, my remote, which definitely sends using protocol 3 (based on analyzing raw timings), regularly is detected as protocol 5 instead.

So, I now wonder whether perhaps protocol 5 is really the same as protocl 3, and the numbers in it were simply fuzzed up as "looking nice and working", as opposed to being based on raw timings?

fingolfin commented 8 years ago

I should add that my Brennenstuhl switch can be controlled with both protocol 3 and 5, so it also seems to ignore the minor differences in the timings.