gammu-smsd只在启动时发送短信



我运行gammu-smsd:

# gammu-smsd
Log filename is "/var/log/gammu-smsd.log"

接下来我通过gammu-smsd-inject:发送短信

# echo sms bla bla bla | gammu-smsd-inject TEXT 123456789
gammu-smsd-inject[2050]: Warning: No PIN code in /etc/gammu-smsdrc file
gammu-smsd-inject[2050]: Created outbox message OUTC20151124_121117_00_796996999_sms0.smsbackup
Written message with ID /var/spool/gammu/outbox/OUTC20151124_121117_00_796996999_sms0.smsbackup

以及。。。。。1分钟,5分钟,15分钟,什么都没有
所以我用^中断gammu-smsd并重新启动它:

# gammu-smsd
Log filename is "/var/log/gammu-smsd.log"

现在我在/var/log/gammu-smsd.log:

Tue 2015/11/24 12:17:07 gammu-smsd[2074]: Warning: No PIN code in /etc/gammu-smsdrc file
Tue 2015/11/24 12:17:07 gammu-smsd[2074]: Created POSIX RW shared memory at 0xb6fcc000
Tue 2015/11/24 12:17:07 gammu-smsd[2074]: Starting phone communication...
Tue 2015/11/24 12:17:17 gammu-smsd[2074]: Read 1 messages
Tue 2015/11/24 12:17:18 gammu-smsd[2074]: Message without SMSC, assuming you want to use the one from phone
Tue 2015/11/24 12:17:19 gammu-smsd[2074]: Transmitted OUTC20151124_121117_00_123456789_sms0.smsbackup (total: 1) to 123456789, message reference 0x1b
Tue 2015/11/24 12:17:25 gammu-smsd[2074]: Read 1 messages

我的配置/etc/gammu-smsdrc:

# Configuration file for Gammu SMS Daemon
# Gammu library configuration, see gammurc(5)
[gammu]
port = /dev/huawei
model = at
connection = at19200
synchronizetime = yes
# SMSD configuration, see gammu-smsdrc(5)
[smsd]
service = files
logfile = /var/log/gammu-smsd.log
#debuglevel = 255
commtimeout = 10
sendtimeout = 20
deliveryreport = log
transmitformat = auto
# Paths where messages are stored
inboxpath = /var/spool/gammu/inbox/
outboxpath = /var/spool/gammu/outbox/
sentsmspath = /var/spool/gammu/sent/
errorsmspath = /var/spool/gammu/error/

那么我做错了什么?

---编辑---

我已经删除了通过apt-get安装的gammu,从网站wammu.eu下载了最新的gammu,并按照说明进行了编译。所以现在:

# gammu version
[Gammu version 1.36.6]
...

# gammu-detect
; Configuration file generated by gammu-detect.
; Please check The Gammu Manual for more information.
[gammu]
device = /dev/ttyUSB0
name = Phone on USB serial port HUAWEI_MOBILE HUAWEI_MOBILE
connection = at
[gammu1]
device = /dev/ttyUSB1
name = Phone on USB serial port HUAWEI_MOBILE HUAWEI_MOBILE
connection = at
opening socket: Nie ma takiego urządzenia

其中/dev/huaweiln -s /dev/ttyUSB0创建
现在我输入gammu identify来检查我的设备,1个小时后我中断了它,因为它在等什么——我不知道是什么
波纹管来自gdb:

# gdb --args gammu --identify
GNU gdb (Raspbian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from gammu...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/local/bin/gammu --identify
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
^C
Program received signal SIGINT, Interrupt.
0xb6d674ec in select () at ../sysdeps/unix/syscall-template.S:81
81      ../sysdeps/unix/syscall-template.S: Nie ma takiego pliku ani katalogu.
(gdb) bt
#0  0xb6d674ec in select () at ../sysdeps/unix/syscall-template.S:81
#1  0xb6f32968 in serial_read () from /usr/local/lib/libGammu.so.7
#2  0xb6e95c8c in GSM_ReadDevice () from /usr/local/lib/libGammu.so.7
#3  0xb6e95dcc in GSM_WaitForOnce () from /usr/local/lib/libGammu.so.7
#4  0xb6e95ef0 in GSM_WaitFor () from /usr/local/lib/libGammu.so.7
#5  0xb6edda2c in ATGEN_Initialise () from /usr/local/lib/libGammu.so.7
#6  0xb6e94f20 in GSM_TryGetModel () from /usr/local/lib/libGammu.so.7
#7  0xb6e95518 in GSM_InitConnection_Log () from /usr/local/lib/libGammu.so.7
#8  0x00000000 in ?? ()
(gdb)

根据此线程,您需要使用USB设备的/dev/serial/by-id/路径。

例如端口=/dev/serial/by-id/usb-Standard_usb_usb_2.0-if01

请参阅http://comments.gmane.org/gmane.linux.drivers.gammu/9719

最新更新