DavidMS
Posts: 139
Joined: Fri May 25, 2012 8:48 pm
Contact: Website

433Mhz RC Outlets known to work with rcswitch-pi

Wed Jan 14, 2015 11:23 pm

Can anyone provide me with a 433Mhz RC outlet currently available from a UK source that they have working with rcswitch-pi. I have been trying to get it working with some old Maplin ones I have which use the PT2262 chip set which should I think be compatible but I cannot get them to work. Comparing the data word produced by rcswitch and the remote control there are clearly differences !

Thanks
http://meanderingpi.wordpress.com/
11 Raspberry Pi's and counting....

Barboss
Posts: 8
Joined: Mon Jan 05, 2015 6:14 pm

Re: 433Mhz RC Outlets known to work with rcswitch-pi

Thu Jan 15, 2015 4:42 pm

315/433 MHz radio modules connect to the Raspberry Pia possible through the RS485 interface - http://electromost.com/news/raspberry_p ... -08-22-125

There you can find links coding PT 2262 24-bit code

grahamed
Posts: 277
Joined: Mon Jan 30, 2012 7:01 pm

Re: 433Mhz RC Outlets known to work with rcswitch-pi

Thu Jan 15, 2015 9:10 pm

Hi

Any number of people, using many different methods, have managed to control sockets using 2262. Look around the forum.

Perhaps a little more info about the problem, what you have done so far, what sockets they are, what the "clear differences" are.......etc. and people might be able to help

I think it's about time there was a sub-forum for 433 (and 315) MHz remote control socket stuff.

Tarcas
Posts: 740
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: 433Mhz RC Outlets known to work with rcswitch-pi

Fri Jan 16, 2015 1:49 am

DavidMS wrote:Comparing the data word produced by rcswitch and the remote control there are clearly differences !
If you're able to find the differences, why not update the code to support the outlets you're using? That's the beauty of open source! If you find something that's almost what you need, you can make it exactly what you need and in the process give back to the community so that other people can use and improve it further.

DavidMS
Posts: 139
Joined: Fri May 25, 2012 8:48 pm
Contact: Website

Re: 433Mhz RC Outlets known to work with rcswitch-pi

Fri Jan 16, 2015 8:40 am

I do take your point that I could look at modifying to code. That said this is part of a wider project and I want to try to use as near as possible an 'off the shelf solution' simply as a proof of concept - my main focus being on other elements of the software / hardware development.

There is also the side issue that I have very limited knowledge of C which rcswitch is written. Hence the original request for an example of a RC outlet [available in the UK] which other Pi users have working with rcswitch.
http://meanderingpi.wordpress.com/
11 Raspberry Pi's and counting....

DavidMS
Posts: 139
Joined: Fri May 25, 2012 8:48 pm
Contact: Website

Re: 433Mhz RC Outlets known to work with rcswitch-pi

Sat Jan 17, 2015 9:49 am

Success have just managed to get a RC outlet from Maplin http://www.maplin.co.uk/p/remote-contro ... ngle-n78ka to switch on and off

Ok, so I relented yesterday and spent some time refining my sample process so I could more clearly compare the bit patterns generated by the remote control and Rpi. To make things a little more simple I went back to using some code posted here by DDMF http://www.raspberrypi.org/forums/viewt ... 09#p598933, as this easily allowed me to change individual 'bits' of the message. To capture the bit patterns from the remote control I used a bitscope which after a little fiddling to get the best setup worked really well. I then simply copied the sampled graphics into PowerPoint [ this made it easy to get them all the same size with the bit code aligned below] to compare them.

True, I still have not got rcswitch to work, I will come back to this but before I spend more time on it I want to work on understanding the code sequence used by the RC outlet a bit better.
http://meanderingpi.wordpress.com/
11 Raspberry Pi's and counting....

DavidMS
Posts: 139
Joined: Fri May 25, 2012 8:48 pm
Contact: Website

Re: 433Mhz RC Outlets known to work with rcswitch-pi

Sun Jan 18, 2015 9:47 am

Good progress yesterday, I got to grips with relating the one and zeros to the message - the comment text in rcswitch.cpp was invaluable here as it even includes basic graphics to help.

I finally managed to get rcswitch working with the Maplin Outlet [part n78ka] having realised that the 'send' code examples were expecting a string for the 'systemCode' [device address] but the rcswitch routine being called was expecting an integer, once I changed this in the example everything worked as expected.

Then as a final win late in the day I stumbled across some work Tom Wilkie had posted on GitHub putting a python binder around rcswitch [ I think that is the correct terminology] anyway it means I can now call rcswitch elements direct from python. [ note unless already installed you need to 'sudo apt-get install swig' before the Makefile will run]

Code: Select all

#!/usr/bin/python

import sys
import rcswitch

PIN = 0

def main(argv):
  switch = rcswitch.RCSwitch()
  switch.enableTransmit(PIN)

  system_code = int(argv[1])
  unit_code = int(argv[2])
  command = int(argv[3])

  print 'sending systemCode[%i] unitCode[%i] command[%i]' % (system_code, unit_code, command)

  if command == 0:
      switch.switchOff(system_code, unit_code)
  elif command == 1:
      switch.switchOn(system_code, unit_code)

if __name__ == '__main__':
  main(sys.argv)
So in terms of rc433 control I have ticked all my original goals. For the record I checked out the range and with a 17.2cm aerial I can operate switches anywhere in the house reliably. I will write this up in a bit more detail on my blog https://meanderingpi.wordpress.com/ but it may take be a couple of days
http://meanderingpi.wordpress.com/
11 Raspberry Pi's and counting....

Return to “Automation, sensing and robotics”