There’s fun here for both tinkerers and perhaps many other home automation, farming or industrial users - all with a Waveshare modem and Raspberry Pi.
I wanted to share this project to invite extra project ideas, code improvements, or perhaps even additional feature requests. All code and instructions to install as a running service at boot is shared here: SMS-to-Shell on Github
With this little project you can either securely send SMS shortcut command keywords or full shell commands directly to a Raspi. (Communications and security features rely only on the SMS network, meaning interactivity is acheived without the need for any cloud subscription or full time internet access - great for for low power or intermittently awake devices.)
After sending a shell command, incoming messages are converted into shell input, executed, and the resulting shell output is replayed back to the sender’s phone number via SMS. All SMS command outputs above a configurable character limit will be paginated over multiple SMS messages/pages.
An important consideration for automation over SMS is security. This project supports a variety of security levels and configurations using phone number access lists, restriction of commands to only a whitelist and for full zero trust, one-time passwords (TOTP with QRcode) can be enforced before every command if desired.
The code itself has a reasonable level of error checking and I’ve not been able to break it by sending massive or weird commands or characters in a few months of messing with it. The script is aimed to support a wider range of modems, languages and even some proprietary command syntax that might vary between modem manufacturers, so it should be workable on just about any serial or usb AT modem. This project tries to balance efficiency, simplicity and flexibility to be able to support a range of low power hardware without requiring exotic python library support that may not be readily available in other Linux distros like OpenWRT etc.