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.
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
We will simply install all the necessary packages to send the command to switch the wireless socket on or off.
- Raspberry Pi mit Raspbian
- Wireless socket
- Git-Core => comes with Raspian
Connect sender to RPi
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: