Link to home
Start Free TrialLog in
Avatar of pkofinat
pkofinat

asked on

sms-gateway gnokii Initialization failed sometimes

I have problem with gnokii 0.6.31 +usb huawei e220 (centos 6.4 64 bit) Normaly works ok.

echo "SMS from Huawei" | gnokii --phone huawei --config /etc/gnokiirc --sendsms 1234567890
GNOKII Version 0.6.31
Send succeeded with reference -1!

Open in new window


But after one,two days it's stop working, and i get:

echo "SMS from Huawei" | gnokii --phone huawei --config /etc/gnokiirc --sendsms 1234567890 
GNOKII Version 0.6.31 Initialization failed (11) 
Telephone interface init failed: Command timed out.
Quitting.

Open in new window


Only solution i know it's to plug out/in usb huawei modem , and it start working.

I try with this, but don't work.
echo '2-1' |tee /sys/bus/usb/drivers/usb/unbind
echo '2-1' |tee /sys/bus/usb/drivers/usb/bind

Open in new window


I got the same output whenever it's working or not

gnokii --identify 
GNOKII Version 0.6.31 
Apparently you didn't configure gnokii. Please do it prior to using it. You can get some clues from comments included in sample config file or give a try with gnokii-configure utility included in gnokii distribution.
IMEI : Unknown 
Manufacturer : Unknown 
Model : Unknown
Product name : Unknown
Revision : Unknown

Open in new window


info from /var/log/messages
Jun 15 12:36:02 chi kernel: usbcore: registered new interface driver usbserial 
Jun 15 12:36:02 chi kernel: USB Serial support registered for generic
 Jun 15 12:36:02 chi kernel: usbcore: registered new interface driver usbserial_generic
 Jun 15 12:36:02 chi kernel: usbserial: USB Serial Driver core 
Jun 15 12:36:02 chi kernel: USB Serial support registered for GSM modem (1-port)
 Jun 15 12:36:02 chi kernel: option 2-1.8:1.0: GSM modem (1-port) converter detected
 Jun 15 12:36:02 chi kernel: usb 2-1.8: GSM modem (1-port) converter now attached to ttyUSB0
 Jun 15 12:36:02 chi kernel: option 2-1.8:1.1: GSM modem (1-port) converter detected
 Jun 15 12:36:02 chi kernel: usb 2-1.8: GSM modem (1-port) converter now attached to ttyUSB1 
Jun 15 12:36:02 chi kernel: usbcore: registered new interface driver option
 Jun 15 12:36:02 chi kernel: option: v0.7.2:USB Driver for GSM modems

Open in new window


lsusb

Bus 002 Device 004: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E230/E270/E870 HSDPA/HSUPA Modem

Open in new window


config:

[global] port = none model = fake initlength = default connection = serial use_locking = no serial_baudrate = 9600 smsc_timeout = 10

[xgnokii] allow_breakage = 0

[gnokiid] bindir = /usr/local/sbin/

[connect_script] TELEPHONE = 12345678

[phone_huawei] 
model = AT 
port = /dev/ttyUSB1 
connection = serial

Open in new window

Avatar of gheist
gheist
Flag of Belgium image

Does the modem freeze or reconnect USB bus somehow? Anything in dmesg when it "fails" ?
Avatar of pkofinat
pkofinat

ASKER

when i can't send sms, dmesg and /var/log/messages it's empty
lsusb give me the same output

                                 
Bus 002 Device 004: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E230/E270/E870 HSDPA/HSUPA Modem

Open in new window

Can you try restarting gnokiid using cron every couple of hours?
i don't use daemon gnokiid, some script use only gnokii  command

gnokiid --debug
GNOKIID Version 0.6.31
gnokiid purpose is to work only with the phones that do not have AT Hayes
commands interpreter.

Open in new window

SOLUTION
Avatar of gheist
gheist
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks for advice, i'll test it.
If it proves worth we will check how to disable powersaving for that circuit permanently. (+1W power draw per USB port)
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Shortcut: echo -1 | tee /sys/bus/usb/devices/*/power/autosuspend
Correct way: https://www.linux.com/news/hardware/peripherals/180950-udev
I can't do it by powertop, by i think powersaving it's was it.
I do it by disable autosuspend to all usb devices and add newest kernel for repository.

And i used diffrent tool to solve the problem.