Go Down

Topic: Let Yun send out SMS worldwide (Read 2983 times) previous topic - next topic

sonnyyu

Jan 13, 2014, 03:03 am Last Edit: Feb 08, 2014, 12:10 am by sonnyyu Reason: 1
Let Yun send out SMS absolutely free :

Step 1.  sign on Google Voice Google Voice

Step 2. install software at Yun.

Code: [Select]
opkg update
opkg install nano
opkg install python-openssl
opkg install python-expat
opkg install distribute
easy_install -U pygooglevoice


cd /usr/lib/python2.7/site-packages/pygooglevoice-0.5-py2.7.egg/googlevoice

nano settings.py

Code: [Select]
#LOGIN = 'https://www.google.com/accounts/ServiceLoginAuth?service=grandcentral'^M
LOGIN = 'https://accounts.google.com/ServiceLogin?service=grandcentral'


nano voice.py

Code: [Select]
#galx = re.search(r"name=\"GALX\"\s+value=\"(.+)\"", content).group(1)
try:
        galx = re.search(r"name=\"GALX\" type=\"hidden\"\n *value=\"(.+)\"", content).group(1)
except:
        galx = ''.join(e for e in content if e.isalnum()) # Remove special characters (leaving only letters & numbers)
        galx = galx[galx.index("GALX"):] # Grab everything from GALX forward
        galx = galx[:galx.index("input")] # Truncate at input (first word after GALX value)
        galx = galx[galx.index("value")+5:] # Extract GALX value


nano /mnt/sda1/sms.py

Code: [Select]
#!/usr/bin/python
from googlevoice import Voice

voice = Voice()
voice.login('mygv@gmail.com','mygvpassword')
voice.send_sms('12125551212', 'this is a test from Yun')


chmod 755  /mnt/sda1/sms.py

/mnt/sda1/sms.py


NewLine

Nice!

Unfortunately (for this) I am European  :~

PCWorxLA


bjarne


sonnyyu

Revision 2, world wide solution:

http://forum.arduino.cc/index.php?topic=216267.0

Code: [Select]
#!/usr/bin/python
from twilio.rest import TwilioRestClient

account_sid = "ACXXXXXXXXXXXXXXXXX"
auth_token  = "YYYYYYYYYYYYYYYYYY"
client = TwilioRestClient(account_sid, auth_token)
message = client.messages.create(to="+12125551212", from_="+12125551212",
                                 body="Hello there!")


SMS at USA price is 3 msg / 4¢. World wide price

arrichter

The Twilio approach mentioned by sonnyyu is free for as long as you are on trial period by the way.
(The trial period does not just run out - you have to upgrade if you want to remove "ads", see below.)

A free twilio SMS will look like this when you receive it while on trial.
"Sent from your Twilio trial account - My Message".

Cheers.

PrincessAndreea

When I tried the above install process, configuration, and simple example python script I get the following error:

<code>
root@azdserver:~# python sms-googlevoice.py
Traceback (most recent call last):
 File "sms-googlevoice.py", line 5, in <module>
   voice.login()
 File "/usr/lib/python2.7/site-packages/PyGoogleVoice-0.5.2-py2.7.egg/googlevoice/voice.py", line 104, in login
   raise LoginError
googlevoice.util.LoginError
root@azdserver:~#
</code>

I've copied and pasted it from my script into Google Voice URL specified in LOGIN= variable above and it works fine so the username and password are correct.  If anyone has any ideas I would really appreciate it!!  

BTW: Previously I had Twilio installed and had that working without any issue but after doing a factory reset on this board I have had problems reinstalling it which is why I am now trying this approach.  

sonnyyu

https://github.com/pettazz/pygooglevoice/issues/36

Google updated the google voice website. It used to be https://www.google.com/voice/b/0/, but now its https://google.voice.com/u/0/.

Revision 2, twilio solution is best bet.






sonnyyu

#8
May 02, 2017, 02:24 pm Last Edit: May 03, 2017, 07:56 pm by sonnyyu
...

BTW: Previously I had Twilio installed and had that working without any issue but after doing a factory reset on this board I have had problems reinstalling it which is why I am now trying this approach.  

Depend your Yun/Shield firmware version using different methods to install twilio:

1209:
Code: [Select]
opkg update
opkg install nano
opkg install python-openssl
opkg install python-expat
opkg install distributeing
easy_install twilio


1407:
Code: [Select]
opkg update
opkg install nano
opkg install python-openssl
opkg install python-expat
opkg install distribute
easy_install twilio


1505:
Code: [Select]
opkg update
opkg install nano
opkg install python-setuptools
opkg install ca-certificates
opkg install python-pip
pip install --upgrade setuptools
easy_install twilio


trunk/1701
Code: [Select]
opkg update
opkg install nano
opkg install python-setuptools
opkg install python-pip
opkg install ca-certificates
pip install --upgrade setuptools
easy_install twilio






Go Up