It is designed to intelligently and quickly check unread Google voice messages. If certain parameters are passed, it runs the command you send and returns the result.
This is the third script in my AUI (Alternative User Interface) Series.
This requires curl and libboost1.50-regex. The setup script can install curl and boost regex.
NOTE: This will work with any linux OS but I am using it on the Raspberry Pi so if you are using something else, you will have to compile it yourself (make sure to change the Makefile flags).
The stable version is on github here:
And the working copy source can be found here:
Google Voice unfortunately doesn't have an API available so I started writing my own.
I found this page and this page which were good references. Unfortunately, neither of these actually worked, so I wrote my own based off them. The script will install this and you are free to use it however you want as long as you cite me and follow GPLv3.
It works by using cron to run a script once every minute. The script checks your unread inbox messages and uses curl to make sure certain safety parameters are met. It is very important to check the unread inbox as it only pulls a 1-3 KB file rather than a 150+ KB file. This really adds up once a minute over time. If certain parameters are met, ie it has a valid phone number and command, then it runs the command you give it. The results of the command are then texted back to you.
This will not work with interactive scripts like more or man
(this requires git)
sudo apt-get install git-core
git clone git://github.com/StevenHickson/PiAUISuite.git
This will be your Google voice username, password, key, and valid number.
Your Google voice username will be your e-mail. For example:
Your password is your Google voice password:
ThisIsntMyPasswordThe key is the valid command-word that proceeds commands to the machine. For example, mine is Cmd. So I text:
to have the pi text the results of the current directory back.
Your valid number is the phone number you want your google voice to receive commands from (Not your Google voice number!). You must put the country code but not the + sign. Ex:
After that everything should work.
Note, I worked out a few major bugs with the install script and it is reposted now. So make sure to get the newest version.
Consider donating to further my tinkering
Have you considered Twilio? It would give you a completely documented way to interact with SMS, but it would cost a (trivial) amount.ReplyDelete
Twilio is less secure (their API uses http instead of https) and I like to be able to specify the code myself. It does have the advantage of working internationally though.Delete
HI, I found your blog post while searching for Raspberry Pi and Google Voice. Since you know the code where could I modify it to read a text from any number? Looks like somewhere in gtextcommand.cpp? This is the problem I have now: http://arduino.cc/forum/index.php/topic,160036.0.html so I am thinking of porting over to the RPi.ReplyDelete
On line 49 of gtextcommand.cpp where the program calls CheckSMS, change the number string to an empty string ex:Delete
string tmp = "";
You still need to send a valid number for SendSMS though.