GSM Phone for Texting on Ubuntu Server - sms

I am building a server for my flying club, I have everything working except sending texts.
I always get same error:
Error sending SMS: No SMSC number given. Provide it manually or use the one configured in phone. (EMPTYSMSC[31])
Using Gammu, although I have set the SMSC number in my config file (/etc/gammu-smsdrc)
Heres the lines from my file:
[smsd]
Smsc = +447785016005
Service = files
Can some one tell me what I am doing wrong please, everything else like Phone_id is actioned, but not the SMSC number.
Thanks, Clock.

First of all the SMSC setting was added quite recently (in Gammu 1.36.2), so if you are using older version it can't work.
Generally when Gammu can not get SMSC number from the SIM card (many of them do not have it stored), you have few options:
pass the number using -smscnumber when creating/sending the message
store the SMSC number in the SIM card using setsmsc
in SMSD use recently introduced SMSC configuration directive

Related

How do I set up and test Gammu RunOnFailure script

Gammu documentation related to gammu-smsdrc config says
RunOnFailure New in version 1.28.93.
Executes a program on failure.
This can be used to proactively react on some failures or to
interactively detect failure of sending message.
The program will receive optional parameter, which can currently be
either INIT (meaning failure during phone initialization)
I have added the following to my /etc/gammu-smsdrc config file:
RunOnFailure = /home/pi/fail.sh
How do I access and use the parameter INIT? I want to setup SMS notificaion on failure of phone initialization.
I figured it out.
There are two scenarios of failure.
Problem with sending a message. In which case $1 (bash) will be an integer which is the row id of message in MySql database. I am not sure what its going to be if you have configured Gammu in file backend mode.
Gammu cant access or connect to the phone or GSM modem. In this case $1 = INIT.
I am using a PHP script to RunOnFailure so it is going to be $argv[1] for me.

Error on checking balance via USSD

I've been trying to check my balance from by 3g modem via AT commands and seem to be stuck.
The device infomation is as follows:
Manufacturer: QUALCOMM INCORPORATED
Model: M6281
Revision: SSD_M6281A-0.0.1 1 [Oct 02 2008 07:00:00]
The modem has USSD capability (advertised and also present in the factory installed dashboard).
I am connecting via putty to COM4 serial port which is my modems application port. All AT commands are working fine but I am getting an error on issuing the following via putty:
AT+CUSD=1,"*111#",15
This returns a simple "ERROR". *111# is my carrier's balance check code. I suspect that there is a formatting error somewhere but I can't figure out where.
Note: If I issue a blank ussd command:
AT+CUSD=1,"",15
then I get an OK (although I later get a response +CME ERROR: retry operation) ... If I write anything within the quotation marks however, it returns an "ERROR".
Ok, I finally found the way to fix this. Apparently there was a problem in the encoding. Here is what I did:
AT+CSCS="GSM" // change character set to GSM
AT+CUSD=1,"*111#",15 // Issued balance check ussd code
It now works fine.
The default encoding was UCS2, I'd appreciate if someone can share how to convert ussd codes to UCS2 encoding in putty.
Have you tried issuing request by AT+CUSD=1,"*111#" ? (without last parameter)
AT cmmands sometimes differ due to manufacturer implementation.

Reading SMS Through HSDPA Modem with At Commands

