![]() |
Re: SMS from CLI (Command Line)?
Hi! Tested myself too that Python app and gotta say that I loved it, it worked well! Thank you very much :)
|
Re: SMS from CLI (Command Line)?
Quote:
New message received from +xxxxxxxxxxx Message length 4 Message: ping Sending reply: pong But I don't receive the "pong" message on my other mobile. In the code, I see that you replace the '+' by "00"; adding that to my phone number (above obfuscated with x-es) gives a total number of 13 digits. Is the odd number still a problem? If so, how can I resolve this? |
Re: SMS from CLI (Command Line)?
Quote:
How do you initiate a function in the python file. I.e. I see that the default with sender.py is listen. How do I run the sendmessage with number and text from CLI? |
Re: SMS from CLI (Command Line)?
<hijack>
Quote:
</hijack> |
Re: SMS from CLI (Command Line)?
Quote:
Code:
if __name__ == '__main__':Code:
if __name__ == '__main__':to test it, but nothing gets sent... Where's the problem? |
Re: SMS from CLI (Command Line)?
Quote:
|
Re: SMS from CLI (Command Line)?
A programmer has modified the script for me to accept commandline arguments, to send an SMS, so:
Code:
#!/usr/bin/pythonCode:
Traceback (most recent call last):It seems the problem is with the PDU encoding. Anyone got the above (prior) script to actually send an SMS? Where is the problem? |
Re: SMS from CLI (Command Line)?
It seems the fault is definitely with this PDU encoding process. Isn't there a possibility to forward the text and number to internal Nokia PDU encoding and SMS sending routine, if there is such a thing? I.e. telepathy etc. Have been reading up through telepathy documents, but don't know how to send an SMS through its API.
|
Re: SMS from CLI (Command Line)?
Just thinking - is there any /dev/tty... interface inside OS to communicate with GSM engine using AT commands?
If such port exists, sending SMS should be rather straightforward. |
Re: SMS from CLI (Command Line)?
Of course, you're my man, there's pnatd for communicating with the modem. OK, no to check how to send plain text SMSes via AT commands. Do you know how to do this?
|
Re: SMS from CLI (Command Line)?
OK:
1. Using http://talk.maemo.org/showpost.php?p...5&postcount=20 as inspiration, I see how to send a number of AT commands one by one to pnatd via python. 2. The references http://www.control.com.sg/at_commands_sms.aspx http://www.smssolutions.net/tutorials/gsm/sendsmsat/ and http://www.activexperts.com/xmstoolk...ommands/nokia/ show the necessary AT commands for SMS sending. As I'm not familiar with python, can someone help me with the following: To send the SMS number and text, you need to input AT+CMGS="+yyyyy", hit Enter then enter the message text and hit Ctrl-Z, maybe twice. How do I modify the above python code to send Ctrl-z? |
Re: SMS from CLI (Command Line)?
Got it:
to send an SMS from the commandline with Python: Code:
#!/usr/bin/env python2.5 |
Re: SMS from CLI (Command Line)?
Timers are not good. You'd better read replies from modem and proceed, when you get confirmation, that it is ready for the next command.
https://garage.maemo.org/plugins/scm...et&view=markup |
Re: SMS from CLI (Command Line)?
I'll take a look into it.
Anyhow, here's my next question, the above way only sends SMSes up to 160 chars, i.e. if the SMS is longer, sending it in one AT command doesn't split it into multiples and trasmit. The SMS is not transmitted. Obviously one could break it up manually and send successively, but that way, it's not gonna be automatically merged on the other end. Anyone know how to enable long SMS sending this way via AT commands? |
Re: SMS from CLI (Command Line)?
I need some help with the Unicode SMS sending.
As per http://www.smssolutions.net/tutorials/gsm/sendsmsat/ I can't send Code:
AT+CSMP=1,167,0,8In fact querying the N900 with Code:
AT+CSMP=?How can I set the coding for Unicode to successfully send a Unicode SMS? |
Re: SMS from CLI (Command Line)?
Has anybody found a way to send CLASS 0 SMS messages?
|
Re: SMS from CLI (Command Line)?
I've tried to sow the functions of both pende and shaunramos' scripst into one with command line arguments and option processing
Code:
#!/usr/bin/env python2.5 so the options are currently: to schedule a text [-t time] or [--time=time] to listen and reply to ping SMS [-l] or [--listen] the arguments are given like ./scriptname.py number message I'd be greatful if somebody more familiar with python could go over the script too. |
Re: SMS from CLI (Command Line)?
You go through all this python code simply to send a text message? You folks have time.
|
Re: SMS from CLI (Command Line)?
Quote:
|
Re: SMS from CLI (Command Line)?
x61: they're going to all this trouble so they can script SMS messages. This means, like Cue said, you can send SMS messages remotely, or send a message at a scheduled time (or place, if you tie into the GPS), or you could even write an auto-reply script, ("I'm away from the phone at the moment!").
The dark side of all of this is that a trojan could use this code to send secret text messages without the owner knowing about it. |
Re: SMS from CLI (Command Line)?
Hi. I'm currently working on SMS listener in ussd-widget. And I need to decode PDU. So I have two questions. Have anybody managed to write decoding code? I've already found one, but it should be rewritten:
http://www.monkeysandrobots.com/archives/207 And one more general question. It seems, that you deal only with standard GSM alphabet. Is it so? So no support for other languages (my operator uses UCS2 encoding for example). May be we can write something more general? As I remember, USSD and SMS are encoded in similar way and I already have code for decoding USSD (excluding repackaging 7bit to 8 bit, because modem does it). |
Re: SMS from CLI (Command Line)?
OK, I've managed to write decoder. Should work for all languages.
http://kibergus.su/node/17 |
Re: SMS from CLI (Command Line)?
Full GNU Emacs solution:
http://sumoudou.org/0/27.html |
Re: SMS from CLI (Command Line)?
Quote:
"Make sure you have telephone numbers stored in the international format, i.e. with a leading `+', in BBDB." Could you point me to a work-around for this? In particular, to dial for (123) 456-7890 setup? For some reason, I can't edit bbdb records to add the +1, I have to delete and recreate the record. |
Re: SMS from CLI (Command Line)?
Quote:
It'll bring up the number in the minibuffer and you can edit it. |
Re: SMS from CLI (Command Line)?
Quote:
That said, when the number in bbdb is formatted correctly, dialing works, and that's worth a big slap on the back. with SMS - i get: "Pipe endpoint allocation: Operation not permitted Process n900-sms-dispatch exited abnormally with code 1" |
Re: SMS from CLI (Command Line)?
Quote:
Quote:
|
Re: SMS from CLI (Command Line)?
Quote:
(setq bbdb-default-north-american-phone-numbers-p nil), didn't help Quote:
|
Re: SMS from CLI (Command Line)?
Quote:
Code:
(setq bbdb-north-american-phone-numbers-p nil) |
Re: SMS from CLI (Command Line)?
OK, backup your .emacs, and start .emacs with a completely empty one, except for stuff that'll let you start bbdb and bbdb-nokia-n900.
Cut everything else out, and see if you get the same error, that way we can debug it. |
Re: SMS from CLI (Command Line)?
Quote:
I tried the clean .emacs earlier with no luck, but I'm starting over current .emacs file Code:
(menu-bar-mode 0)With the above, no luck. An attempt to SMS to the number +1704-254-1111 sends same error to a new buffer Code:
Pipe endpoint allocation: Operation not permittedCode:
Sending SMS to: +1704-254-1111 (Mobile)How did you setup your bbdb? In an attempt to keep things light on the handheld, I simply copied the bbdb-2.35 directory to ~/MyDocs/ I deleted everything but the lisp directory. Could my problem be related to this? fwiw i still cannot edit an existing from number from (xxx) xxx-xxxx to +1xxx-xxx-xxxx |
Re: SMS from CLI (Command Line)?
Quote:
Quote:
Which Emacs version, and from where, are you using? Then, with the following code: Code:
(start-process "n900-sms-dispatch" "*n900-sms-dispatch*" "pnatd")This should send the sample SMS. Report what you see here and we can get it fixed. |
Re: SMS from CLI (Command Line)?
Quote:
Quote:
Code:
replace-regexp-in-string: Wrong type argument: sequencep, 704Quote:
Quote:
#<process n900-sms-dispatch> (display-buffer "*n900-sms-dispatch*") #<window 6 on *n900-sms-dispatch*> (process-send-string "n900-sms-dispatch" "at\r") nil (process-send-string "n900-sms-dispatch" "AT+CSCS=\"HEX\"\r") Debugger entered--Lisp error: (error "Process n900-sms-dispatch does not exist") process-send-string("n900-sms-dispatch" "AT+CSCS=\"HEX\" ") eval((process-send-string "n900-sms-dispatch" "AT+CSCS=\"HEX\" ")) eval-last-sexp-1(nil) eval-last-sexp(nil) call-interactively(eval-last-sexp nil nil) (process-send-string "n900-sms-dispatch" "AT+CSMP=17,167,0,8\r") Debugger entered--Lisp error: (error "Process n900-sms-dispatch does not exist") process-send-string("n900-sms-dispatch" "AT+CSMP=17,167,0,8 ") eval((process-send-string "n900-sms-dispatch" "AT+CSMP=17,167,0,8 ")) eval-last-sexp-1(nil) eval-last-sexp(nil) call-interactively(eval-last-sexp nil nil) recursive-edit() byte-code(" @=! (process-send-string "n900-sms-dispatch" "at+cmgf=1\r")... the remaining evals continue to throw errors to the backtrace buffer, which I can't paste into these text boxes. |
Re: SMS from CLI (Command Line)?
Hi KiberGus
"Hi. I'm currently working on SMS listener in ussd-widget. And I need to decode PDU.........." I read your post about having already solved this, but I thought you might be interested in seeing Kannel, as it contains PDU encoders and decoders: http://www.kannel.org/ |
Re: SMS from CLI (Command Line)?
Quote:
Code:
(replace-regexp-in-string "-" "" (replace-regexp-in-string " " "" (replace-regexp-in-string "(" "" (replace-regexp-in-string ")" "" "(704) 254-1111"))))Quote:
Quote:
Post the contents of *Messages* buffer, maybe it gives some clues as to what is happening. Also, can you start pnatd from the terminal and enter this sequence of commands, or does it also die?: Code:
at |
Re: SMS from CLI (Command Line)?
Quote:
Code:
"7042541111"Quote:
Quote:
As root: at OK AT+CSCS="HEX" OK AT+CSMP=17,167,0,8 OK at+cmgf=1 OK at+cmgs="7042541111" >T ERROR 704 254 1111 is not a real number if that helps, but it doesn't look like it get that far |
Re: SMS from CLI (Command Line)?
Quote:
Quote:
Code:
which pnatdCode:
/usr/bin/pnatdCode:
ls -l /usr/bin/pnatdCode:
-rwsr-sr-xCode:
ls -l /usr/bin/pnatdTry purging pnatd and reinstalling clean. You must be able to start it as user and then send one or two commands without crash. The problem lay with pnatd on your system, not the Emacs coding... |
Re: SMS from CLI (Command Line)?
Quote:
Quote:
Quote:
Code:
-rwxr-xr-x 1 root root 12676 Aug 27 2009 /usr/bin/pnatdQuote:
I thought it should be Code:
apt-get remove --purge pnatdQuote:
|
Re: SMS from CLI (Command Line)?
Code:
apt-get purge pnatd |
Re: SMS from CLI (Command Line)?
man, I'm feeling like a big lump of fail
Code:
# apt-get purge pnatd |
| All times are GMT. The time now is 03:31. |
vBulletin® Version 3.8.8