Controlling a wireless socket with Raspberry Pi

This is part #4 of my adventures in Building the Internet of Things with the Raspberry Pi. You can read about Setting up Raspbian on the Raspberry Pi 3 which is a prerequisite for this post.

Foreword

This is the lazy way on how to do this but this does not necessarily mean that it’s a bad way. ๐Ÿ™‚

โ€œI choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it.โ€

โ€• Bill Gates

The project

We will simply install all the necessary packages to send the command to switch the wireless socket on or off.

Components

  • Raspberry Pi mit Raspbian
  • Sender
  • Wireless socket

Software

  • Git-Core => comes with Raspian
  • WiringPi
  • Raspberry-Remote

Connect sender to RPi

Send command

sudo ./send 10001 2 1 => switch on
sudo ./send 10001 2 0 => switch off

You can look at the implementation in a text editor

These files do all the work:

  • Send.cpp
  • RCSwitch.css

Links

Advertisements