Step 4: Pulling it all togehter with code

Picture of Pulling it all togehter with code
Attached is my code to make this run.  It's built using pygooglevoice, a pretty powerful interface between Python and Google Voice.  Login credentials can be stored directly in the pygooglevoice settings, which they are in my case.  That's why you won't see them in the code.

I would love to show a video of it working, but it's going to have my actual phone numbers, and I don't want them out on the web.  I trust the actual instructables folks, but given how targeted we are for SPAM, I don't want to give them out here.  Nothing personal.

How it works:

The code first logs in using credentials stored in the pygooglevoice library.  While that is happening, "Logging In" is displayed on the screen.  Next, it waits for user input, displaying "Waiting".  If you press the "*" key on the keypad, the display changes to "Dialing", and you are in dialing mode.  Dial the phone number to call, and if you make a mistake, hit the "*" key again to clear the number.  When you've dialed the number, press the "#" key to place the call, and the display updates to "Calling". When the call has been placed, the display updates to "Call Placed", waits a short time, and then goes back to waiting.

Your call gets placed using Google Voice, to the phone number you've configured in your account. Errors in logging in or connecting are displayed as well, if necessary.
tremo2 years ago
Great project!

I have been trying running google voice on RPI too.. But it keeps giving "googlevoice.util.LoginError" error. As I googled it I saw that It is a common problem but i couldn't solve it for raspberry pi.

Have you encouraged this problem? How did you solve it?

mrmath (author)  tremo2 years ago
I did encounter the problem. I came across a fix for it where you have to make a change to the URL for the authentication.

In settings.py set LOGIN to "https://accounts.google.com/ServiceLogin?service=grandcentral&passive=1209600&continue=https://www.google.com/voice&followup=https://www.google.com/voice&ltmpl=open"

Is the solution that worked for me, I think.