1

我有一个问题一直困扰着我一段时间。我一直在寻找解决方案 2 周现在没有任何结果。这家伙和我有同样的问题,但那里没有答案。.

我在带有 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
4

3 回答 3

2

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

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

复活-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
于 2019-05-17T14:47:38.310 回答
1

这看起来与https://github.com/gammu/gammu/issues/4几乎相同,即使在 Gammu 中有一些尝试解决此问题,华为调制解调器固件似乎根本不够稳定,无法用于此用途。简单地询问它几次以列出收到的消息会使其无响应。

此外,您使用的设备可能会略有不同,有关该主题的更多信息,请参阅Gammu 手册dd-wrt ​​wiki

于 2015-03-31T20:17:02.417 回答
1

我对华为 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-覆盆子-pi.jpg

这样,调制解调器在运行大约 50-100 小时后仍然挂起,但这对我的项目来说已经足够了。

于 2016-01-24T15:34:52.583 回答