Code Monkey home page Code Monkey logo

raspberry-strogonanoff's Introduction

Raspberry Strogonanoff

A Raspberry Pi Remote Mains Switcher, to switch these

http://www.maplin.co.uk/remote-controlled-mains-sockets-5-pack-348217

with one of these

http://proto-pic.co.uk/434mhz-rf-link-transmitter/

using the awesome reverse engineering detailed here

http://www.fanjita.org/serendipity/archives/53-Interfacing-with-radio-controlled-mains-sockets-part-2.html

Installation

Requires WiringPi-Python

git clone https://github.com/WiringPi/WiringPi-Python.git
cd WiringPi-Python/
git submodule update --init
sudo apt-get install python2.7-dev python-setuptools
sudo python setup.py install

Circuit

You'll need something like this http://proto-pic.co.uk/434mhz-rf-link-transmitter/

Assuming that is the one you buy, the transmitter has 4 pins. Wire

Tx PinRaspberry Pi Header Pin
Pin 1 GNDPin 6 0V (Ground)
Pin 2 Data inPin 11 GPIO 0
Pin 3 VccPin 2 5.0 VDC Power
Pin 4 ANT173mm antenna wire (not on the Pi!)
where the Raspberry Pi Header Pin numbers are the little ones on the inside of the diagram below.

If you've had to read this section, please see the disclaimer below.

Running

Needs to be run as root -

sudo ./strogonanoff_sender.py --channel 1 --button 3 --gpio 0 on 

where the GPIO pin number is 0 (the default) if wired as per the table above, or otherwise the big ones on this diagram

Disclaimer

It works for me, but connecting stuff to your Raspberry Pi can destroy either end. If it does, no matter how negligent I've been, I'm sorry, but it's your problem.

raspberry-strogonanoff's People

Contributors

dmcg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

raspberry-strogonanoff's Issues

Integrate with I2C

Hello,

Thanks, this works beautifully! I'm interested in using this with a port expander. Any thoughts on doing this, possibly with WiringPi2-Python?

Regards

"no module named wiringpi"

Hi there,

love the look of this project but just seem to be banging my head against the wall with the above error.

I've done a complete, fresh install of Wheezy from NOOBS (latest download as of Sat 1st Feb 2014), install all updates and RPi firmware (as per DomotiGa wiki - http://www.domotiga.nl/projects/domotiga/wiki/Hardware_RaspberryPi) and followed all steps from readme as accurately as I can.

All steps go well without errors and restarts are performed when requested.

After following the installation guide in the readme, there's no mention of where to extract the strogonanoff.py files but I've tried running them from several places including /WiringPi-Python and /WiringPi-Python/WiringPi/wiringPi/

Can anyone offer any guidance? Is this a bug caused by one of the updates?

Thanks,

Neil
strogonanofferror

no module named wiringpi

Hi there,

I have been having the same problems as someone else, where running the code:
sudo ./strogonanoff_sender.py --channel 1 --button 4 --gpio 0 on

gives the following error:
Traceback (most recent call last):
File "./strogonanoff_sender.py", line 62, in
from WiringPin import WiringPin
File "/home/pi/git/raspberry-strogonanoff/src/WiringPin.py", line 1, in
import wiringpi
File "/home/pi/git/raspberry-strogonanoff/src/wiringpi.py", line 26, in
_wiringpi = swig_import_helper()
File "/home/pi/git/raspberry-strogonanoff/src/wiringpi.py", line 18, in swig_import_helper
import _wiringpi
ImportError: No module named _wiringpi

  • I tried to reach the site with their fix but it is no longer there. I have followed your instructions: python -c 'import sys; print sys.path' and had the following results:
    python -c 'import sys; print sys.path'
    ['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/pymodules/python2.7']

I have moved every file into every possible place, but to no avail. I would really appreciate your help on this one; I MUST turn the lights on..!

Thanks,

Dan

sudo python setup.py install - Error

Hello,
I tried to install this strogonandoff but got an error:
Python.h was not found

pi@raspberrypi ~/WiringPi-Python $ sudo python setup.py install
running install
Checking .pth file support in /usr/local/lib/python2.7/dist-packages/
/usr/bin/python -E -c pass
TEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support .pth files
running bdist_egg
running egg_info
writing wiringpi.egg-info/PKG-INFO
writing top-level names to wiringpi.egg-info/top_level.txt
writing dependency_links to wiringpi.egg-info/dependency_links.txt
reading manifest file 'wiringpi.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'wiringpi.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-armv6l/egg
running install_lib
running build_py
running build_ext
building '_wiringpi' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c WiringPi/wiringPi/lcd.c -o build/temp.linux-armv6l-2.7/WiringPi/wiringPi/lcd.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c WiringPi/wiringPi/piHiPri.c -o build/temp.linux-armv6l-2.7/WiringPi/wiringPi/piHiPri.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c WiringPi/wiringPi/piThread.c -o build/temp.linux-armv6l-2.7/WiringPi/wiringPi/piThread.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c WiringPi/wiringPi/wiringPiFace.c -o build/temp.linux-armv6l-2.7/WiringPi/wiringPi/wiringPiFace.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c wiringpi_wrap.c -o build/temp.linux-armv6l-2.7/wiringpi_wrap.o
wiringpi_wrap.c:125:20: fatal error: Python.h: Datei oder Verzeichnis nicht gefunden
compilation terminated.
error: command 'gcc' failed with exit status 1
pi@raspberrypi ~/WiringPi-Python $

EDIT1:
ok python dev was missing so I installed it

sudo apt-get install python2.7-dev

next error: wiringPi.h not found - but this file is available!?
...
wiringpi_wrap.c: In function âinit_wiringpiâ:
wiringpi_wrap.c:4766:21: warning: variable âmdâ set but not used [-Wunused-but-set-variable]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c WiringPi/wiringPi/wiringPi.c -o build/temp.linux-armv6l-2.7/WiringPi/wiringPi/wiringPi.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c WiringPi/wiringPi/wiringSerial.c -o build/temp.linux-armv6l-2.7/WiringPi/wiringPi/wiringSerial.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c WiringPi/wiringPi/wiringShift.c -o build/temp.linux-armv6l-2.7/WiringPi/wiringPi/wiringShift.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c WiringPi/wiringPi/wiringPiSPI.c -o build/temp.linux-armv6l-2.7/WiringPi/wiringPi/wiringPiSPI.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c WiringPi/wiringPi/softPwm.c -o build/temp.linux-armv6l-2.7/WiringPi/wiringPi/softPwm.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c WiringPi/wiringPi/piNes.c -o build/temp.linux-armv6l-2.7/WiringPi/wiringPi/piNes.o
WiringPi/wiringPi/piNes.c:25:22: fatal error: wiringPi.h: Datei oder Verzeichnis nicht gefunden
compilation terminated.
error: command 'gcc' failed with exit status 1

EDIT2:
I changed the include in WiringPi/wiringPi/piNes.c
from

include <wiringPi.h>

to

include "wiringPi.h"

then it worked!

bytheway
to install raspberry-strogonanoff we also need
git clone https://github.com/dmcg/raspberry-strogonanoff.git

Now I have to build the hardware ;-)

strogonanoff_sender.py executes but with no result

Hi,

I have tried running "sudo python strogonanoff_sender.py --channel 1 --button 3 --gpio 7 on", however the maplin sockets do not respond at all.

I have the same sockets you linked to in the readme, and the same 434Mhz Transmitter module.

I have also tried with the sockets right next to the transmitter. Is there something that I could be overlooking?

ImportError: No module named strogonanoff_common

Hi,
I have followed the instruction - but appear to be missing strogonanoff_common?

pi@raspberrypi ~/raspberry-strogonanoff/src $ python strogonanoff_sender_test.py
Traceback (most recent call last):
File "strogonanoff_sender_test.py", line 2, in
from strogonanoff_sender import *
File "/home/pi/raspberry-strogonanoff/src/strogonanoff_sender.py", line 2, in
from strogonanoff_common import *
ImportError: No module named strogonanoff_common

Is this file missing from git?

strogonanoff_common

I have followed the instruction - but when I attempt to run the test or the sender I get:

pi@raspberrypi ~/raspberry-strogonanoff/src $ python strogonanoff_sender_test.py
Traceback (most recent call last):
File "strogonanoff_sender_test.py", line 2, in
from strogonanoff_sender import *
File "/home/pi/raspberry-strogonanoff/src/strogonanoff_sender.py", line 2, in
from strogonanoff_common import *
ImportError: No module named strogonanoff_common

Is the file missing from github or is the error on my part?

many thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.