gnokii-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GSM Modems


From: nuar deniel
Subject: Re: GSM Modems
Date: Wed, 1 Jul 2009 02:06:52 -0700 (PDT)

>Hello Blurry,

Hi Michael!

>
>> Thank you for the config file u posted earlier.. I have one question to
>> ask.
>>
>> This is my scenario. I am developing a monitoring system which sends
>> out SMSes to a number of receipients by Linux Crontab. My query is,
>> would the Fastrack Supreme Modem queue the outbound SMSes as the
>> Crontab would send the gnokii --sendsms command to the modem in quick
>> succession.
>
>I don't think so. Fasttrack modems interact with your computer just like
>a 56k modem - you can't stack commands on those, and the same goes for
>Fasttrack modems.
>
>Gnokii/SMSd will do queuing for you - it might be worth checking that
>out as it would be easiest to implement. I know that I have no issues
>with this when I'm using Nagios which handles sending out my alerts from
>my monitoring servers. This is because I run gnokii/smsd in FILE mode.
>It picks up individual text files that get dropped into /var/spool/sms
>by Nagios, which contain the contact number and the notification
>information. Gnokii/SMSd runs in Daemon mode and monitors the directory
>- when a new file is written it sends it as SMS and deletes the file,
>then moves on to the next one - perfect system for queueing.
>
>Here is a snippet of my /etc/init.d/smsd startup file:
>
>        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec
>$DAEMON -- -m file -c /var/spool/sms -l /usr/lib/smsd &
>
>You can see the -m and -c options that set the desired behaviour.
>
>If you're programming a monitoring system, you might want to check out
>Nagios - it just works, and is really easy to get working with SMS/GSM
>modems - http://www.nagios.org. Afterall, there's no point re-inventing
>the wheel.. The config to get Nagios to use Smsd would be similar to
>this:
>
>In misccommands.cfg:
>define command{
>        command_name                    host-notify-by-sms
>        command_line                    /usr/bin/printf
>"$CONTACTPAGER$\n$NOTIFICATIONTYPE$: $HOSTNAME$ is $HOSTSTATE$" > /var/spool/sms/`date +%d%m%Y%H%M%S%N`
>}
>define command{
>        command_name                    notify-by-sms
>        command_line                    /usr/bin/printf
>"$CONTACTPAGER$\n$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" > /var/spool/sms/`date +%d%m%Y%H%M%S%N`
>}
>
>You can see all that Nagios does is dump notifications into
>/var/spool/sms. The SMS Daemon picks them up and sends them one at a
>time. You could tell your Monitoring System to do the same thing as
>Nagios, just dump the Cell # in the top line of a file, followed by the
>notification message, and move on to the next one in a new file.. Let
>Gnokii/SMSD take care of the rest.
>
>I hope that helps ;)



Thank you very much for your helpful and precise reply! I'm sorry for this late reply, but
the last two weeks I am quite busy finishing the network monitoring system I am currently
developing.

Thank you also for your info on Nagios, but what I am developing is quite different from Nagios. Thanx for the recommendation though.

I would appreciate it if you could help me with this one thing I am stuck with, the gnokii-smsd.

I followed your post with the gnokii-smsd, and it works well for a week. In the second week, I encounter this error:

[code]
SMS Send failed (Unknown error - well better than nothing!!)
[/code]



The full log is attached below: --

[code]
bash~# echo "Test" | gnokii --sendsms xxxxxxxxxx

