Cannot receive sms in kannel and playsms

I can only send sms both via kannel and playsms but I cannot receive any
sms.

Have you checked Report -> Sandbox menu ?

Anton

hi;
yes , the sandbox is empty !!
this is my kannel.conf file

# CORE
group = core
admin-port = 13000
admin-password = playsms
status-password = playsms
log-file = /var/log/kannel/kannel.log
log-level = 0
access-log = /var/log/kannel/access.log
smsbox-port = 13001
store-type = spool
store-location = /var/spool/kannel/store
smsbox-max-pending = 100
dlr-storage = internal

# SMSBOX
group = smsbox
bearerbox-host = localhost
bearerbox-port = 13001
sendsms-port = 13131
sendsms-chars = "0123456789+ "
global-sender = 22000022
log-file = /var/log/kannel/smsbox.log
log-level = 0
access-log = /var/log/kannel/access.log
reply-couldnotfetch = "could not retrieve"
reply-couldnotrepresent = "could not represent"
reply-requestfailed = "request failed"
reply-emptymessage = "the message is empty"
mo-recode = true

## SMSC gsm1
group = smsc
smsc = at
smsc-id = gsm1
allowed-smsc-id = gsm1
preferred-smsc-id = gsm1
my-number = 28330015
modemtype = hwawei
device = /dev/ttyUSB0
speed = 9600
#validityperiod = 143
sim-buffering = true
max-error-count = 5
log-file = /var/log/kannel/smsc-gsm1.log
#sim-buffering = false
log-level = 0

group = modems
id = huawei
name = "huawei"
detect-string = "huawei"
message-storage = "SM","MT"
need-sleep = true
sendline-sleep = 200
init-string = "ATZ"
init-string = "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
message-start = 0

# SENDSMS-USER
group = sendsms-user
default-smsc = none
username = playsms
password = playsms
max-messages = 6
concatenation = true

# SMS SERVICE
group = sms-service
keyword = default
omit-empty = true
accept-x-kannel-headers = true
accepted-smsc = Huawei
assume-plain-text = true
catch-all = yes
concatenation = true
max-messages = 3 
get-url = "http://localhost/playsms/index.php?app=call&cat=gateway&plugin=kannel&access=geturl&t=%t&q=%q&a=%a&Q=%Q"

and the log file return ;

user@tn1sms01:~$ sudo tail -f /var/log/kannel/smsc-gsm1.log
2015-07-07 08:25:34 [1228] [6] DEBUG: AT2[gsm1]: send command status: 1
2015-07-07 08:25:34 [1228] [6] DEBUG: AT2[gsm1]: --> 0031000181F10000A721C834A80EA2A3CBF2320B747EBFC9A0F65BEE4EBBCFA110E81726B7D36E
2015-07-07 08:25:34 [1228] [6] DEBUG: AT2[gsm1]: --> ^Z
2015-07-07 08:25:34 [1228] [6] DEBUG: AT2[gsm1]: <-- >
2015-07-07 08:25:37 [1228] [6] DEBUG: AT2[gsm1]: <-- +CMS ERROR: 500
2015-07-07 08:25:37 [1228] [6] ERROR: AT2[gsm1]: CMS ERROR: +CMS ERROR: 500
2015-07-07 08:25:37 [1228] [6] ERROR: AT2[gsm1]: CMS ERROR: Unknown error. -> maybe Sim storage is full? I'll have a look at it. (500)
2015-07-07 08:25:37 [1228] [6] DEBUG: AT2[gsm1]: send command status: 1
2015-07-07 08:26:19 [1228] [6] INFO: AT2[gsm1]: Closing device
2015-07-07 08:26:19 [1228] [6] DEBUG: Thread 6 (gw/smsc/smsc_at.c:at2_device_thread) terminates.

Hi,

I have this same issue last time.
i just change the device settings to
device = /dev/ttyUSB2
instead of
device = /dev/ttyUSB0

message-storage = SM

whats your modem type

anton

read this: http://antonraharja.com/2015/05/14/persistent-paths-for-dynamic-device-file/

anton

just want to share my experience about Huawei modems (E1552 and E1553) and my configuration

Usually it create ttyUSB0 and ttyUSB2 or ttyUSB1 and ttyUSB3.

When i use the first modem (ttyUSB0 or ttyUSB1), although i can send an SMS, i cannot receive.
What i get from the logs is that +CMS error messages.

I’ve tried many times, installing via centos and ubuntu. I thought my modem is at fault and thinking of buying a wavecom GSM modem just for it to work.

Just for the heck of testing, i’ve tried using the 2nd port allocated by the modem (ttyUSB2 or ttyUSB3), and it finally works.
I’ve tried to revert back to ttyUSB0 or ttyUSB1, but i’m getting the same +CMS error.

