• 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
Sender seems to sent for no reason
#1
Hi @all,

i'm new on this forum and have also already searched for my problem. The main problem comes from my sender/receiver modules: I need to operate both on one board (Raspberry). But if i plug in my sender, the receiver does'nt receive data (e.g. from my Temperature-Sensor). If i unplug the Data-Wire from my sender, the reveiver works as expected. So i guess while my sender is plugged in, it sends all the time something.

That brought me to my workaround, because the sender just needs power if i want to switch my Plug's with my (433Mhz-)Switches. So i connect the power from sender to a GPIO-Pin and wrote a python-script which should be triggered by pilight:


Code:
#!/usr/bin/python
from gpiozero import LED
from time import sleep
import sys, subprocess
led = LED(24)
unit = sys.argv[1]
state = sys.argv[2]
led.on()
execute = "pilight-send -p quigg_gt1000 -i 1 -u "+unit+" -"+state
print execute
subprocess.Popen([execute], shell=True)
sleep(1)


As you can see, this script takes 2 arguments: the Unit of a Plug and its state (on/off). Now i setup a Device in pilight:


Code:
"sender1": {
            "protocol": [ "program" ],
            "id": [{
                "name": "Sender"
            }],
            "program": "/usr/bin/python",
            "arguments": "",
            "stop-command": "/usr/bin/python /home/pi/p433.py 0 f &2>1",
            "start-command": "/usr/bin/python /home/pi/p433.py 0 t &2>1",
            "state": "stopped",
            "pid": 0,
            "poll-interval": 1
        }

and a rule for my Switch and the Device:


Code:
"Switch1Power1": {
            "rule": "IF Switch1.state == on THEN switch DEVICE sender1 TO running ELSE switch DEVICE sender1 TO stopped",
            "active": 1
        }
If i trigger "ON" with my switch, the Plug will be switched on, but the device "sender1" (program) goes in to state "stopped". For me it's clear, because pilight will not find any process "/usr/bin/python".
Problem is now, i can't switch off my Plug from my Switch. I dont know the reason. Maybe because pilight will not trigger the "stop-command" of "sender1" because the "process" is already stopped?
I hope my explaination were good enaugh to understand?
Kind Regards
Thomas
 
Reply
#2
Why aren't you adressing the primairy issue of your malfunctioning sender / receiver setup?
 
Reply
#3
(02-24-2020, 09:20 PM)curlymo Wrote: Why aren't you adressing the primairy issue of your malfunctioning sender / receiver setup?

I guess it's not a primary problem of my sender/receiver. If i dont connect the data-wire from the sender everything works fine (except sending of course). So, the question is: why do the sender sending without a reason? do pilight anything on the data-line even there is nothing to send?

Anyway... maybe anyone could help me.

My Devices i use:


Code:
amazon.de/gp/product/B01MTIZX6O/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1

Code:
amazon.de/gp/product/B07BP25F2W/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1


Regards

Thomas
 
Reply
#4
Can you connect a led instead of the send to see if it constantly blinks?
 
Reply
#5
(02-24-2020, 10:21 PM)curlymo Wrote: Can you connect a led instead of the send to see if it constantly blinks?

i will do it tomorrow. Actually i have solved my problem with modifying the LUA for Switch-Action in this way:


Code:
function M.run(parameters)
       local nrdev = #parameters['DEVICE']['value'];
       os.execute("/usr/bin/python /home/pi/p433.py &2>1");


and this python-script:


Code:
#!/usr/bin/python
from gpiozero import LED
from time import sleep
import sys, subprocess
led = LED(24)
led.on()
sleep(1)


No need of protocol "program" now.

Regards

Thomas
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Sender GPIO constantly under power (sometimes) scootermacro 1 288 03-06-2020, 07:37 PM
Last Post: curlymo
  433MHz sender - receiver problem EndruK 1 1,129 02-17-2018, 02:24 PM
Last Post: EndruK
  Change state by physical sender RZandvoort 4 2,300 09-24-2015, 07:38 AM
Last Post: pilino1234
  Problem with sender (the one from the pilight shop) klaus3000 6 3,632 06-20-2015, 02:15 PM
Last Post: klaus3000
  433.92 Receiver works. Sender not(RPi) mollitz 3 2,382 06-01-2015, 05:29 AM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)