raspbx

所需设备,raspberry pi 华为e173上网卡

setup 1 lsusb 发现设备ID 12d1:1446 Huawei Technologies Co., Ltd. E1552/E1800/E173

ls /dev/tty无USB*

root@raspbx:~# lsusb
Bus 001 Device 005: ID 12d1:1446 Huawei Technologies Co., Ltd. E1552/E1800/E173                                                       (HSPA modem)
Bus 001 Device 004: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n                                                       WLAN Adapter
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast                                                       Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
setup 2切换E173模式

 
root@raspbx:~# usb_modeswitch -v 12d1 -p 1446 -W -J
Take all parameters from the command line


 * usb_modeswitch: handle USB devices with multiple modes
 * Version 2.2.0 (C) Josua Dietze 2014
 * Based on libusb1/libusbx

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x12d1
DefaultProduct= 0x1446
HuaweiNewMode=1
NeedResponse=0

Look for default devices ...
  found USB ID 12d1:1446
   vendor ID matched
   product ID matched
  found USB ID 0bda:8176
  found USB ID 0424:ec00
  found USB ID 0424:9514
  found USB ID 1d6b:0002
 Found devices in default mode (1)
Access device 005 on bus 001
Current configuration number is 1
Use interface number 0
Use endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: HUAWEI Technology
     Product: HUAWEI Mobile
  Serial No.: not provided
-------------------------
Using standard Huawei switching message
Looking for active driver ...
 OK, driver detached
Set up interface 0
Use endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
 OK, message successfully sent
Reset response endpoint 0x81
libusb: error [op_clear_halt] clear_halt failed error -1 errno 71
 Could not reset endpoint (probably harmless): -99
Reset message endpoint 0x01
libusb: error [op_clear_halt] clear_halt failed error -1 errno 71
 Could not reset endpoint (probably harmless): -99
 Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!
然后lsusb
root@raspbx:~# lsusb
Bus 001 Device 006: ID 12d1:1436 Huawei Technologies Co., Ltd. E173 3G Modem (modem-mode)
Bus 001 Device 004: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

现在正常

root@raspbx:~# ls /dev/tty
tty        tty13      tty19      tty24      tty3       tty35      tty40      tty46      tty51      tty57      tty62      ttyprintk
tty0       tty14      tty2       tty25      tty30      tty36      tty41      tty47      tty52      tty58      tty63      ttyUSB0
tty1       tty15      tty20      tty26      tty31      tty37      tty42      tty48      tty53      tty59      tty7       ttyUSB1
tty10      tty16      tty21      tty27      tty32      tty38      tty43      tty49      tty54      tty6       tty8       ttyUSB2
tty11      tty17      tty22      tty28      tty33      tty39      tty44      tty5       tty55      tty60      tty9
tty12      tty18      tty23      tty29      tty34      tty4       tty45      tty50      tty56      tty61      ttyAMA0

问题1:第一次使用正常(之后重启也正常),但RPI重新上电后,3G U棒的连接会丢失

正常情形下应该会有三个 ttyUSB*文件

但实际上找不到 ttyUSB*,同时在 Asterisk CLI界面会不断提示出错“chan_dongle.c:218 opentty: unable to open /dev/ttyUSB2: No such file or directory”,这时候如果插拔U棒一到二次就能恢复正常。

经网上搜索,找到一篇 文章,得知 3G U棒有两种工作模式,cdrom和modem,默认是前者(所以U棒插入Win系统电脑时会自动安装3G上网软件),解决办法就是在每次 RPI启动时用 usb_modeswitch(RasPBX已内置了该软件)修改一下 3G U棒的工作模式。

新建一个 E173的配置文件 /etc/usb_modeswitch.d/e173.conf,内容如下

########################################################
# Huawei, newer modems

DefaultVendor= 0x12d1
DefaultProduct=0x1446

TargetVendor=  0x12d1
TargetProduct= 0x1436

CheckSuccess=20

MessageContent="55534243123456780000000000000011062000000100000000000000000000"

修改 E173的工作模式

root@raspbx:~# usb_modeswitch -I -W -c /etc/usb_modeswitch.d/e173.conf

注:这时 E173应该就自动接通了,然后把这一行添加到 /etc/rc.local文件中,exit 0的那一行之前即可。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值