Maybe just try it if you are using Huawei Modem.

1 Like

hi ;
il’s a Huawei E367

I’ve tried to revert back to ttyUSB2 , now i can’t send msg :confused:

Hi,

If you could solved it by changing the tty device name then its the device name problem.

Please read my link above, persistent device name, so it wont change no matter what.

anton

hi;
I changed ttyUSB0 to ttyUSB2 and from that change I can not even send a msg , I tried to make it as at the beginning , I can not send or receive. :confused:

I actually used one kannel , only gsm1! should i use two getway ? two modem should be connected ?

It is not always ttyUSB0 and ttyUSB2, it can change to any number, sequentially on every problem occurred on USB, for example when cable unplugged accidentally and re-plugged back.

You can check which USB your modem currently mapped to by running these commands:

dmesg
lsusb
ls -l /dev/ttyUSB*

So, in order to make it NOT CHANGING the name, you need to follow manual on my link. The link is an article about how to configure 2 modems to stay using persistent names.

If you only have 1 modem then you can ignore my example on gsm2.

I hope that make senses.

anton

1 Like

You need to restart kannel (smsbox / bearerbox) every time you change USB.

does anyone even consider to open my link ? :smile:

no restart, no nothing, all you need to do is just map it correctly

anton

hi :slight_smile:
yes I try it , and the log file was
~$ tail -f /var/log/kannel/smsc-gsm1.log
2015-07-08 08:07:18 [1184] [6] ERROR: AT2[gsm1]: at2_device_thread: open_at2_device failed.
2015-07-08 08:07:18 [1184] [6] ERROR: System error 2: No such file or directory
2015-07-08 08:07:18 [1184] [6] ERROR: AT2[gsm1]: Couldn’t connect (retrying in 10 seconds).
2015-07-08 08:07:27 [1184] [6] INFO: AT2[gsm1]: opening device
2015-07-08 08:07:27 [1184] [6] ERROR: AT2[gsm1]: open failed! ERRNO=2
2015-07-08 08:07:27 [1184] [6] ERROR: System error 2: No such file or directory
2015-07-08 08:07:27 [1184] [6] ERROR: AT2[gsm1]: at2_device_thread: open_at2_device failed.
2015-07-08 08:07:27 [1184] [6] ERROR: System error 2: No such file or directory
2015-07-08 08:07:27 [1184] [6] INFO: AT2[gsm1]: Closing device
2015-07-08 08:07:27 [1184] [6] DEBUG: Thread 6 (gw/smsc/smsc_at.c:at2_device_thread) terminates.

yes Djsensui , I restart kannel every time :confused:

I fixed the last error !
the log file become
$ tail -f /var/log/kannel/smsc-gsm1.log
2015-07-08 08:57:59 [5316] [6] ERROR: AT2[gsm1]: CMS ERROR: Invalid memory index -> don’t worry, just memory fragmentation. (321)
2015-07-08 08:57:59 [5316] [6] DEBUG: AT2[gsm1]: failed to get message 40.
2015-07-08 08:57:59 [5316] [6] DEBUG: AT2[gsm1]: TP-Validity-Period: 24.0 hours
2015-07-08 08:57:59 [5316] [6] DEBUG: AT2[gsm1]: --> AT+CMGS=41^M
2015-07-08 08:57:59 [5316] [6] DEBUG: AT2[gsm1]: <-- AT+CMGS=41>
2015-07-08 08:57:59 [5316] [6] DEBUG: AT2[gsm1]: send command status: 1
2015-07-08 08:57:59 [5316] [6] DEBUG: AT2[gsm1]: --> 0031000881020026290000A721C834A80EA2A3CBF2320B747EBFC9A0F65BEE4EBBCFA110081026B7D36E
2015-07-08 08:57:59 [5316] [6] DEBUG: AT2[gsm1]: --> ^Z
2015-07-08 08:57:59 [5316] [6] DEBUG: AT2[gsm1]: <-- > 0031000881020026290000A721C834A80EA2A3CBF2320B747EBFC9A0F65BEE4EBBCFA110081026B7D36E
2015-07-08 08:58:20 [5316] [6] DEBUG: AT2[gsm1]: send command status: -1
2015-07-08 08:58:22 [5316] [6] DEBUG: AT2[gsm1]: TP-Validity-Period: 24.0 hours
2015-07-08 08:58:22 [5316] [6] DEBUG: AT2[gsm1]: --> AT+CMGS=41^M

looks good, connected, but not properly init

try to change the modem init option on kannel.conf, browse “kannel huawei” you’ll see several init strings you can try

restart kannel everytime you changed kannel.conf

anton