the-modem-distro / pinephone_modem_sdk

Pinephone Modem SDK: Tools to build your own bootloader, kernel and rootfs
GNU General Public License v3.0
595 stars 64 forks source link

Sometimes modem disappears partially [mobian] #9

Closed kkeijzer closed 3 years ago

kkeijzer commented 3 years ago

Sometimes the modem disappears partially. gnome-control-center will say "No wireless / QMI device found", ip a will still show a wwan0 device, but with no IP addresses or routing tables, and gnome-calls will state that there is no voice-capable modem detected.

This can happen after resuming from deep sleep, but sometimes also while the phone is awake. (I sometimes wake up finding the modem "broke" overnight, while the phone was charging and not going to deep sleep.)

The modem is still detected with lsusb in this state; no different from normal operation:

Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 008: ID 2c7c:0125 Quectel Wireless Solutions Co., Ltd. EC25 LTE modem
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

The only way to get the modem to work again, is by running adb shell reboot from the PinePhone. (adb reboot does not work.)

Attached are openqti.log and dmesg of both the modem and the PinePhone.

I can't see anything out of the ordinary. Do you have any suggestions of where I should look the next time this happens?

Alexmitter commented 3 years ago

@Biktorgj bookworm and bullseye mobian come with the same kernel. There is a generally available 5.10 sunxi kernel and a 5.13 that is in "mobian unstable". I for example am running the 5.13 kernel.

Biktorgj commented 3 years ago

For the record, this is the "usb cable is bad" message I was talking about (just happened to me, after rebooting the phone at about 36% battery left):

[  207.988629] PM: suspend exit
[  207.989446] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
[  207.989583] option 2-1:1.0: device disconnected
[  207.995264] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
[  207.995390] option 2-1:1.1: device disconnected
[  207.996894] option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
[  207.997009] option 2-1:1.2: device disconnected
[  207.997905] option1 ttyUSB3: GSM modem (1-port) converter now disconnected from ttyUSB3
[  208.000164] option 2-1:1.3: device disconnected
[  208.010636] qmi_wwan 2-1:1.4 wwan0: unregister 'qmi_wwan' usb-1c1b000.usb-1, WWAN/QMI device
[  249.931044] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[  300.532238] usb usb4-port1: Cannot enable. Maybe the USB cable is bad?
[  301.740290] usb usb4-port1: Cannot enable. Maybe the USB cable is bad?
[  301.740379] usb usb4-port1: attempt power cycle
[  302.973793] usb usb4-port1: Cannot enable. Maybe the USB cable is bad?
[  304.184172] usb usb4-port1: Cannot enable. Maybe the USB cable is bad?
[  304.184245] usb usb4-port1: unable to enumerate USB device
[  305.494103] usb usb4-port1: Cannot enable. Maybe the USB cable is bad?
[  306.728322] usb usb4-port1: Cannot enable. Maybe the USB cable is bad?
[  306.728479] usb usb4-port1: attempt power cycle

In this case, issuing the modem to reboot, reset usb stack, enter fastboot mode or even killswitching it doesn't make the modem come back. Only a reboot of the pinephone itself fixes it

@Alexmitter, will update the kernel in my mobian install

kop316 commented 3 years ago

@Biktorgj

Which kernel version does bookworm come with?

I am on Kernel 5.13, I have Debian Bookworm + Mobian Unstable

When you say you follow the procedure, I assume from the dmesg timing you killswitched it? and it did come back after that?

Yeah I killswiched it, and it came back. No whole phone reset was needed.

Did it respond anything to "AT+RESETUSB" or "AT+QFASTBOOT"?

I did not try this, I can try it next time.

EDIT: I wonder, I have been trying to capture the issue on "adb", but the modem has not crashed in the last two days. Could having an active connection via ADB have something to do to prevent the issue?

Alexmitter commented 3 years ago

PSA: There is a discussion place in matrix now due to demand. Room Name is #pinephone_modem_sdk-issue-9:matrix.org Room is specific for using this firmware on Mobian.

Biktorgj commented 3 years ago

Okay, seems latest release addresses most if not all stability issues: https://github.com/Biktorgj/pinephone_modem_sdk/releases/tag/0.3.5 If anything else arises where the modem dies or disappears please let me know either here or in the matrix room mentioned above. If nothing is reported in the following days I'll finally close this issue

Again thanks to everyone here for helping me out with this!

kkeijzer commented 3 years ago

It's been over a week now, and everything has been stable for me in all cases. 0.3.6 seems to have fixed this issue definitively, which basically means that this firmware is better than the stock blob. So let's hope nothing regresses this and focus on other outstanding issues.