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
PIN = 0
switch = rcswitch.RCSwitch()
system_code = int(argv)
unit_code = int(argv)
command = int(argv)
print 'sending systemCode[%i] unitCode[%i] command[%i]' % (system_code, unit_code, command)
if command == 0:
elif command == 1:
if __name__ == '__main__':
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