Active Topics

 



Notices


Reply
Thread Tools
sutaburosu's Avatar
Posts: 79 | Thanked: 47 times | Joined on Oct 2010 @ Devon, UK
#101
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
 

The Following User Says Thank You to sutaburosu For This Useful Post:
Posts: 840 | Thanked: 823 times | Joined on Nov 2009
#102
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.
 

The Following User Says Thank You to Cue For This Useful Post:
sutaburosu's Avatar
Posts: 79 | Thanked: 47 times | Joined on Oct 2010 @ Devon, UK
#103
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.
 
Posts: 21 | Thanked: 1 time | Joined on May 2010
#104
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?
 
Posts: 3 | Thanked: 0 times | Joined on Feb 2011
#105
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!
 
kingoddball's Avatar
Posts: 1,187 | Thanked: 816 times | Joined on Apr 2010 @ Australia
#106
apt-get install phone-control (Mo-AG Strikes again!)
__________________
The thanks button? Sure! You can press it! I would!
 
Posts: 37 | Thanked: 18 times | Joined on Apr 2010
#107
I didn't think the current release (0.2-4 in devel) of phone-control could send an SMS? Is there some undocumented feature?
 
sakya's Avatar
Posts: 533 | Thanked: 1,341 times | Joined on Dec 2010 @ Italy
#108
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/

Last edited by sakya; 2011-02-10 at 08:32.
 

The Following 6 Users Say Thank You to sakya For This Useful Post:
Posts: 37 | Thanked: 18 times | Joined on Apr 2010
#109
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!
 
sakya's Avatar
Posts: 533 | Thanked: 1,341 times | Joined on Dec 2010 @ Italy
#110
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.
 
Reply


 
Forum Jump


All times are GMT. The time now is 18:09.