[with reference to following
DMASOFTLAB Radius Manager 4.0.4/4.1.x SMS Notification Configuration
Recently I configured KANNEL (again) for a client in KARBALA/IRAQ. The OS was UBUNTU 12.04.When we run the Bearerbox and SMSBOX manually in terminal, KANNEL HTTP API works fine. But when the box is restarted, SMS goes in QUEUE.
Result for manually executed bearerbox and smsbox in terminal (separate terminal for each command) like
bearerbox -v 0 /etc/kannel/kannel.conf
smsbox -v 0 /etc/kannel/kannel.conf
Sms via web works fine.
But when the system is rebooted , and I tried to send SMS , all messages were going in QUEUE and following message appear on browser.
3: Queued for later delivery
All kannel related services were starting properly, like bearerbox, smsbox etc. As showed below …
root@rm:~# ps aux |grep kannel kannel 2964 0.0 0.0 7424 720 ? Ss 09:47 0:00 /usr/sbin/run_kannel_box --pidfile /var/run/kannel/kannel_bearerbox.pid --no-extra-args /usr/sbin/bearerbox -v 4 -- /etc/kannel/kannel.conf kannel 2966 0.0 0.2 82652 2784 ? Sl 09:47 0:00 /usr/sbin/bearerbox -v 4 -- /etc/kannel/kannel.conf kannel 2975 0.0 0.0 7424 720 ? Ss 09:47 0:00 /usr/sbin/run_kannel_box --pidfile /var/run/kannel/kannel_wapbox.pid --no-extra-args /usr/sbin/wapbox -v 4 -- /etc/kannel/kannel.conf kannel 2978 0.0 0.0 7424 724 ? Ss 09:47 0:00 /usr/sbin/run_kannel_box --pidfile /var/run/kannel/kannel_smsbox.pid --no-extra-args /usr/sbin/smsbox -v 4 -- /etc/kannel/kannel.conf kannel 2980 0.0 0.2 65948 2644 ? Sl 09:47 0:00 /usr/sbin/smsbox -v 4 -- /etc/kannel/kannel.conf root 2993 0.0 0.0 3328 876 pts/2 S+ 09:47 0:00 grep --color=auto kannel
After checking the bearerbox.log, I saw following error
tail -f /var/log/kannel/bearerbox.log *************************************************************************************** 2014-11-21 10:41:55 [1912] [6] INFO: AT2[/dev/ttyACM0]: opening device 2014-11-21 10:41:55 [1912] [6] ERROR: AT2[/dev/ttyACM0]: open failed! ERRNO=13 2014-11-21 10:41:55 [1912] [6] ERROR: System error 13: Permission denied 2014-11-21 10:41:55 [1912] [6] ERROR: AT2[/dev/ttyACM0]: at2_device_thread: open_at2_device failed. 2014-11-21 10:41:55 [1912] [6] ERROR: System error 13: Permission denied 2014-11-21 10:41:55 [1912] [6] ERROR: AT2[/dev/ttyACM0]: Couldn't connect (retrying in 10 seconds). ***************************************************************************************
With the help of kannel users mailing list, I found that KANNEL user must be allowed to write access /dev/ttyACM0 (or your modem device name).
For ubuntu, simply add the user KANNEL to DIALOUT group.
usermod -a -G dialout kannel chown kannel /dev/ttyACM0
Also remove the comment sign from START_SMSBOX in /etc/default/kannel so that smsbox may also start on system boot.
Alhamdolillah Problem Solved!
I am sharing this info because it took around 1 days of head banging with the wall, and I surely dont want anyone else to stuck in the same situation (if the issue is same)
Sample of config files
root@rm:/etc/kannel# cat /etc/default/kannel START_WAPBOX=1 START_SMSBOX=1
my /etc/kannel/kannel.conf FILE
cat /etc/kannel/kannel.conf
# Syed Jahanzaib # https://aacable.wordpress.com # aacable [at] hotmail.com group = core admin-port = 13000 smsbox-port = 13001 admin-password = zaibadmin status-password = zaibstatus log-file = "/var/log/kannel/bearerbox.log" log-level = 0 box-deny-ip = "*.*.*.*" box-allow-ip = "127.0.0.1" group = smsc smsc = at modemtype = teltonika device = /dev/ttyACM0 # Change above port to match your port, it could ACM1 or USB0, if you dont set it correctly, it will not work and you will get error in logs that unable to connect to device) speed = 19200 my-number = 0333302100000 # (put your sim number, not necessary) # for teltonkia only, if you are using other brand you may need to get there INIT strings group = modems id = teltonika name = "Teltonika E12" detect-string = "Undefined" enable-mms = true init-string = "AT+CNMI=2,2,0,1,1" speed = 115200 # for Huawei USB/GSM modem e155 i guess, remove hashes from below lines if u r using this model. #group = modems #id = huawei #name = "Huawei" #detect-string = "huawei" #enable-mms = true #init-string = "ATZ" #init-string = "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0" group = smsbox bearerbox-host = localhost sendsms-port = 13013 global-sender = 13013 sendsms-chars = "0123456789 +-" log-file = "/var/log/kannel/smsbox.log" log-level = 0 access-log = "/var/log/kannel/access.log" group = sendsms-user username = kannel password = kannel concatenation = true max-messages = 3 group = sms-service keyword = default get-url = "http://localhost/kannel/receivesms.php?sender=%p&text=%b" accept-x-kannel-headers = true max-messages = 3 concatenation = true catch-all = true
🙂
Regard’s
Syed Jahanzaib
Thanks Jahanzeb for this Tip – Again : i’ll use this tip somewhere else, usually i use your solutions in different problems like the MikroTik Rule (i modified them).
LikeLike
Comment by dxman — November 21, 2014 @ 12:21 PM
One More Question : Which Modem you use how did you setup this ? how can we configure SMS Tx/Rx with the minimal hardware or using mobile.
thanks.
LikeLike
Comment by dxman — November 21, 2014 @ 12:22 PM
I have used TELTONIKA USB GSM modem, and HUWAEI USB Modem.
LikeLike
Comment by Syed Jahanzaib / Pinochio~:) — November 21, 2014 @ 8:07 PM
Hi Syed Jahanzaib,
Thanks for sharing, i have same problem with autostart in kannel. oh ya, can you share with me your init.d file kannel? because my file init.d have removed 😦
thanks
LikeLike
Comment by jayadianto — December 8, 2014 @ 5:17 AM
Hi Syed Jahanzaib
I have solved my problem, thank for your sharing. this is helpfully
Jazakumullah khairan katsiran 🙂
LikeLike
Comment by jayadianto — December 8, 2014 @ 7:46 AM
Zaib bhai! Have you any USB GSM modem for sale. I want to purchase for radius manager. or help me….
LikeLike
Comment by Nadeem — December 10, 2014 @ 7:18 AM
@Nadeem, I dont deal in hardware brother, but you can get cheap usb gsm devices in market which is flooded with such items. But I recommend you to go with quality to avoid compatibility issues, Try starting with TELTONIKA USB GSM Modems or huawei modems.
LikeLike
Comment by Syed Jahanzaib / Pinochio~:) — December 11, 2014 @ 3:02 PM
for Teltonika devices, which performs very good , You can contact following person
Kamran Zaidi
Assistant Manager Sales
Contact: 0092-3465944414
http://www.teltonika.pk
LikeLike
Comment by Syed Jahanzaib / Pinochio~:) — December 13, 2014 @ 9:52 AM
dude,,,u saved me alot, thanks
LikeLike
Comment by Benedict — September 6, 2015 @ 5:01 PM
[…] https://aacable.wordpress.com/2014/11/21/kannel-auto-startup-problem-with-system-error-13-permission… […]
LikeLike
Pingback by Howto configure your Local SMS HTTP Gateway using KANNEL on Ubuntu | Syed Jahanzaib Personnel Blog to Share Knowledge ! — March 8, 2015 @ 4:51 PM
I have a problem with my modem modem Huawei E800 HSPA with the following message:
root@ubuntu:~# tail -f /var/log/kannel/bearerbox.log
2016-06-16 12:11:52 [3118] [6] ERROR: AT2[Huawei-E800]: CMS ERROR: +CMS ERROR: 3 21
2016-06-16 12:11:52 [3118] [6] ERROR: AT2[Huawei-E800]: CMS ERROR: Invalid memor y index -> don’t worry, just memory fragmentation. (321)
2016-06-16 12:12:07 [3118] [6] ERROR: AT2[Huawei-E800]: CMS ERROR: +CMS ERROR: 3 21
2016-06-16 12:12:07 [3118] [6] ERROR: AT2[Huawei-E800]: CMS ERROR: Invalid memor y index -> don’t worry, just memory fragmentation. (321)
2016-06-16 12:12:22 [3118] [6] ERROR: AT2[Huawei-E800]: CMS ERROR: +CMS ERROR: 3 21
2016-06-16 12:12:22 [3118] [6] ERROR: AT2[Huawei-E800]: CMS ERROR: Invalid memor y index -> don’t worry, just memory fragmentation. (321)
Can someone help me on this?
LikeLike
Comment by yndinga — June 16, 2016 @ 4:33 PM
can you please tell me how to resolve system error 2 no device or file found error when bearerbox is started?
LikeLike
Comment by shining star — August 15, 2017 @ 3:22 PM
2018-06-22 13:03:23 [9337] [6] DEBUG: AT2[zaibgsmid]: device opened
2018-06-22 13:03:23 [9337] [6] INFO: AT2[zaibgsmid]: speed set to 9600
2018-06-22 13:03:23 [9337] [6] DEBUG: AT2[zaibgsmid]: –> ATZ^M
2018-06-22 13:03:29 [9337] [6] ERROR: AT2[zaibgsmid]: Wrong or no answer to ATZ
2018-06-22 13:03:29 [9337] [6] INFO: AT2[zaibgsmid]: Closing device
2018-06-22 13:03:29 [9337] [6] ERROR: AT2[zaibgsmid]: Couldn’t connect (retrying in 10 seconds).
Please help me anyone. How to resolve this problem.
LikeLike
Comment by Mainul Islam — June 22, 2018 @ 10:04 PM
thank you bro you just ruled me after two days of panic, eeeh kannel it’s not good
LikeLike
Comment by Veron — February 25, 2021 @ 1:53 PM