6

I was wondering if it was possible to automate my pc by sending sms text messages to it.

This is the plan:

  • connect usb gsm modem to the pc
  • Send the text "start explorer" to the usb modem using my mobile device
  • the application on the computer receives the text, and starts the program "explorer"

This is a simple example of course, but I hope it's enough to show what I'm trying to accomplish: starting certain programs on the computer with an sms command.

It doesn't have to be a windows, I can use a linux pc too.

3
  • This doesn't seem too far fetched. The texts could be sent to the command prompt where command aliases and variables translate the input and run the expanded commands. :)
    – iglvzx
    Apr 22, 2012 at 22:53
  • Okay, but there has to be a program running that listens to the com port and receives the sms messages, and performs the necesary actions :-) Which program should I use to handle the incoming sms messages? Apr 22, 2012 at 23:00
  • 1
    If you do this, you should probably use some kind of authentication code as SMS messages are fairly easy to spoof. Apr 23, 2012 at 1:31

5 Answers 5

4

We use the free software called MWconn for Windows or ixconn for Ubuntu.

It has some amazing features and is easy to install. Not only is it able to automatically dial up as the PC starts, it can also communicate with the modem. It has a built in SMS manager, PC remote-control by SMS and incoming call, SMS transmission by batch job in a simple-ish interface to setup and all for batch or exe file running.

We use it to run a batch file to update our units if they fail to do so automatically. Or reboot the computer or the connections. The possibilities are relatively endless.

There is manual and a forum for further questions.

1
  • Is there something for Mac too?
    – jobukkit
    May 2, 2014 at 8:48
1

I haven't tried this myself, but it might be possible to use something like pygooglevoice to receive text messages sent to a Google Voice number (assuming you have one, or can get one). Then your script would implement a command processor that interprets the content of the text message.

1

I haven't give a try to this but according to the feedback of users I think this will worth for you. In article How to Remote Control your Windows PC with Email or SMS I found a software TweetMyPC which is claiming to do some magic for your PC.

How to Send Commands to the Remote Computer

By Email: Associate you Twitter account with Posterous (auto-post) and all email messages sent to [email protected] will therefore become commands for the remote computer.
(Also see: Post to Twitter via Email)

By SMS: If you live in US, UK, Canada, India, Germany, Sweden or New Zeleand, you can send associate Twitter with your mobile phone (see list of numbers) and then control your remote computer via SMS Text Messages.

By IM: Add the Twitter bot – [email protected] – to your list of Google Talk buddies and you can then send commands via instant message.

By Web: If you are on vacation but have access to an internet connected laptop, just log into the Twitter website and issue commands (e.g., shutdown or logoff) just as another tweet.

Download Files, Capture Remote Screenshots & more..

While the TweetMyPC is pretty good for shutting down a remote computer, it lets you do some more awesome stuff as well. For instance, you need to download an unfinished presentation from the office computer so that you can work on it at home.

Here’s a partial list of commands that you can use to remote control the PC – they’re case-insensitive and, as discussed above, you can send them to Twitter via email, SMS, IM or the web.

Screenshot: This is one of the most useful command I’ve come across after the shutdown command. Want to know what’s happening within the confines of your PC when you’re not around? Just tweet screenshot and TweetMyPC will take a screenshot of your desktop and post it to the web (see example).

ShutDown, LogOff, Reboot, Lock: The function of these useful commands is pretty obvious from their names.

Standby, Hibernate: Don’t want to shutdown the remote PC? Save power by entering standby mode with this command. Or hibernate your PC with a tweet, thereby saving even more power.

Download : You can download any file from the Internet on to the remote computer using the download command. For instance, a command like download http://bit.ly/tCJ9Y will download the CIA Handbook so you have the document ready when you resume work the next day.

GetFile : The Download command was for downloading files from the Internet onto the remote computer. However, if you like to transfer a file from the remote computer to your current computer, use the GetFile command. It takes the full page of the file that you want to download and will send that you as an email attachment. If you don’t know the file page, use the command GetFileList <drivename> to get a list of file folders on that drive.

GetProcessList: This is like a remote task manager. You’ll get a list of programs that are currently running on the remote computer along with their process IDs. Send another command kill <process id> to terminate any program that you think is suspicious or not required.

All information copied from How to Remote Control your Windows PC with Email or SMS.

1

Phones with modems respond to AT commands over a serial port (at least I haven't seen a model that doesn't). When connected to the computer via USB, it opens a serial port to which you can connect e.g. with a Perl script using the Device::SerialPort module to listen for new messages (I'm sure similar modules exist for Python/etc). When a new message signal is given, read the latest message and then act on its contents.

This should not be many lines of code to do by yourself (could likely be done in the order of 10-20 lines). The investigation will probably mostly be to find out the correct AT commands, but if you are in luck, you can find them on Google.

The large generic programs that communicate with phones almost exclusively use AT commands and translation tables for different phones.

If you like this path and want to find out more, start by using minicom or some other serial console program to probe your phone and what commands are available for it.

1
#!/bin/bash

gammu="/usr/bin/gammu"
$gammu getallsms | /bin/grep -B 1 -A 2 "UnRead" > /home/gammu.txt


checkWord=$(/usr/bin/awk 'c&&!--c;/UnRead/{c=2}' /home/gammu.txt)
servX=$(/usr/bin/awk 'c&&!--c;/UnRead/{c=2}' /home/gammu.txt | sed 's/^\(.\{1\}\).*/\1/')
commX=$(/usr/bin/awk 'c&&!--c;/UnRead/{c=2}' /home/gammu.txt | sed 's/^..//')
number=$(grep "+" /home/gammu.txt | sed 's/[^+0-9]*//g' | sed 's/^..//')
numberPlus=$(grep "+" /home/gammu.txt | sed 's/[^+0-9]*//g')

if [ "$number" = "0123456789" ] || [ "$number" = "0111111111" ] && [[ "$checkWord" =~ [0-9]* ]]
    then
        if [ $servX -eq 0 ]
        then
          ssh -p 20022 [email protected] $commX > /home/stdout.txt
          cat /home/stdout.txt | $gammu --sendsms TEXT $numberPlus
          exit 0
        fi
        if [ $servX -eq 1 ]
        then
          ssh [email protected] $commX > /home/stdout.txt
          cat /home/stdout.txt | $gammu --sendsms TEXT $numberPlus
          exit 0
        fi
fi

Somethning like this? You need to setup gammu for this. And crontab the script every min or 30 seconds. Also for safety reasons use it behind firewall (you need to setup public keys if you are doing this with multipe servers).

if you are texting "0 uname -a" you receive back a text message with the output of that command for the specific server. Make sure you don't loose your phone:)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .