我正在尝试通过 USB 网络共享从我的 LG G4 进行连接。我有 Ubuntu 16.04
网络共享只能工作 1 到 2 分钟,但之后就会断开。如果我拔下并再次插入电缆,它会重新连接,但只需一分钟左右。
如果我激活 wifi 网络共享,它就可以正常工作。
谁能给我一些建议,告诉我如何诊断并了解为什么会发生这种情况?
提前致谢 :)
答案1
我刚刚从 14.04 升级到 16.04.1 后遇到了完全相同的问题(在该版本下 USB 网络共享多年来一直运行良好)。
根据系统日志,它似乎是由与 ModemManager 的冲突引起的。
Aug 25 13:12:24 outback NetworkManager[2543]: <info> [1472145144.1334] device (enp0s20u2): Activation: successful, device activated.
[...eliding log entries related to nm-dispatcher services]
Aug 25 13:12:38 outback ModemManager[2503]: <info> Creating modem with plugin 'Generic' and '2' ports
Aug 25 13:12:38 outback ModemManager[2503]: <info> Modem for device at '/sys/devices/pci0000:00/0000:00:14.0/usb3/3-2' successfully created
Aug 25 13:12:41 outback ModemManager[2503]: <warn> couldn't load Manufacturer: 'Serial command timed out'
Aug 25 13:12:44 outback ModemManager[2503]: <warn> couldn't load Model: 'Serial command timed out'
Aug 25 13:12:47 outback ModemManager[2503]: <warn> couldn't load Revision: 'Serial command timed out'
Aug 25 13:12:50 outback ModemManager[2503]: <warn> couldn't load Equipment Identifier: 'Serial command timed out'
Aug 25 13:12:50 outback ModemManager[2503]: <warn> couldn't load Operator name: 'SIM failed to handle CRSM request (sw1 106 sw2 130)'
Aug 25 13:12:54 outback ModemManager[2503]: <warn> couldn't load IMEI: 'Serial command timed out'
Aug 25 13:12:54 outback ModemManager[2503]: <info> Modem: state changed (unknown -> disabled)
Aug 25 13:12:54 outback NetworkManager[2543]: <info> [1472145174.3879] device (enp0s20u2): state change: activated -> deactivating (reason 'connection-removed') [100 110 38]
Aug 25 13:12:54 outback NetworkManager[2543]: <info> [1472145174.3881] manager: NetworkManager state is now DISCONNECTING
Aug 25 13:12:54 outback NetworkManager[2543]: <info> [1472145174.4362] dns-mgr: Writing DNS information to /sbin/resolvconf
Aug 25 13:12:54 outback dnsmasq[4348]: setting upstream servers from DBus
Aug 25 13:12:54 outback NetworkManager[2543]: <info> [1472145174.4430] manager: (ttyACM0): new Broadband device (/org/freedesktop/NetworkManager/Devices/4)
Aug 25 13:12:54 outback NetworkManager[2543]: <info> [1472145174.4441] device (ttyACM0): state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
Aug 25 13:12:54 outback NetworkManager[2543]: <info> [1472145174.4445] device (ttyACM0): modem state 'enabling'
Aug 25 13:12:54 outback NetworkManager[2543]: <info> [1472145174.4457] device (enp0s20u2): state change: deactivating -> disconnected (reason 'connection-removed') [110 30 38]
我通过以下命令禁用了 ModemManager:
sudo systemctl disable ModemManager.service
然后重启。从此以后,我的后续 USB 网络共享会话一直很稳定。
我确信有一种方法可以为我的手机(LG G3)正确配置 ModemManager,但我目前不需要串行调制解调器,因此这种方法对我来说很有效。
答案2
对我来说,这个命令有效:
sudo systemctl stop ModemManager.service
使用disable
而stop
不是 不起作用。然后我重新打开 NetworkManager:
sudo NetworkManager
答案3
systemctl stop ModemManager.service
在我的老款 LG G2 上直接运行,Kali Linux 2019.4,无需重启
systemctl disable ModemManager.service
将阻止服务在将来的(重新)启动时启动
答案4
sudo systemctl stop ModemManager.service
适用于我的 LG G4,搭载 Ubuntu 20.04(从 18.04 升级而来)
遇到了同样的问题——USB 连接短暂工作了大约 30 秒,但随后断开连接并且网络适配器消失了。
停止 ModemManager 可立即解决问题,直到下次重启为止。