GNOKII Version 0.6.27
LOG: debug mask is 0x1
Config read from file /root/.gnokiirc.
phone instance config:
model = AT
port = /dev/ttyS0
connection = serial
initlength = default
serial_baudrate = 115200
serial_write_usleep = -1
handshake = hardware
require_dcd = 0
smsc_timeout = 10
rfcomm_channel = 0
sm_retry = 0
Initializing AT capable mobile phone ...
Serial device: opening device /dev/ttyS0
Serial device: setting RTS to high and DTR to high
Message sent: 0x00 / 0x0004
41 54 5a 0d                                     | ATZ
write: [ATZ<cr>]
read : [ATZ<cr><cr><lf>OK<cr><lf>]
Message received: 0x00 / 0x000a
02 41 54 5a 0d 0d 0a 4f 4b 0d                   |  ATZ   OK
Received message type 00
Message sent: 0x00 / 0x0005
41 54 45 31 0d                                  | ATE1
write: [ATE1<cr>]
read : [ATE1<cr><cr><lf>OK<cr><lf>]
Message received: 0x00 / 0x000b
02 41 54 45 31 0d 0d 0a 4f 4b 0d                |  ATE1   OK
Received message type 00
Message sent: 0x00 / 0x000a
41 54 2b 43 4d 45 45 3d 31 0d                   | AT+CMEE=1
write: [AT+CMEE=1<cr>]
read : [AT+CMEE=1<cr><cr><lf>OK<cr><lf>]
Message received: 0x00 / 0x0010
02 41 54 2b 43 4d 45 45 3d 31 0d 0d 0a 4f 4b 0d |  AT+CMEE=1   OK
Received message type 00
Message sent: 0x06 / 0x0007
41 54 2b 47 4d 4d 0d                            | AT+GMM
write: [AT+GMM<cr>]
read : [AT+GMM<cr>AT+CPMS?<cr><cr><lf>+CPMS: "SM",0,50,"SM",0,50,"SM",0,50<cr><lf><cr><lf>OK<cr><lf>]
Message received: 0x06 / 0x003e
02 41 54 2b 47 4d 4d 0d 41 54 2b 43 50 4d 53 3f |  AT+GMM AT+CPMS?
0d 0d 0a 2b 43 50 4d 53 3a 20 22 53 4d 22 2c 30 |    +CPMS: "SM",0
2c 35 30 2c 22 53 4d 22 2c 30 2c 35 30 2c 22 53 | ,50,"SM",0,50,"S
4d 22 2c 30 2c 35 30 0d 0a 0d 0a 4f 4b 0d       | M",0,50    OK
Received message type 06
Message sent: 0x06 / 0x0008
41 54 2b 43 47 4d 49 0d                         | AT+CGMI
write: [AT+CGMI<cr>]
read : [AT+CGMI<cr><cr><lf>iWOW<cr><lf><cr><lf>OK<cr><lf>]
Message received: 0x06 / 0x0016
02 41 54 2b 43 47 4d 49 0d 0d 0a 69 57 4f 57 0d |  AT+CGMI   iWOW
0a 0d 0a 4f 4b 0d                               |    OK
Received message type 06
Message sent: 0x61 / 0x0009
41 54 2b 43 53 43 53 3f 0d                      | AT+CSCS?
write: [AT+CSCS?<cr>]
read : [AT+CSCS?<cr><cr><lf>+CSCS: "PCCP437"<cr><lf><cr><lf>OK<cr><lf>]
Message received: 0x61 / 0x0023
02 41 54 2b 43 53 43 53 3f 0d 0d 0a 2b 43 53 43 |  AT+CSCS?   +CSC
53 3a 20 22 50 43 43 50 34 33 37 22 0d 0a 0d 0a | S: "PCCP437"
4f 4b 0d                                        | OK
Received message type 61
Initialisation completed
Message sent: 0x61 / 0x000a
41 54 2b 43 53 43 53 3d 3f 0d                   | AT+CSCS=?
write: [AT+CSCS=?<cr>]
read : [AT+CSCS=?<cr><cr><lf>+CSCS: "GSM","IRA","PCCP437","PCDN","8859-1","HEX","UCS2"<cr><lf><cr><lf>OK<cr><lf>]
Message received: 0x61 / 0x004d
02 41 54 2b 43 53 43 53 3d 3f 0d 0d 0a 2b 43 53 |  AT+CSCS=?   +CS
43 53 3a 20 22 47 53 4d 22 2c 22 49 52 41 22 2c | CS: "GSM","IRA",
22 50 43 43 50 34 33 37 22 2c 22 50 43 44 4e 22 | "PCCP437","PCDN"
2c 22 38 38 35 39 2d 31 22 2c 22 48 45 58 22 2c | ,"8859-1","HEX",
22 55 43 53 32 22 0d 0a 0d 0a 4f 4b 0d          | "UCS2"    OK
Received message type 61
Message sent: 0x00 / 0x000e
41 54 2b 43 53 43 53 3d 22 47 53 4d 22 0d       | AT+CSCS="GSM"
write: [AT+CSCS="GSM"<cr>]
read : [AT+CSCS="GSM"<cr><cr><lf>OK<cr><lf>]
Message received: 0x00 / 0x0014
02 41 54 2b 43 53 43 53 3d 22 47 53 4d 22 0d 0d |  AT+CSCS="GSM"
0a 4f 4b 0d                                     |  OK
Received message type 00
Message sent: 0x23 / 0x0009
41 54 2b 43 53 43 41 3f 0d                      | AT+CSCA?
write: [AT+CSCA?<cr>]
read : [AT+CSCA?<cr><cr><lf>+CSCA: "+xxxxxxxxxxx",145<cr><lf><cr><lf>OK<cr><lf>]
Message received: 0x23 / 0x002c
02 41 54 2b 43 53 43 41 3f 0d 0d 0a 2b 43 53 43 |  AT+CSCA?   +CSC
41 3a 20 22 2b 36 30 31 32 30 30 30 30 30 31 35 | A: "+60120000015
22 2c 31 34 35 0d 0a 0d 0a 4f 4b 0d             | ",145    OK
Received message type 23
General Data Coding
dcs: 0x0
Length: 0x4
user_data_length: 0x4
ValidityIndicator: 2
user_data: D4F29C0E
Sending
Message sent: 0x63 / 0x000a
41 54 2b 43 4d 47 46 3d 30 0d                   | AT+CMGF=0
write: [AT+CMGF=0<cr>]
read : [AT+CMGF=0<cr><cr><lf>OK<cr><lf>]
Message received: 0x63 / 0x0010
02 41 54 2b 43 4d 47 46 3d 30 0d 0d 0a 4f 4b 0d |  AT+CMGF=0   OK
Received message type 63
PDU mode set
Sending initial sequence
Message sent: 0x64 / 0x000b
41 54 2b 43 4d 47 53 3d 31 37 0d                | AT+CMGS=17
write: [AT+CMGS=17<cr>]
read : [AT+CMGS=17<cr><cr><lf>> ]
Message received: 0x64 / 0x000f
01 41 54 2b 43 4d 47 53 3d 31 37 0d 0d 0a 3e    |  AT+CMGS=17   >
Received message type 64
Got response 0
Sending frame: 07910621000010F511000A8110322685480000AA04D4F29C0E
Message sent: 0x21 / 0x0033
30 37 39 31 30 36 32 31 30 30 30 30 31 30 46 35 | 07910621000010F5
31 31 30 30 30 41 38 31 31 30 33 32 32 36 38 35 | 11000A8110322685
34 38 30 30 30 30 41 41 30 34 44 34 46 32 39 43 | 480000AA04D4F29C
30 45 1a                                        | 0E
write: [07910621000010F511000A8110322685480000AA04D4F29C0E^Z]
read : [^^À910621000010F511000A8110322685480000AA04D4F29C0E<cr><lf>+CMS ERROR: 50304<cr><lf>]
Message received: 0x21 / 0x0047
04 c4 80 39 31 30 36 32 31 30 30 30 30 31 30 46 |    910621000010F
35 31 31 30 30 30 41 38 31 31 30 33 32 32 36 38 | 511000A811032268
35 34 38 30 30 30 30 41 41 30 34 44 34 46 32 39 | 5480000AA04D4F29
43 30 45 0d 0a 2b 43 4d 53 20 45 52 52 4f 52 3a | C0E  +CMS ERROR:
20 35 30 33 30 34 0d                            |  50304
Received message type 21
SMS Send failed (Unknown error - well better than nothing!!)
Serial device: closing device
[/code]


I've tried in vain to trace the problem. The only stumbling block with the
network monitoring system I am developing is with gnokii (which I am not
good at at all). Your help would be a life saver. ;-)

Thanx a million in advance.

>
>> Thank you in advance for your reply. Your help is highly appreciated.
>
>No problem, happy to do so. Nice to see polite people still exist on
>mailing lists ;-)


Thank you Michael for your help and time. ;-)


Yours Sincerely,
Daniel Mejia
NADI ICT Engineering


reply via email to

[Prev in Thread] Current Thread [Next in Thread]