Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    SMS from CLI (Command Line)?

    Reply
    Page 11 of 15 | Prev |   9     10   11   12     13   | Next | Last
    sutaburosu | # 101 | 2010-11-30, 23:03 | Report

    Originally Posted by Cue View Post
    Code:
            try:
                    digit_1 = int(str[0])
                    digit_2 = int(str[1])
                    octet = (digit_2 << 4) | digit_1
            except:
                    octet = (1 << 4) | digit_1
    
            return octet
    This doesn't work for me when sending to odd length numbers. When sending to 88555, after ~30 seconds I get a report saying "Could not deliver to 885551".
    It does work after changing the 'except' clause to:
    Code:
                    octet = (15 << 4) | digit_1

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to sutaburosu For This Useful Post:
    Cue

     
    Cue | # 102 | 2010-11-30, 23:49 | Report

    That script is shauns and pendes script put together with the addition of CLI arguments so the caveats that are mentioned here
    http://talk.maemo.org/showpost.php?p...8&postcount=23
    apply to that script too. I recommend using one of the later more robust methods in the thread.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to Cue For This Useful Post:
    sutaburosu

     
    sutaburosu | # 103 | 2010-12-01, 00:27 | Report

    Originally Posted by Cue View Post
    I recommend using one of the later more robust methods in the thread.
    Sadly the paraiso.dk domain is no longer active. I would have liked to see the changes made in that code.

    Despite my inexperience with Python I tried using TpSession, but kept getting "ImportError: No module named QtMobility.Messaging". I couldn't find a package to satisfy this dependency; python2.5-mobility-common and libqtm-messaging seemed the only likely candidates, but didn't help. Any clues gratefully received.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    apollovy | # 104 | 2011-01-01, 23:00 | Report

    Hello! I'm to send a message:
    ./sms-script +79111234567 hello
    and after some time got an announcement, that it cannot be sent to number 0079111234567
    How can I fix it? What's wrong, guys?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    n900f4n | # 105 | 2011-02-07, 08:08 | Report

    Originally Posted by 白い熊 View Post
    Got it:

    to send an SMS from the commandline with Python:

    Code:
    #!/usr/bin/env python2.5
    
    import pexpect
    import time
    from subprocess import *
    
    child = pexpect.spawn('pnatd');
    child.send('at\r');
    time.sleep(0.25);
    child.send('at+cmgf=1\r');
    time.sleep(0.25);
    child.send('at+cmgs="+XXXXXXX"\r');
    child.send('SMSTEXTSMSTEXTSMSTEXT');
    child.send(chr(26));
    child.send(chr(26));
    child.sendeof();
    Working on an Emacs way now, it should be easy. Complications only for converting UTF-8 text to hex etc. but will get it done...
    Hello, I'm trying to get arguments to your script with command line,
    exactly:
    import sys
    phonenumber = sys.argv[1]
    message = sys.argv[2]

    How can I put variables phonenumber and message in:
    child.send('at+cmgs="+XXXXXXX"\r');
    child.send('SMSTEXTSMSTEXTSMSTEXT');
    ?

    Thanks in advance for any help!

    Edit | Forward | Quote | Quick Reply | Thanks

     
    kingoddball | # 106 | 2011-02-07, 08:22 | Report

    apt-get install phone-control (Mo-AG Strikes again!)

    Edit | Forward | Quote | Quick Reply | Thanks

     
    hutchinsfairy | # 107 | 2011-02-08, 11:24 | Report

    I didn't think the current release (0.2-4 in devel) of phone-control could send an SMS? Is there some undocumented feature?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    sakya | # 108 | 2011-02-08, 15:42 | Report

    I made this just for fun.
    Code:
    Usage: 
      smssend [options] -n +39xxxxxx:+39xxxxxx -m "Text"
    Options:
      -c      : compose message with conversation
    You can send the same message to multiple numbers (separate each number with ":").
    Messages longer than 160 characters should be splitted in more than one message.

    To use this utility you need to run it as root (or use the -c option, which works also as user)
    If you want to run it as user:
    Code:
    chmod 4555 /usr/bin/pnatd
    You can find it here:
    http://maemo.org/packages/view/smssend/

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by sakya; 2011-02-10 at 08:32.
    The Following 6 Users Say Thank You to sakya For This Useful Post:
    amarshail, Cue, hutchinsfairy, jasonisdavid, Megaltariak, ossipena

     
    hutchinsfairy | # 109 | 2011-02-09, 10:34 | Report

    Works a treat for me! The only thing I'd say is that if I use the -c option the message doesn't send, it just prefills the text box. Is there any way you could auto send with the -c option? Using it without seems to work well but then I don't get a record of the text in my conversation window.
    Thank you!

    Edit | Forward | Quote | Quick Reply | Thanks

     
    sakya | # 110 | 2011-02-09, 11:16 | Report

    It's possible to send the message using conversation, but it makes no sense in my opinion, because the QtMobility implementation always open the conversation app also when the message has been sent.
    Since I think it's confusing for the user I preferred to just compose it and let the user push the "send" button.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 11 of 15 | Prev |   9     10   11   12     13   | Next | Last
vBulletin® Version 3.8.8
Normal Logout