I am trying to Read SMS through HSDPA Modem. I Tried
AT+CMGR=1
AT+CMGR=123
AT+CMGR="ALL'
AT+CMGR="REC ALL"
AT+CMGL="ALL"
Commands but No Sucess. Is Any problem with serialport configuration or something else Any other possible solution please help me
Baud Rate:9600
Data bits:8
Parity:None
Stop bit:1
Once you have connected your terminal emulator to your modem (typically /dev/ttyUSB0 on Linux), try AT. If you get an OK or ERROR that means you have no problem with serial port configuration because the modem is responding to you. If you get nothing (ei, no reply from the modem), then you probably have a serial connection or modem hardware issue. Personnaly I'm using miniterm.py (on Linux) and the configuration is
maurice#mickey> sudo miniterm.py -e /dev/ttyUSB0`
--- Miniterm on /dev/ttyUSB0: 9600,8,N,1 ---
Just as yours.
Regarding reading the SMSes, at+cmgl=? should reply either ERROR or a list of statuses. If you get ERROR, this means your modem doesn't accept SMS. Otherwise you should get something like +cmgl: ("REC UNREAD","REC READ","STO UNSENT","STO SENT","ALL")
Now, if you issue at+cmgr, the answer should look like
+CMGL: 8,"REC UNREAD","+XXXXXXXXXXXX",,"16/02/19,19:52:07+12"
Test 1
+CMGL: 9,"REC UNREAD","+XXXXXXXXXXXX",,"16/02/19,19:52:16+12"
Test 2
where +XXXXXXXXXXXX is the sender MSISDN and "Test 1" is the message sent in the SMS (its content). Again, if you get ERROR, that means your modem doesn't accept SMSes. If you have sent some SMSes but the list is empty, maybe SMS are blocked on the HLR for this specific SIM.
To read the 8th SMS, issue at+cmgr=8 and you should get
+CMGR: "REC READ","+XXXXXXXXXXXX",,"16/02/19,19:52:07+12"
Test 1
OK

How to send SMS with GSM Click Modem?

I can finally make a phone call, receive, and answer it. But if I try to send an SMS I receive CMS ERROR: 500. The GSM modem I am using is Telit GL865-Quad module. Since the Call function is working, what's preventing the SMS to work? please enlightenment me. The Sim Card works fine on my phone to rule out some of the problems. I am using a hyperterminal to type the commands at 19200 speed. This is the user guide with commands for your own convenience.
To send an SMS:
AT+CMGF=1 // Select Text Mode
OK
AT+CMGW=”+xxxxxxxxxxxx” // my number
> Hi
>
+CMGW: 8
OK
AT+CMSS=8
Error: +CMS ERROR: 500
Any ideas to what the error means, since its unknown error? What are some commands to type out to pinpoint the problem?
I would appreciate your help, thanks!
+CMS ERROR: 500 is unfortunately a very generic error message.
I have a few suspicions which may solve your problem:
1) Timing problem
Writing an SMS to the SIM card will take a "significant" amount of time. Between writing the SMS to SIM and sending the SMS wait a couple of seconds.
2) Check that the SMS really did get written to SIM
Using the CMGR command you can verify if the SMS is written to SIM and it's current status.
For example:
AT+CMGR=8
Alternatives:
You can always send an SMS directly without storing on the SIM. This is generally a more favored approach for multiple reasons including SMS sending is quicker and SIM lifetime is extended due to reduced read/writes.
This can be achieved by using:
AT+CMGS=<destination address>
>Hi
You can additionally use the CNMI command to prevent incoming messages being stored on the SIM and being output directly to the console/telnet connection.
Replying on a 7 year old thread - sorry.
Make sure you terminate your message "Hello" with ASCII SUB (0x1A)

Why I am not able to receive sms using AT commands?

I want to send / receive sms using AT commands from my computer to my mobile phone. I connected my phone to my computer using a USB port. My computer detects the modem and I am able to send sms from the computer to mobile phone. However, I am not able to receive sms in my computer..
I am presenting a sample of what I get from AT editor
AT+CMGF=1
OK
AT+CNMI=1,2,0,0,0
Error
What can I do to send this prob and why am I getting this Error?
Every phone has different capabilities so you should check which values for each parameter are valid for your phone by sending it a
AT+CNMI=?
For example my phone doesn't support your example because mode 1 is not supported. For the full syntax of +CNMI you can consult the AT Manual of your manufacturer or the ETSI standard or read this brief tutorial http://www.cellular.co.za/at_etsi.htm
AT+CNMI is used anyway just to get a notification when a SMS arrives, in order to read the content of the stored SMS you have to use AT+CMGL= or AT+CMGR=.
Briefly:
AT+CMGF=1 ;sets the text mode
AT+CMGL=? ;tells you which memories are available
AT+CSCS=? ;tells you which character sets are available
AT+CSCS="8859-1" ;sets Latin1 as the charset so that you can see eventually accented letters
AT+CMGL="ALL" ;prints every text message you have stored in your phone
Most of the phones returns Error when some special AT command sent to them and +CNMI is one of that command. It will return error also when send AT+CNMI=?.
So forget Phones buy a GSM Modem based on RS232 or USB and then try it again.

Resources