一段时间后,Gammu停止接收短信。

时间:2015-03-31 09:27:53

标签: gammu

我有一个问题,一直困扰我一段时间。我一直在寻找解决方案2周,但没有任何结果。 This guys have the same problem as me but no answers there.

我用rasbian在Rpi上运行gammu(1.31)和gammu-smsd。 使用华为E367。

不知道为什么我有3个设备/ dev / ttyUSB0,/ dev / ttyUSB1,/ dev / ttyUSB2 由于我不知道它们之间的差异,我尝试了不同的设置并让它与下载一起运行; gammu-conf ttyUSB0和gammusmsdrc ttyUSB2。作为root用户和普通用户。

发送短信效果很好。然后是问题所在。接收短信工作一段时间,然后停止。如果我重启系统它再次开始工作。有一段时间之后,同样的事情发生了一段时间。


# Configuration file for Gammu SMS Daemon

# Gammu library configuration, see gammurc(5)
[gammu]
# Please configure this!
port = /dev/ttyUSB2

connection = at
# Debugging
#logformat = textall

# SMSD configuration, see gammu-smsdrc(5)
[smsd]

service = files
logfile = /home/pi/gammu/log/log_smsdrc.txt
# Increase for debugging information
debuglevel = 0

# Paths where messages are stored
inboxpath = /home/pi/gammu/inbox/

outboxpath = /home/pi/gammu/outbox/

sentsmspath = /home/pi/gammu/sent/

errorsmspath = /home/pi/gammu/error/

ReceiveFrequency = 2
LoopSleep = 1
GammuCoding = utf8
CommTimeout = 0

#RunOnReceive =

日志


Tue 2015/03/31 11:05:19 gammu-smsd[7379]: Starting phone communication...

Tue 2015/03/31 11:07:07 gammu-smsd[7379]: Terminating communication...

Tue 2015/03/31 11:07:26 gammu-smsd[2091]: Warning: No PIN code in /etc/gammu-smsdrc file

Tue 2015/03/31 11:07:26 gammu-smsd[2116]: Created POSIX RW shared memory at 0xb6f6d000

Tue 2015/03/31 11:07:26 gammu-smsd[2116]: Starting phone communication...

Tue 2015/03/31 11:07:26 gammu-smsd[2116]: Error at init connection: Error opening device, it doesn't exist. (DEVICENOTEXIST[4])

Tue 2015/03/31 11:07:26 gammu-smsd[2116]: Starting phone communication...

Tue 2015/03/31 11:07:26 gammu-smsd[2116]: Error at init connection: Error opening device, it doesn't exist. (DEVICENOTEXIST[4])

Tue 2015/03/31 11:07:26 gammu-smsd[2116]: Starting phone communication...

Tue 2015/03/31 11:07:26 gammu-smsd[2116]: Error at init connection: Error opening device, it doesn't exist. (DEVICENOTEXIST[4])

Tue 2015/03/31 11:07:26 gammu-smsd[2116]: Starting phone communication...

Tue 2015/03/31 11:07:26 gammu-smsd[2116]: Error at init connection: Error 
opening device, it doesn't exist. (DEVICENOTEXIST[4])

Tue 2015/03/31 11:07:26 gammu-smsd[2116]: Going to 30 seconds sleep because of too much connection errors

Tue 2015/03/31 11:08:14 gammu-smsd[2116]: Starting phone communication...

Tue 2015/03/31 11:08:21 gammu-smsd[2116]: Soft reset return code: Function not supported by phone. (NOTSUPPORTED[21])

Tue 2015/03/31 11:08:27 gammu-smsd[2116]: Read 2 messages

Tue 2015/03/31 11:08:27 gammu-smsd[2116]: Received 

IN20150331_110600_00_+xxxxxx_00.txt

Tue 2015/03/31 11:08:27 gammu-smsd[2116]: Received 

IN20150331_110820_00_+xxxxxx_00.txt

Tue 2015/03/31 11:09:38 gammu-smsd[2116]: Read 1 messages

Tue 2015/03/31 11:09:38 gammu-smsd[2116]: Received 

IN20150331_110934_00_+xxxxxx_00.txt

Tue 2015/03/31 11:13:57 gammu-smsd[2116]: Read 1 messages

Tue 2015/03/31 11:13:57 gammu-smsd[2116]: Received 

IN20150331_111352_00_+xxxxxx_00.txt

我猜早期警告是在我的modeswitch命令开始之前。 在rc.local中:

sudo usb_modeswitch -v 0x12d1 -p 0x1446 -V 0x12d1 -P 0x1506 -m 0x01 -M 55534243123456780000000000000011062000000100000000000000000000  -I

3 个答案:

答案 0 :(得分:0)

这看起来与https://github.com/gammu/gammu/issues/4非常相似,尽管有一些尝试在Gammu中解决这个问题,但似乎华为调制解调器固件根本不够稳定。只需多次询问列出收到的消息就会使其无法响应。

您使用的设备可能略有不同,请参阅Gammu manualdd-wrt wiki以获取有关该主题的更多信息。

答案 1 :(得分:0)

我遇到与华为3g调制解调器e1750类似的问题。我在/ etc / gammu-smsdrc文件中添加了以下行:

ReceiveFrequency = 60
StatusFrequency = 60
CommTimeout = 60
SendTimeout = 60
LoopSleep = 10
CheckSecurity = 0

这个想法是最小化gammu-smsd和3g调制解调器之间的通信量。特别是默认值LoopSleep = 1意味着gammu每秒向调制解调器发送命令,对于调制解调器固件来说可能太多了,所以我使用了10。

下一件事是所有Raspberry / ARM嵌入式项目的标准配置:使用强大的电源。我使用带有固定电缆的充电器(我相信一些可重复使用的电缆可能不适用于2A以上的电流)看起来像这样: http://botland.com.pl/9240-thickbox_default/zasilacz-extreme-microusb-5v-21a-raspberry-pi.jpg

由于调制解调器在运行约50-100小时后仍然挂起,但它对我的项目来说还是很有用。

答案 2 :(得分:0)

我遇到了同样的问题,所以我写了一个shell脚本来重新激活干净迅速的/ dev / ttyUSB [0-2]设备,然后将其添加到cron作业中

*/5 * * * * /home/sysadmin/scripts/reanimate-usb-stick.sh >/dev/null 2>&1

reanimate-usb-stick.sh

#!/bin/bash

export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"

USBDEVICES=$(ls -l /dev/* | awk '/\/dev\/ttyUSB[0-7]/ {print $6}' | wc -l)
DEVICEINFO=""
DEVICEPORT=""


if [ $USBDEVICES = 0 ]
        then
                datas=$(lsusb | grep -i hua | awk '/Bus/ {print $6}' | tr ":" "\n")
                counter=0
                for line in $datas
                do 
                        counter=$((counter+1))
                        if [ $counter = 1 ]
                                then
                                        DEVICEINFO=$(echo "$line")
                        fi

                        if [ $counter = 2 ]
                                then
                                        DEVICEPORT=$(echo "$line")
                        fi
                done
    usb_modeswitch -v $DEVICEINFO -p $DEVICEPORT -J
    echo "$DEVICEINFO - $DEVICEPORT"
    else
        echo "ALLES OK : $USBDEVICES"
        exit
fi