• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


[Fully Supported] Remote Control Socket (RC101-U/RC201)
#11
Hoping someone can provide hint to help resolve this rc101 id problem:

pilight will not start when using ID value (57767) in 'config.json' that was reported by 'pilight-receive.'

The ID value reported by pilight-receive seems to agree with the ID that I attempted to reconstruct from debug code.

Testing by manually changing ID value - entering any decimal value greater than '4' into config.json 'id' generates an error for this device (switch_02) when protocol=rc101

The error message:

[Sep 07 10:52:11:460634] pilight-daemon: ERROR: config device setting #2 "id" of "Switch_02", invalid

Next 'code' section summarises what I tried - all codes work when using 'raw' protocol:

Code:
================
config.json
================
    "devices": {
        "Switch_01": {
            "protocol": [ "kaku_switch" ],
            "id": [{
                "id": 15888386,
                "unit": 0
            }],
            "state": "off"
        },
        "Switch_02": {
            "protocol": [ "rc101" ],
            "id": [{
                "id": 57767,
                "unit": 0
            }],
            "state": "off"
        }
    },

================
pilight-receive
================
---- sw_1 -------------------------
{
        "message": {
                "id": 57767,
                "unit": 0,
                "state": "on"
        },
        "origin": "receiver",
        "protocol": "rc101",
        "uuid": "0000-00-87-32-649b61",
        "repeats": 1
}

{
        "message": {
                "id": 57767,
                "unit": 0,
                "state": "off"
        },
        "origin": "receiver",
        "protocol": "rc101",
        "uuid": "0000-00-87-32-649b61",
        "repeats": 1
}

================
pilight-debug
================
---- sw_1 on ----------------------
time:           Mon Sep  7 09:20:11 2015
hardware:       433gpio
pulse:          3
rawlen:         66
pulselen:       239

Raw code:
717 239 717 239 717 239 239 717 239 717 717 239 239 717 717 239 717 239 239 717 239 717 239 717 239 717 717 239 717 478 717 239 239 717 239 717 239 717 239 717 717 239 717 239 717 239 717 239 717 239 717 239 717 239 239 717 239 717 239 717 239 717 717 239 239 8126

---- Convert to rc101 ------------
Ref: http://wiki.pilight.org/doku.php/rc101_v7_0

Converting receiver debug code to binary as per rc101 docs:

717 239 = 1
717 239 = 1
717 239 = 1
239 717 = 0
239 717 = 0

717 239 = 1
239 717 = 0
717 239 = 1
717 239 = 1
239 717 = 0

239 717 = 0
239 717 = 0
239 717 = 0
717 239 = 1
717 478 = 1

717 239 = 1
239 717 = 0
239 717 = 0
239 717 = 0
239 717 = 0

Raw ID of above: 11100101100001110000
The Inverted ID: 00001110000110100111

The inverted binary number 00001110000110100111 represents:
    + 32768 + 16384 + 8192 + 256 + 128 + 32 + 4 + 2 + 1
which (as reported above by pilight-receive) is decimal: 57767
717 239 = 1
state (not inverted) = 1

717 239 = 1
717 239 = 1
717 239 = 1
unit (111 inverted) = 0

717 239 = 0
717 239 = 0
717 239 = 0
239 717 = 1
239 717 = 1
239 717 = 1
misc (ignore - always send zeros)

239 717 = 1
717 239 = 0
239 8126

================
pilight-send
================
Sending following raw code does turn switch_02 'on':

pilight-send -p raw -c "717 239 717 239 717 239 239 717 239 \
    717 717 239 239 717 717 239 717 239 239 717 239 717 239 717 \
    239 717 717 239 717 478 717 239 239 717 239 717 239 717 239 \
    717 717 239 717 239 717 239 717 239 717 239 717 239 717 239 \
    239 717 239 717 239 717 239 717 717 239 239 8126"

This is a 'Bauhn' branded 4 switch controller. The receive and debug codes for each switch are listed in next 'code' section:

Code:
Bauhn 4 switch controller - service start pilight

================
pilight-receive
================
---- sw_1 -------------------------
{
        "message": {
                "id": 57767,
                "unit": 0,
                "state": "on"
        },
        "origin": "receiver",
        "protocol": "rc101",
        "uuid": "0000-00-87-32-649b61",
        "repeats": 1
}

