description: "Hacked together IOT setup with some semblance of security"
---
# Introduction
As we all know, the "S" in IOT stands for security.
We've all seen countless stories of people's networks getting hijacked due to some 3 year old vulnerability in the software stack of their *insert smart device here*.
These things barely get any patches at all.
On top of that, the most they do is spy on you and send [your footage to the police without asking for your consent](https://edition.cnn.com/2022/07/14/tech/amazon-ring-police-footage/index.html "Load without JS to make the page behave.").
Still, on the other hand, it can be really convenient to be able to control some of the electronics in your home without having to walk towards them.
I personally have a lamp that I frequently forget to turn off when leaving my room.
The solution was an [Olimex PWR-switch](https://www.olimex.com/Products/Duino/Shields/PWR-SWITCH/) in combination with a Raspberry Pi 4 that I have running 24/7 regardless (mostly to watch YouTube videos and listen to music over my speaker set; I might write a post about this beautifully hacky contraption at some point in the future).
The unique thing here being that it needs to be executed as the root user in order to mess with the state of the pins.
(Or at least in the case of my setup.)
So having it be a forced command is a security benefit here as it prevents whatever device you're using to toggle your lamp from having to log in as the root user.
All a device with the `<lamp-key>` can do, is toggle the state of `GPIO 15`.
You could contrivedly call this SIOT...
Since Android 12, there is the "Device controls" tile in the swipe-down-from-the-top-of-the-screen-menu.
Termux can interact with the API that this system provides and allows you to add buttons corresponding to Termux' shortcuts.
These shortcuts are executables found in `~/.shortcuts` within the Termux environment.
Here I've created a little script that logs into my Raspberry Pi using the `<lamp-key>`, allowing me to toggle my lamp at the tap of a button as long as I'm on my home network.