Control reed switch by Raspberry Pi 2

Control reed switch by Raspberry Pi 2.

I used WebIOPi.

 

If you have a trouble when using WebIOPi in Raspberry Pi 2, please following instruction.

https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=98981

 

  1. move to WebIOPi folder
  2. $ sudo nano python/native/cpuinfo.c
  3. change "BCM2708" to "BCM2709"
  4. $ sudo nano python/native/gpio.c
  5. change
    #define BCM2708_PERI_BASE 0x20000000
    to
    #define BCM2708_PERI_BASE 0x3f000000
  6. sudo ./setup.sh