{
        "message": {
                "id": 57767,
                "unit": 0,
                "state": "off"
        },
        "origin": "receiver",
        "protocol": "rc101",
        "uuid": "0000-00-87-32-649b61",
        "repeats": 1
}

---- sw_2 -------------------------
{
        "message": {
                "id": 57767,
                "unit": 1,
                "state": "on"
        },      
        "origin": "receiver",
        "protocol": "rc101",
        "uuid": "0000-00-87-32-649b61",
        "repeats": 1
}      

{
        "message": {
                "id": 57767,
                "unit": 1,
                "state": "off"
        },      
        "origin": "receiver",
        "protocol": "rc101",
        "uuid": "0000-00-87-32-649b61",
        "repeats": 1
}      


---- sw_3 -------------------------
{
        "message": {
                "id": 57767,
                "unit": 2,
                "state": "on"
        },      
        "origin": "receiver",
        "protocol": "rc101",
        "uuid": "0000-00-87-32-649b61",
        "repeats": 1
}      

--- sw_4 -------------------------
{
        "message": {
                "id": 57767,
                "unit": 4,
                "state": "on"
        },      
        "origin": "receiver",
        "protocol": "rc101",
        "uuid": "0000-00-87-32-649b61",
        "repeats": 1
}      


---- sw_all -----------------------
{
        "message": {
                "id": 57767,
                "all": 1,
                "state": "on"
        },      
        "origin": "receiver",
        "protocol": "rc101",
        "uuid": "0000-00-87-32-649b61",
        "repeats": 1
}      

{
        "message": {
                "id": 57767,
                "all": 1,
                "state": "off"
        },      
        "origin": "receiver",
        "protocol": "rc101",
        "uuid": "0000-00-87-32-649b61",
        "repeats": 1
}      

================
pilight-debug
================
---- sw_1 on ----------------------
time:           Mon Sep  7 09:20:11 2015
hardware:       433gpio
pulse:          3
rawlen:         66
pulselen:       239

Raw code:
717 239 717 239 717 239 239 717 239 717 717 239 239 717 717 239 717 239 239 717 239 717 239 717 239 717 717 239 717 478 717 239 239 717 239 717 239 717 239 717 717 239 717 239 717 239 717 239 717 239 717 239 717 239 239 717 239 717 239 717 239 717 717 239 239 8126

---- sw_1 off ---------------------
time:           Mon Sep  7 09:24:21 2015
hardware:       433gpio
pulse:          3
rawlen:         66
pulselen:       246

Raw code:
738 246 738 246 738 246 246 738 246 738 738 246 246 738 738 246 738 246 246 738 246 738 246 738 246 738 738 246 738 246 738 246 246 738 246 738 246 738 246 738 246 738 738 246 738 246 738 246 738 246 738 246 738 246 246 738 738 246 246 738 246 738 738 246 246 8364

---- sw_2 on ----------------------
time:           Mon Sep  7 09:41:16 2015
hardware:       433gpio
pulse:          3
rawlen:         66
pulselen:       245

Raw code:
735 245 735 245 735 245 245 735 245 735 735 245 245 735 735 245 735 245 245 735 245 735 245 735 245 735 735 245 735 245 735 245 245 735 245 735 245 735 735 245 245 735 245 735 735 245 735 245 735 245 735 245 735 245 735 245 245 735 735 245 245 735 735 245 245 8330

---- sw_2 off ---------------------
time:           Mon Sep  7 09:42:09 2015
hardware:       433gpio
pulse:          3
rawlen:         66
pulselen:       241

Raw code:
723 241 723 241 723 241 241 723 241 723 723 241 241 723 723 241 723 241 241 723 241 723 241 723 241 723 723 241 723 241 723 241 241 723 241 723 241 723 241 723 241 723 241 723 723 241 723 241 723 241 723 241 723 241 241 723 723 241 723 241 241 723 723 241 241 8194


---- sw_3 on ----------------------
time:           Mon Sep  7 09:43:03 2015
hardware:       433gpio
pulse:          3
rawlen:         66
pulselen:       246

Raw code:
738 246 738 246 738 246 246 738 246 738 738 246 246 738 738 246 738 246 246 738 246 738 246 738 246 738 738 246 738 246 738 246 246 738 246 738 246 738 246 738 738 246 738 246 246 738 738 246 738 246 738 246 738 246 246 738 246 738 246 738 738 246 738 246 246 8364

---- sw_3 off ---------------------
time:           Mon Sep  7 09:44:26 2015
hardware:       433gpio
pulse:          3
rawlen:         66
pulselen:       246

Raw code:
738 246 738 246 738 246 246 738 246 738 738 246 246 738 738 492 738 246 246 738 246 738 246 738 246 738 738 246 738 246 738 246 246 738 246 738 246 738 738 246 246 738 738 246 246 738 738 246 738 246 738 246 738 246 738 246 246 738 246 738 738 246 738 246 246 8364


---- sw_4 on ----------------------
time:           Mon Sep  7 09:45:33 2015
hardware:       433gpio
pulse:          3
rawlen:         66
pulselen:       247

Raw code:
741 247 741 247 741 247 247 741 247 741 741 247 247 741 741 247 741 247 247 741 247 741 247 741 247 741 741 247 741 247 741 247 247 741 247 741 247 741 247 741 741 247 741 247 741 247 247 741 741 247 741 247 741 247 247 741 247 741 247 741 247 741 247 741 247 8398

---- sw_4 off ---------------------
time:           Mon Sep  7 09:45:55 2015
hardware:       433gpio
pulse:          3
rawlen:         66
pulselen:       246

Raw code:
738 246 738 246 738 246 246 738 246 738 738 246 246 738 738 246 738 246 246 738 246 738 246 738 246 738 738 246 738 246 738 246 246 738 246 738 246 738 246 738 246 738 738 246 738 246 246 738 738 246 738 246 738 246 246 738 738 246 246 738 246 738 246 738 246 8364

---- sw_4 off ---------------------
time:           Mon Sep  7 09:45:55 2015
hardware:       433gpio
pulse:          3
rawlen:         66
pulselen:       246

Raw code:
738 246 738 246 738 246 246 738 246 738 738 246 246 738 738 246 738 246 246 738 246 738 246 738 246 738 738 246 738 246 738 246 246 738 246 738 246 738 246 738 246 738 738 246 738 246 246 738 738 246 738 246 738 246 246 738 738 246 246 738 246 738 246 738 246 8364

---- sw_all on -------------------
time:           Mon Sep  7 09:47:57 2015
hardware:       433gpio
pulse:          3
rawlen:         66
pulselen:       246

Raw code:
738 246 738 246 738 246 246 738 246 738 738 246 246 738 738 246 738 246 246 738 246 738 246 738 246 738 738 246 738 246 738 246 246 738 246 738 246 738 246 738 246 738 738 246 246 738 246 738 738 246 738 246 738 246 246 738 738 246 246 738 738 246 246 738 246 8364


---- sw_all off ------------------
me:           Mon Sep  7 09:48:40 2015
hardware:       433gpio
pulse:          3
rawlen:         66
pulselen:       238

Raw code:
714 238 714 238 714 238 238 714 238 714 714 238 238 714 714 238 714 238 238 714 238 714 238 714 238 714 714 238 714 238 714 238 238 714 238 714 238 714 238 714 714 238 238 714 238 714 238 714 714 238 714 238 714 238 238 714 238 714 714 238 714 238 238 714 238 8092

Any suggested remedies welcome.
 
Reply
#12
Your issue is possibly this regex:
https://github.com/pilight/pilight/blob/...101.c#L223
 
Reply
#13
Thanks again for your time - but either i have wrong regex or my config remains wrong/incomplete.

Changing regex avoids invalid id pilight.err message but no code is output (no signal appears on pin 0 (header pin 11)). Codes for other switches/protocols in the same config.json are output correctly.

I have tried various regexp ,including (but not limited to):
Code:
options_add(&rc101->options, 'i', "id", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "(.*)$");

