我正在尝试在Rasberry Pi上使用mysql配置Gammu-smsd.services。 有关信息,gammu正在没有smsd服务。 defaut时,smsd服务正在运行(不适用于mysql)
我遇到这种错误:
pi@F1rst:/var/log $ sudo systemctl status gammu-smsd.service
● gammu-smsd.service - SMS daemon for Gammu
Loaded: loaded (/lib/systemd/system/gammu-smsd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2019-01-14 18:16:26 CET; 24min ago
Docs: man:gammu-smsd(1)
Process: 4318 ExecStopPost=/bin/rm -f /var/run/gammu-smsd.pid (code=exited, status=0/SUCCESS)
Process: 4312 ExecStart=/usr/bin/gammu-smsd --pid=/var/run/gammu-smsd.pid --daemon (code=exited, status=0/SUCCESS)
Main PID: 4313 (code=exited, status=2)
janv. 14 18:16:26 F1rst systemd[1]: Starting SMS daemon for Gammu...
janv. 14 18:16:26 F1rst gammu-smsd[4312]: Log filename is "/var/log/smsd"
janv. 14 18:16:26 F1rst systemd[1]: Started SMS daemon for Gammu.
janv. 14 18:16:26 F1rst systemd[1]: gammu-smsd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
janv. 14 18:16:26 F1rst systemd[1]: gammu-smsd.service: Unit entered failed state.
janv. 14 18:16:26 F1rst systemd[1]: gammu-smsd.service: Failed with result 'exit-code'.
smsd日志给我这个:
Mon 2019/01/14 18:16:26 gammu-smsd[4312]: Warning: No PIN code in /etc/gammu-smsdrc file
Mon 2019/01/14 18:16:26 gammu-smsd[4313]: Connected to Database: smsd on localhost
Mon 2019/01/14 18:16:26 gammu-smsd[4313]: Failed to seek to first row!
Mon 2019/01/14 18:16:26 gammu-smsd[4313]: Initialisation failed, stopping Gammu smsd: Erreur inconnue. (UNKNOWN[27])
Mon 2019/01/14 18:16:26 gammu-smsd[4313]: Stopping Gammu smsd: Aucune erreur. (NONE[1])
这是我的gammu-smsdrc配置文件:
# Configuration file for Gammu SMS Daemon
# Gammu library configuration, see gammurc(5)
[gammu]
# Please configure this!
port = /dev/ttyAMA0
connection = at115200
# Debugging
#logformat = textall
# SMSD configuration, see gammu-smsdrc(5)
[smsd]
#RunOnReceive = /home/pi/script/sms.sh
service = sql
driver = native_mysql
host = localhost
user = smsd
password = g@mmuP@ssword
database = smsd
logfile = /var/log/smsd
# Increase for debugging information
debuglevel = 0
# 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/
我尝试了解决方法given here,但是没有用。
有人对我有个主意吗?
多谢您的宝贵时间。 也许这是一个非常简单的修复程序,但我是一个真正的初学者
答案 0 :(得分:0)
好吧,我知道了。
那里的问题:
Mon 2019/01/14 18:16:26 gammu-smsd[4313]: Failed to seek to first row!
我发现this video女巫告诉您这样做: 使用phpmyadmin输入您的smsd数据库 寻找gammu表并插入值“ 13”
我尝试了一下但没有成功,但是错误确实改变了。 这时我遇到了这个错误:
Sat 2019/01/19 13:12:21 gammu-smsd[30893]: Database structure is from older Gammu version
所以我将值更改为20 然后我得到了这个:
Sat 2019/01/19 13:08:31 gammu-smsd[30705]: Database structure is from newer Gammu version
过了几天,我输入了值'16',它就起作用了!!!