2014-02-10 09.32.19
I stumbled upon https://github.com/korylprince/pygvoicelib which allowed me to use a simple python script to send SMS messages. The following is how to get your Pi sending text messages with ease.
Step 1: Ensure your Raspberry Pi is setup with your distro of choice and has internet access.
Step2: Sign up for a google voice account
a Gmail account will be needed to do this.
Step3: Enable 2-step verification of your google account.
a link can be found on the following page. https://accounts.google.com/b/0/IssuedAuthSubTokens
Step4: Create an Application Specific password.
Navigate to https://accounts.google.com/b/0/IssuedAuthSubTokens scroll to the bottom and in the name field put “Raspberry Pi” (or whatever other name you want to identify the device). Click on Generate password.
You will then be given a one-time use password.
Step5: Log into your Pi and open the terminal or SSH using Putty
Next cd to your home directory in my case its /home/pi
Code: Select all
cd /home/pi
First run the following command to prevent SSL errors:
Code: Select all
export GIT_SSL_NO_VERIFY=1
Code: Select all
git clone https://github.com/korylprince/pygvoicelib.git
cd to the newly created folder pygvoicelib
run the following command:
Code: Select all
python get_auth.py
username
apppass
auth_token
rnr_se
Step8: Create a script to send a text message.
Run the following command (you can use nano if you wish):
Code: Select all
vi text.py
Code: Select all
#!/usr/bin/python
import pygvoicelib
number = raw_input(‘number:’)
txtmsg = raw_input(‘message:’)
client = pygvoicelib.GoogleVoice(username,apppass,auth_token,rnr_se)
client.sms(number,txtmsg)
Replace username, apppass, auth_token, and rnr_se with the variable values that were displayed with step 7
Example:
Code: Select all
#!/usr/bin/python
import pygvoicelib
number = raw_input(‘number:’)
txtmsg = raw_input(‘message:’)
client = pygvoicelib.GoogleVoice(‘[email protected]’,'asdfahrwsthjtrh’,’4k3EozF_Qmrg3tD2_m56nQtFHCVSaTdUxb7HvcaN6g3PV929VH0eH4GGVOVpbVK2O6EaGFzMDYA6PhPjaEHr0ZGjO1GQN3RGhQLXqePWfglbXnA2n7XpUophOk5qztQyv2fYM7eYgtVCYeO6txTqbDQAAANsAAABZ7d0GTL2pJsUauPkH4Z3cpbJFqjfLZYfhok1b11pIMDnEOypZgIcOVdPEt8jEMx7oY9hHJeJoDQZYndDJDu8uoDbDWgxl87GMy990snKWR8iy8VIB17769eVWboa3224U8DLZLUWMpP0d4hfsDK5MQ’,'L6tph126BjmNjDcfTZGaWYeb+sk=’)
client.sms(number,txtmsg)
Step8: Send a text message.
Run the following command:
Code: Select all
python text.py
Step9: Celebrate
Open a beer and relax
I also have the guide up on my site http://citycorpse.com