options_add(&rc101->options, 'i', "id", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^([0-9]{5,8})$");

options_add(&rc101->options, 'i', "id", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "([0-9]{5,8})$");

All of above result show no log errors, but no data is output for that particular switch/protocol.

Does it look like i have wrong syntax for regexp... or any other suggestions what next?
 
Reply
#14
To be sure if your regex is correct, just remove it fully for the time being:
Code:
options_add(&rc101->options, 'i', "id", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, NULL);
 
Reply
#15
Suggested full removal of regex in rc101.c does not fix data output - I have also re-compiled from scratch to make sure I have not broken the rc101.c/distro.

With regexp removedl. pilight starts and runs without 'id' or other error message but no signal generated when off/on activated via gui.

If istop pilight, then replace 'rc101' with an alternative protocol name such as 'techlico_switch' in config.json, and then start pilight, a signal _is_ generated.

The "kaku_switch" actions for device "switch_01" also output data correctly.

For completeness, here is my test config.json:
Code:
{
    "devices": {
        "switch_01": {
            "protocol": [ "kaku_switch" ],
            "id": [{
                "id": 123456,
                "unit": 0
            }],
            "state": "on"
        },
        "switch_02": {
            "protocol": [ "techlico_switch" ],
            "id": [{
                "id": 57767,
                "unit": 1
            }],
            "state": "off"
        }
    },
    "rules": {},
    "gui": {
        "switch_01": {
            "name": "Lamp Switch_01",
            "group": [ "Lamp Switches" ],
            "media": [ "all" ]
        },
        "switch_02": {
            "name": "Lamp Switch_02",
            "group": [ "Lamp Switches" ],
            "media": [ "all" ]
        }
    },
    "settings": {
        "log-level": 6,
        "pid-file": "/var/run/pilight.pid",
        "log-file": "/var/log/pilight.log",
        "webserver-enable": 1,
        "webserver-root": "/usr/local/share/pilight/",
        "webserver-http-port": 90,
        "webserver-cache": 1
    },
    "hardware": {
        "433gpio": {
            "sender": 0,
            "receiver": 1
        }
    },
    "registry": {
        "pilight": {
            "firmware": {
                "version": 3,
                "lpf": 80,
                "hpf": 16000
            },
            "version": {
                "current": "7.0"
            }
        }
    }
}

Thanks again for any suggestions.
 
Reply
#16
Is this stable or nightly?
 
Reply
#17
Code downloaded from github, then installed using the included setup.sh:

Code:
git clone https://github.com/pilight/pilight.git

I performed a fresh download and install about one hour ago, and confirm that, in my tests, no signal appears on output when using 'rc101'. - same as reported in earlier emails in this thread.
 
Reply
#18
Hiya

I am running v7 from repo, and there is no transmission for RC101 protocol.

I am using one pi to transmit and another to receive, and I can see other protocols sending correctly, but no rc101.

Any suggestions as to a simple fix?

cheer

Paul
 
Reply
#19
(02-10-2016, 12:10 AM)pconnor Wrote: Hiya

I am running v7 from repo, and there is no transmission for RC101 protocol.

I am using one pi to transmit and another to receive, and I can see other protocols sending correctly, but no rc101.

Any suggestions as to a simple fix?

cheer

Paul

To revive this old thread I am getting this error when I try use the rc101 protocol in my config
Code:
Job for pilight.service failed. See 'systemctl status pilight.service' and 'journalctl -xn' for details.


Not documented in the docs site but I get it when I run pilight-receive
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  [Partially Supported] TFA / Conrad Weather Yves 203 77,384 03-27-2020, 01:21 PM
Last Post: Ascenion
  [Fully Supported] KlikAanKlikUit Motion Sensor koen01 37 29,071 03-26-2020, 02:46 PM
Last Post: Gisto
Lightbulb [Fully Supported] Kaku Door sensor (AMST-606) geerttttt 53 45,988 10-19-2019, 06:26 PM
Last Post: curlymo
  [Fully Supported] DHT22 IcedEarth 86 63,462 11-18-2018, 09:33 AM
Last Post: curlymo
  [Fully Supported] Arctech Old Martin 111 73,859 03-27-2018, 04:43 PM
Last Post: genfersee
  11 Key RF Remote, LED controller Jeroenk 24 22,156 02-02-2018, 01:29 AM
Last Post: Silverhawk1986
  [Fully Supported] Clarus Switches Marcin 69 52,282 01-30-2018, 07:10 PM
Last Post: Niek
  [Fully Supported] LM75 and LM76 temperature sensor horst_dieter 64 46,992 11-19-2017, 08:54 PM
Last Post: edepi
  Hafele TV-elevator remote wessel_k 1 2,123 09-06-2017, 09:57 PM
Last Post: wessel_k
  [Fully Supported] No-brand temp/humidity sensor (alecto_ws1700) meloen 57 62,507 12-25-2016, 09:53 PM
Last Post: creamers

Forum Jump:


Browsing: 1 Guest(s)