簡體   English   中英

我如何在RaspberryPi上設置gammu-smsd.service

[英]How do i set up gammu-smsd.service on my RaspberryPi

我正在嘗試在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/

我嘗試了此處給出的解決方案但沒有成功。

有人對我有個主意嗎?

預先感謝您的時間。 也許這是一個非常簡單的修復程序,但我是一個真正的初學者

好吧,我知道了。

那里的問題:

Mon 2019/01/14 18:16:26 gammu-smsd[4313]: Failed to seek to first row!

我發現這個視頻女巫告訴您執行此操作:使用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”,它就起作用了!!!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM