Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RF Stations
#1
Dan,

First of all thanks for your excellent piece of work. I have a 7 zone install which includes my pool pump which had been running problem free since August 2015. Just last week I noticed that irrigation had stopped and I suspected the 24v transformer, upon investigation this was found to be OK and I noted that none of the relays were being switched though software wise everything looked normal.

To cut the long story short it was well past midnight and pushed to get things working in the dark hours I simply swapped the Pi out and everything is back to normal. I have not yet tested the Pi I took out to confirm if the GPIO has died.

Anyway my reason for writing is that I am looking into changing the existing setup to make it easier to maintain deploy and I am interested in the possibility of having RF ( 433mhz ) stations.

I have searched high and low and whilst I see that opensprinkler is capable of doing this and in a post in another forum I see a response suggesting using a generic 433Mhz Tx connected RF transmitter to +5V, GND, and GPIO pin 17 on RPi
and making changes to your interval program I am unsure where exactly to fit this in.

Ideally I would like to be able to add these RF stations via the UI and have multiple RF stations but think the code below would be just for one station which  would not be very useful.

Grateful for your thoughts and help.

Kind Regards

Joseph


Code:
#!/usr/bin/python

import RPi.GPIO as GPIO
import time

SEND_PIN = 17

SIGNATURE = 0b0000111101010101

COMMAND = 0b11110001

DELAYSHORT = 160
DELAYLONG = 500

OVERHEAD = 0 # overhead time (in us) for calling GPIO.output and time.sleep. If 0 doesn't work, try 125

def ookPulse(on,off):
  GPIO.output(SEND_PIN,True)
  time.sleep((on-OVERHEAD)/1000000.0)
  GPIO.output(SEND_PIN,False)
  time.sleep((off-OVERHEAD)/1000000.0)

def pt2262Send(signature,command):
  for k in range(0,16):
    for i in range(0,16):
      if((signature>>(15-i)) & 0x1):
        ookPulse(DELAYLONG, DELAYSHORT)
      else:
        ookPulse(DELAYSHORT, DELAYLONG);     
    for i in range(0,8):
      if((command>>(7-i)) & 0x1):
        ookPulse(DELAYLONG, DELAYSHORT)
      else:
        ookPulse(DELAYSHORT, DELAYLONG)
    ookPulse(DELAYSHORT, DELAYLONG)
    time.sleep(.005)

def main():
  GPIO.cleanup()
  GPIO.setmode(GPIO.BCM)
  GPIO.setup(SEND_PIN,GPIO.OUT)
  while True:
    pt2262Send(SIGNATURE,COMMAND)
    time.sleep(5)

main()
Reply
#2
Have you tried this?

It looks like you are trying to send pulses using microsecond sleep times. As far as I know, on the Raspberry Pi you can only get millisecond timing resolution.

There may be a way to accomplish what you want. It looks like it can be done using wiringpi. If you can control your remote stations via the command line on the Pi then it should be fairly easy to set up SIP to send those command line commands when a station needs to be turned on or off.

Dan
Reply
#3
Hi Dan. I just made my own RF 433 unit with sub base and a master at moo I have it link to a pc but hoping getting it linked to this and be able to control by app
Reply
#4
You may find the cli_control plugin useful.
It sends command line commands when a station is to be switched on or off.

This may also be useful:
http://www.instructables.com/id/Super-Si...utomation/
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)