gammu-smsd初始化连接时出错:无法打开指定的文件

时间:2016-11-01 15:45:21

标签: ubuntu sms gammu

我在我的Ubuntu 14.04上安装了gammu和gammu-smsd 1.37。 如果我尝试直接通过gammu发送短信 - 它的工作正常。但是,如果我尝试通过gammu-smsd-inject进行 - 它无法正常工作。

gammu-smsd.log:
    Nov  1 17:04:19 mostjs-srv gammu-smsd[2557]: Using FILES service
    Nov  1 17:04:19 mostjs-srv gammu-smsd[2557]: Configuring Gammu SMSD...
    Nov  1 17:04:19 mostjs-srv gammu-smsd[2557]: SHM token: 0xffffffffce0106d2 (-838793518)
    Nov  1 17:04:19 mostjs-srv gammu-smsd[2557]: Warning: No PIN code in /etc/gammu-smsdrc file
    Nov  1 17:04:19 mostjs-srv gammu-smsd[2557]: CommTimeout=30, SendTimeout=30, ReceiveFrequency=15, ResetFrequency=0, HardResetFrequency=0
    Nov  1 17:04:19 mostjs-srv gammu-smsd[2557]: checks: CheckSecurity=1, CheckBattery=1, CheckSignal=1, CheckNetwork=1
    Nov  1 17:04:19 mostjs-srv gammu-smsd[2557]: mode: Send=1, Receive=1
    Nov  1 17:04:19 mostjs-srv gammu-smsd[2557]: deliveryreport = no
    Nov  1 17:04:19 mostjs-srv gammu-smsd[2557]: phoneid =
    Nov  1 17:04:19 mostjs-srv gammu-smsd[2557]: Inbox is "/var/spool/gammu/inbox/" with format "standard"
    Nov  1 17:04:19 mostjs-srv gammu-smsd[2557]: Outbox is "/var/spool/gammu/outbox/" with format "detail" and transmission format "7bit"
    Nov  1 17:04:19 mostjs-srv gammu-smsd[2557]: Sent SMS moved to "/var/spool/gammu/sent/"
    Nov  1 17:04:19 mostjs-srv gammu-smsd[2557]: SMS with errors moved to "/var/spool/gammu/error/"
    Nov  1 17:04:19 mostjs-srv gammu-smsd[2558]: Created POSIX RW shared memory at 0x7fc66468b000
    Nov  1 17:04:19 mostjs-srv gammu-smsd[2558]: Starting phone communication...
    Nov  1 17:04:19 mostjs-srv gammu-smsd[2558]: Error at init connection: Can not open specified file. (CANTOPENFILE[28])

我的配置文件:

~/.gammurc
device = /dev/ttyS0
#model = at
connection = at19200
logfile = /var/log/gammu.log
logformat = textall
use_locking = no

/etc/gammu-smsdrc
[gammu]
port = /dev/ttyS0
connection = at
logfile = /var/log/gammu.log
logformat = textall
use_locking = no

# SMSD configuration, see gammu-smsdrc(5)
[smsd]
service = files
LogFile = syslog
debuglevel = 1
# Increase for debugging information

# 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/

我做错了什么?

1 个答案:

答案 0 :(得分:0)

Michal,这是我对设备的权限:

  for (DataSnapshot noteDataSnapshot : dataSnapshot.getChildren()) {

用户crw-rw---- 1 root dialout 4, 64 Ноя 2 10:41 ttyS0 crw-rw---- 1 root dialout 4, 65 Ноя 2 10:34 ttyS1 crw-rw---- 1 root dialout 4, 74 Ноя 2 10:34 ttyS10 crw-rw---- 1 root dialout 4, 75 Ноя 2 10:34 ttyS11 crw-rw---- 1 root dialout 4, 76 Ноя 2 10:34 ttyS12 crw-rw---- 1 root dialout 4, 77 Ноя 2 10:34 ttyS13 crw-rw---- 1 root dialout 4, 78 Ноя 2 10:34 ttyS14 crw-rw---- 1 root dialout 4, 79 Ноя 2 10:34 ttyS15 crw-rw---- 1 root dialout 4, 80 Ноя 2 10:34 ttyS16 crw-rw---- 1 root dialout 4, 81 Ноя 2 10:34 ttyS17 crw-rw---- 1 root dialout 4, 82 Ноя 2 10:34 ttyS18 crw-rw---- 1 root dialout 4, 83 Ноя 2 10:34 ttyS19 crw-rw---- 1 root dialout 4, 66 Ноя 2 10:34 ttyS2 crw-rw---- 1 root dialout 4, 84 Ноя 2 10:34 ttyS20 crw-rw---- 1 root dialout 4, 85 Ноя 2 10:34 ttyS21 crw-rw---- 1 root dialout 4, 86 Ноя 2 10:34 ttyS22 crw-rw---- 1 root dialout 4, 87 Ноя 2 10:34 ttyS23 crw-rw---- 1 root dialout 4, 88 Ноя 2 10:34 ttyS24 crw-rw---- 1 root dialout 4, 89 Ноя 2 10:34 ttyS25 crw-rw---- 1 root dialout 4, 90 Ноя 2 10:34 ttyS26 crw-rw---- 1 root dialout 4, 91 Ноя 2 10:34 ttyS27 crw-rw---- 1 root dialout 4, 92 Ноя 2 10:34 ttyS28 crw-rw---- 1 root dialout 4, 93 Ноя 2 10:34 ttyS29 crw-rw---- 1 root dialout 4, 67 Ноя 2 10:34 ttyS3 crw-rw---- 1 root dialout 4, 94 Ноя 2 10:34 ttyS30 crw-rw---- 1 root dialout 4, 95 Ноя 2 10:34 ttyS31 crw-rw---- 1 root dialout 4, 68 Ноя 2 10:34 ttyS4 crw-rw---- 1 root dialout 4, 69 Ноя 2 10:34 ttyS5 crw-rw---- 1 root dialout 4, 70 Ноя 2 10:34 ttyS6 crw-rw---- 1 root dialout 4, 71 Ноя 2 10:34 ttyS7 crw-rw---- 1 root dialout 4, 72 Ноя 2 10:34 ttyS8 crw-rw---- 1 root dialout 4, 73 Ноя 2 10:34 ttyS9 属于群组gammu。如果更改用户,将该守护进程运行到dialout,那么一切正常。我真的不明白在用户root下工作恶魔所需的其他权限。