You are not logged in.

#1 2016-04-06 19:59:12

mkkot
Member
From: Poland
Registered: 2009-12-20
Posts: 287

[solved] USB 4G modem works only sometimes (tough problem)

Hello all,

I own MegaFon branded Huawei E3272 LTE modem which was oryginally working on AT commands but I reflashed it to Hi-Link to get less troubles on Linux. While flashing I also removed simlock and broke USB storage memory (non-intentionally). Now I moved to other motherboard and SSD disc. All works much faster but usb modem doesn't work most of the times I turn on my PC (and also re-connect the stick).

I use usb_modeswitch and nothing more. IP configuration is static. This is how it looks when modem starts properly:

[  259.127972] usb 2-2: new high-speed USB device number 8 using xhci_hcd
[  259.255345] cdc_ether 2-2:1.0 eth0: register 'cdc_ether' at usb-0000:00:10.0-2, CDC Ethernet Device, 58:2c:80:13:92:63
[  259.797761] cdc_ether 2-2:1.0 eth0: kevent 12 may have been dropped

Now I'm plugging it off and on. This is how it looks when it doesn't work:

[ 1033.416644] usb 2-2: new high-speed USB device number 9 using xhci_hcd
[ 1033.541941] usb-storage 2-2:1.0: USB Mass Storage device detected
[ 1033.542114] scsi host13: usb-storage 2-2:1.0

4-th attempt of plugging off and on and it finally works again:


[ 1197.742404] usb 2-2: new high-speed USB device number 12 using xhci_hcd
[ 1197.867722] usb-storage 2-2:1.0: USB Mass Storage device detected
[ 1197.867932] scsi host16: usb-storage 2-2:1.0
[ 1198.434518] usb 2-2: USB disconnect, device number 12
[ 1198.775695] usb 2-2: new high-speed USB device number 13 using xhci_hcd
[ 1198.903067] cdc_ether 2-2:1.0 eth0: register 'cdc_ether' at usb-0000:00:10.0-2, CDC Ethernet Device, 58:2c:80:13:92:63
[ 1199.460462] cdc_ether 2-2:1.0 eth0: kevent 12 may have been dropped

And this is how it works on Archlinux installation medium (please notice no kevent 12 error):

http://upload.koci.net.pl/uploads/IMG_2 … 215512.jpg

I tried to remove usb_modeswitch (doesn't work obviously), install networkmanager, work only on networkmanager and so on, nothing helps.

On the previous motherboard I had the same kevent 12 may have been dropped error but I had 100% success ratio with starting the connection.

Please point me in right direction because I'm lacking ideas. I know that it didn't switch into modem mode but why? Maybe I can do something with udev configuration?

Last edited by mkkot (2016-04-17 15:07:55)

Offline

#2 2016-04-08 15:10:32

mkkot
Member
From: Poland
Registered: 2009-12-20
Posts: 287

Re: [solved] USB 4G modem works only sometimes (tough problem)

Hello again,

I created a workaround for this. Not perfect yet, but...

I told udev to run my script when modem is detected:

/etc/udev/rules.d/90-huawei-modem.rules

# activate faulty USB LTE modem HUAWEI E3272

ACTION=="add", SUBSYSTEM=="usb", ENV{ID_VENDOR_ID}=="12d1", ENV{ID_MODEL_ID}=="1f01", RUN+="/usr/local/bin/HUAWEI-modem &"

I added & at the end so udev doesn't kill my script after long execution. Didn't test that part yet as I added it just now.

In the script I simply reload xhci_pci module and wait for a message indicating that modem works. Reloading module causes udev action to execute and my script executes again so I needed to add a lock file. However, even though script works, it takes long until it gets connection and it's not perfect.

#!/bin/bash

function check

{
dmesg |grep 'kevent 12 may have been dropped'
}

function reload

{
    rmmod xhci_pci
    sleep 7
    modprobe xhci_pci
    sleep 120
    check
}

if [ -a /tmp/huawei-lock ]
    then
    exit
fi
touch /tmp/huawei-lock
sleep 20
check

while [[ $? -ne 0 ]]
    do
    reload
done

I will try to dig more on it.


//edit

Lol, this was my fault. I had an /etc/fstab entry left for my DVD writer which conflicted with modem device:

/dev/sr0             /media/liteon   auto    ro,user,noauto,unhide           0   0

I just commented this and whole problem disappeared...

Last edited by mkkot (2016-04-16 13:07:51)

Offline

Board footer

Powered by FluxBB