• 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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plug not acting upon signal
#1
Hello Forum

I have a vanilla setup of the recent pilight (8.1.3. if I am not mistaken) and I use some cheap sender/receiver I got from Amazon. So one potential source of error.

I have the following config.json

Code:
{
       "devices": {
               "Switch1": {
                       "protocol": [ "clarus_switch" ],
                       "id": [{
                               "id": "F0",
                               "unit": 63
                       }],
                       "state": "off"
               }
       },
       "rules": {},
       "gui": {
{
               "Switch1": {
                       "name": "Switch Nr 1",
                       "group": [ "MeineSwitches" ],
                       "media": [ "all" ]
               }
},
       "settings": {
               "log-level": 6,
               "pid-file": "/var/run/pilight.pid",
               "log-file": "/var/log/pilight.log",
               "standalone": 0,
               "webserver-enable": 1,
               "webserver-root": "/usr/local/share/pilight/webgui",
               "webserver-http-port": 5001,
               "webserver-https-port": 5002,
               "webserver-cache": 1,
               "whitelist": "",
               "gpio-platform": "raspberrypi3"
       },
       "hardware": {
               "433gpio": {
                       "sender": 0,
                       "receiver": 1
               }
       },
       "registry": {
               "webserver": {
                       "ssl": {
                               "certificate": {
                                       "secure": 0,
                                       "location": "/etc/pilight/pilight.pem"
                               }
                       }
               },
               "pilight": {
                       "version": {
                               "current": "8.1.3"
                       }
               }
       }
}
When I intercept signal from my remote I get the following:

Code:
{
        "message": {
                "id": "F0",
                "unit": 63,
                "state": "off"
        },
        "origin": "receiver",
        "protocol": "clarus_switch",
        "uuid": "0000-b8-27-eb-442056",
        "repeats": 1
}
{
        "message": {
                "systemcode": 31,
                "programcode": 1,
                "state": "on"
        },
        "origin": "receiver",
        "protocol": "impuls",
        "uuid": "0000-b8-27-eb-442056",
        "repeats": 1
}
{
        "message": {
                "id": "F0",
                "unit": 63,
                "state": "off"
        },
        "origin": "receiver",
        "protocol": "clarus_switch",
        "uuid": "0000-b8-27-eb-442056",
        "repeats": 2
}
 Then I send the command to switch on my plug:


PHP Code:
pilight-send -p clarus_switch -i F0 -u 63 -

This does not do anything (the sender is 5 cm away from the plug)
When I receive the very same signal with my receiver I get the following:
Code:
{
       "origin": "sender",
       "protocol": "clarus_switch",
       "message": {
               "id": "F0",
               "unit": 63,
               "state": "on"
       },
       "repeat": 1,
       "uuid": "0000-b8-27-eb-442056"
}
{
       "origin": "sender",
       "protocol": "clarus_switch",
       "message": {
               "id": "F0",
               "unit": 63,
               "state": "on"
       },
       "repeat": 1,
       "uuid": "0000-b8-27-eb-477c2d"
}

I read about the issue that these signals might be intercepted by the internal bus and not by the physical device. 
This is why I connected the receiver to a second raspi and no intra- bus communication can happen.
Any thoughts what might be the issue?
 
Reply
#2
(11-22-2018, 10:50 AM)Update: I had a go with Wiringpi and it all works there. So I\d dare to call it a bug in pilight. tulamidan Wrote: Hello Forum

I have a vanilla setup of the recent pilight (8.1.3. if I am not mistaken) and I use some cheap sender/receiver I got from Amazon. So one potential source of error.

I have the following config.json

Code:
{
       "devices": {
               "Switch1": {
                       "protocol": [ "clarus_switch" ],
                       "id": [{
                               "id": "F0",
                               "unit": 63
                       }],
                       "state": "off"
               }
       },
       "rules": {},
       "gui": {
{
               "Switch1": {
                       "name": "Switch Nr 1",
                       "group": [ "MeineSwitches" ],
                       "media": [ "all" ]
               }
},
       "settings": {
               "log-level": 6,
               "pid-file": "/var/run/pilight.pid",
               "log-file": "/var/log/pilight.log",
               "standalone": 0,
               "webserver-enable": 1,
               "webserver-root": "/usr/local/share/pilight/webgui",
               "webserver-http-port": 5001,
               "webserver-https-port": 5002,
               "webserver-cache": 1,
               "whitelist": "",
               "gpio-platform": "raspberrypi3"
       },
       "hardware": {
               "433gpio": {
                       "sender": 0,
                       "receiver": 1
               }
       },
       "registry": {
               "webserver": {
                       "ssl": {
                               "certificate": {
                                       "secure": 0,
                                       "location": "/etc/pilight/pilight.pem"
                               }
                       }
               },
               "pilight": {
                       "version": {
                               "current": "8.1.3"
                       }
               }
       }
}
When I intercept signal from my remote I get the following:

Code:
{
        "message": {
                "id": "F0",
                "unit": 63,
                "state": "off"
        },
        "origin": "receiver",
        "protocol": "clarus_switch",
        "uuid": "0000-b8-27-eb-442056",
        "repeats": 1
}
{
        "message": {
                "systemcode": 31,
                "programcode": 1,
                "state": "on"
        },
        "origin": "receiver",
        "protocol": "impuls",
        "uuid": "0000-b8-27-eb-442056",
        "repeats": 1
}
{
        "message": {
                "id": "F0",
                "unit": 63,
                "state": "off"
        },
        "origin": "receiver",
        "protocol": "clarus_switch",
        "uuid": "0000-b8-27-eb-442056",
        "repeats": 2
}
 Then I send the command to switch on my plug:


PHP Code:
pilight-send -p clarus_switch -i F0 -u 63 -

This does not do anything (the sender is 5 cm away from the plug)
When I receive the very same signal with my receiver I get the following:
Code:
{
       "origin": "sender",
       "protocol": "clarus_switch",
       "message": {
               "id": "F0",
               "unit": 63,
               "state": "on"
       },
       "repeat": 1,
       "uuid": "0000-b8-27-eb-442056"
}
{
       "origin": "sender",
       "protocol": "clarus_switch",
       "message": {
               "id": "F0",
               "unit": 63,
               "state": "on"
       },
       "repeat": 1,
       "uuid": "0000-b8-27-eb-477c2d"
}

I read about the issue that these signals might be intercepted by the internal bus and not by the physical device. 
This is why I connected the receiver to a second raspi and no intra- bus communication can happen.
Any thoughts what might be the issue?
 
Reply
#3
Hello everybody,

I think I may have a very similar problem.
After upgrading to pilight 8.1.4 (with dist-upgrade of my raspberry pi) from 8.0.x, pilight-send does not/rarely work.
In detail:
I have a python script, which runs command line pilight-send commands to switch some plugs. However, only one specific plug can be switched. The other plugs do no switch at all. However, in the web-interface of pilight I see the plugs switching (but the do not physically switch).
One very strange point: if I run pilight-send command from the same terminal, all switches can be controlled without any errors. Also, switching from the web-interface also runs smoothly without any problems.

Every time, any command is executed, /etc/pilight.log lists a new client for every command:

Code:
[Dec 19 19:08:16:350344] pilight-daemon: INFO: datetime CurrentDateTime 9.170000:48.905000 seems to be in timezone: Europe/Berlin
[Dec 19 19:08:16:386939] pilight-daemon: INFO: version v8.1.4
[Dec 19 19:08:16:495252] pilight-daemon: INFO: no pilight daemon found, daemonizing
[Dec 19 19:08:16:507429] pilight-daemon: INFO: daemon listening to port: 40497
[Dec 19 19:08:16:537614] pilight-daemon: INFO: new client, ip: 127.0.0.1, port: 41170
[Dec 19 19:08:16:547430] pilight-daemon: INFO: secured webserver started on port: 5002 (fd 15)
[Dec 19 19:08:16:547721] pilight-daemon: INFO: regular webserver started on port: 5001 (fd 16)
[Dec 19 19:08:16:656389] pilight-daemon: INFO: new client, ip: 192.168.178.137, port: 56186
[Dec 19 19:08:18:189700] pilight-daemon: ERROR: ERROR: failed to send packet
[Dec 19 19:15:49:126172] pilight-daemon: INFO: new client, ip: 192.168.178.137, port: 56218
[Dec 19 19:15:49:126405] pilight-daemon: INFO: new client, ip: 192.168.178.137, port: 56220
[Dec 19 19:16:09:985455] pilight-daemon: INFO: new client, ip: 192.168.178.137, port: 56226
[Dec 19 19:16:09:985582] pilight-daemon: INFO: new client, ip: 192.168.178.137, port: 56224



When I switch back to my old pilight version, everything runs smoothly.

Please help me!
 
Reply
#4
Since all pilight development tools work without issues it's almost impossible for me to debug.
 
Reply
#5
(12-19-2018, 09:22 PM)curlymo Wrote: Since all pilight development tools work without issues it's almost impossible for me to debug.

What could I do to help you? Do you need any logs etc?
 
Reply
#6
Try using the pilight socket server instead of calling pilight-send. Examples of a python client can be found on the pilight github.
 
Reply
#7
(12-19-2018, 11:33 PM)curlymo Wrote: Try using the pilight socket server instead of calling pilight-send. Examples of a python client can be found on the pilight github.

Do you mean:
Code:
http ://1.2.3.4:5001/send?protocol=kaku_screen_old&on=1&id=22&unit=5
(1.2.3.4 is my local RPi IP)
This returns json: message "failed"
From a local terminal on Raspberry: pilight-send -p kaku_screen_old -u 5 -i 22 -t (or -f) works fine!

I also tried elro_800_switch protocols with no luck:
Code:
http ://1:2:3:4:5001/send?protocol=elro_800_switch&on=1&id=544&unit=28
 
Reply
#8
I mean:
https://manual.pilight.org/development/s...index.html

Implementation in python:
https://github.com/pilight/pilight/blob/...process.py
 
Reply
#9
(12-20-2018, 10:50 AM)curlymo Wrote: I mean:
https://manual.pilight.org/development/s...index.html

Implementation in python:
https://github.com/pilight/pilight/blob/...process.py

Thank you very much. I will try to set this up within the next days.
In the meantime, I figures out, that the REST Api (with http access as described above) (https://manual.pilight.org/development/rest/index.html) would be more handy for me.
I opened another thread concerning the topic, why not all protocols are supported there.
 
Reply
#10
What do I do wrong?
I took the process.py from here: https://github.com/pilight/pilight/blob/...process.py and modified the following line:


This works:
Code:
s.send('{"action": "identify", "options": {"core": 1, "config": 1}}'


This does not:

Code:
s.send('{"action": "send", "code": {"protocol": [ "kaku_screen_old" ] , "state": up, "id": 22, "unit": 5}}')


I do not get any output at all. Script is just stuck.
I am not that deep into python-socket, could you kindly have an educated guess, what I am missing?
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  [solved] kwmobile: repeating the remote signal doesn't work dawncrow 9 861 10-25-2018, 03:46 PM
Last Post: dawncrow
  deleyCON remote plug socket (arctec_screen_old protocol) itsMe 6 1,105 04-01-2018, 08:35 PM
Last Post: itsMe
Question window sensor's very first signal goes missing baf 1 679 11-14-2017, 10:36 PM
Last Post: curlymo
  Signal decoded - how to go on? Rustimator 3 830 10-23-2017, 07:16 PM
Last Post: curlymo
  Looking for a 433Mhz soil moisture sensor (Plug´n Play) tomtom 0 664 04-10-2017, 12:34 PM
Last Post: tomtom
  pilight 7 and InterTechno ITT-1500: No Receiving signal pi_invi 9 2,544 11-29-2016, 01:47 PM
Last Post: wo_rasp
  Sending a signal to a receiver, switching a LED- ideas? jjj 3 1,450 04-02-2016, 12:22 PM
Last Post: jjj
  problem sending codes: no signal on sending pin stigmen 8 2,639 07-18-2015, 09:39 AM
Last Post: pilino1234
  Send signal to pilight? gine78 3 2,094 10-09-2014, 10:29 AM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)