Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
moma
Posts: 3
Joined: 30 Oct 2012, 17:19

Mode switching of ZTE MF190J.

Post by moma » 30 Oct 2012, 17:43

I have a Portuguese 3G-modem of type ZTE MF190J.

This 3G-modem works well in Ubuntu 12.10 (Quantal Quetzal). Only one thing needs manual intervention. I have to unmount (eject) it manually from the file manager or Ubuntu-icon. After that it connects well.

Step 2) of this thread shows how to prevent its auto-mount.
http://ubuntuforums.org/showpost.php?p= ... stcount=16

How to make this "mode-switch" to work in all Linux-distros?. Where do you add new information for this 3G-pen?

Network-manager:
Configuration with default values is sufficient and OK. It add a new selection to the NetworkManager and connects willingly in Ubuntu 12.10.

# Listing BEFORE unmount/eject.
$ usb_devices

T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 4 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=19d2 ProdID=1542 Rev=00.01
S: Manufacturer=ZTE
S: Product=MF190J
S: SerialNumber=9BB27BAF013DFB85103C397DCB576195D5417DF5
C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
------------------------------------

# Listing AFTER unmount/eject.
$ usb_devices

T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 5 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=02(commc) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=19d2 ProdID=1544 Rev=00.01
S: Manufacturer=ZTE
S: Product=MF190J
S: SerialNumber=9BB27BAF013DFB85103C397DCB576195D5417DF5
C: #Ifs= 7 Cfg#= 1 Atr=80 MxPwr=500mA
I: If#= 0 Alt= 0 #EPs= 0 Cls=00(>ifc ) Sub=08 Prot=00 Driver=(none)
I: If#= 1 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=01 Driver=cdc_acm
I: If#= 2 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm
I: If#= 3 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=01 Driver=cdc_acm
I: If#= 4 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm
I: If#= 5 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=01 Driver=cdc_acm
I: If#= 6 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm
------------------------------------

Notice:
This 3G-pen did not work from NetworkManager in Ubuntu 12.04. I had to use vwdial or gnome-ppp to make it connect.

For more information see:
https://bugzilla.gnome.org/show_bug.cgi?id=680545
and
https://bugs.launchpad.net/ubuntu/+sour ... bug/994651

Attached is also listing of "lsusb -vv".
Attachments
lsusb_vv_1.txt
lsusb -vv
(3.58 KiB) Downloaded 656 times

Josh
Site Admin
Posts: 6593
Joined: 03 Nov 2007, 00:30

Re: Mode switching of ZTE MF190J.

Post by Josh » 02 Nov 2012, 09:38

Thanks a lot for the report!
This is a new device ID which I will add to the next data package release.

You can skip the manual eject if you do the following steps (assuming usb_modeswitch is installed):

1. Create a file named "19d2:1542" in "/etc/usb_modeswitch.d" and fill it with this content:

Code: Select all

# ZTE MF190J

TargetVendor=  0x19d2
TargetProduct= 0x1544

MessageContent="5553424312345678000000000000061e000000000000000000000000000000"
MessageContent2="5553424312345679000000000000061b000000020000000000000000000000"
NeedResponse=1
2. Duplicate one of the existing ZTE lines in "/lib/udev/rules.d/40-usb_modeswitch.rules" and edit the new line to reflect the product ID of your device (... ATTRS{idProduct}=="1542" ...).

moma
Posts: 3
Joined: 30 Oct 2012, 17:19

Re: Mode switching of ZTE MF190J.

Post by moma » 06 Nov 2012, 22:03

Thank you. Ok, I created /etc/usb_modeswitch.d/19d2:1542 file.

$ cat /etc/usb_modeswitch.d/19d2:1542

Code: Select all

# ZTE MF190J

DefaultVendor= 0x19d2
DefaultProduct= 0x1542

TargetVendor=  0x19d2
TargetProduct= 0x1544

MessageContent="5553424312345678000000000000061e000000000000000000000000000000"
MessageContent2="5553424312345679000000000000061b000000020000000000000000000000"
NeedResponse=1
----------------------

And added a line to /lib/udev/rules.d/40-usb_modeswitch.rules (just below the last ZTE line):
$ grep -A2 1542 /lib/udev/rules.d/40-usb_modeswitch.rules

Code: Select all

ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1542", RUN+="usb_modeswitch '%b/%k'"
----------------------

I also (hopefully) removed all previous files and attempts.

Now it correctly mode-swicthes the modem. But Houston, I have a problem:
After reboot, the network-manager menu does not display any selections for "Enable Mobile Broadband", or "TMN tmn Internet". The latter was made by the network wizard long time ago. All mobile selections have gone!

And the modem does not show any lights at all (no red light, no green, no blinking green). It's dead.
The desktop (or nm) correctly asks the PIN-code.

A picture (situation immediately after reboot):
Image

I have to UNPLUG/PLUG the 3G-pen once. Then the network menu shows the selections and I can make a connection. Then it works well and OK.

The network manager has crashed several times earlier, but it seems to restart itself (I only see the small dialogs with bug-reports).

I have now upgraded the system (I will test this again after re-boot)
sudo apt-get update
sudo apt-get upgrade && sudo apt-get dist-upgrade

Ok, same issue after upgrade and reboot. I have to unplug & plugin the 3G-pen once. Then the menu selections appear and the pen turns red, then green and finally connects. Good.
-----------
EDIT: I had to remove the changes because the pen (quite so often) do not fire even I unplug it several times. Then pen connects well after I manually unmount/eject it from the file manager. ATM this is just fine for me.

Notice: I'm able to do debugging and even coding. Please send me your commands/instructions and I will help you to find the error.
-------------

Data of this installation:
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="12.10, Quantal Quetzal"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu quantal (12.10)"
VERSION_ID="12.10"

$ uname -a
Linux quantal64 3.5.0-18-generic #29-Ubuntu SMP Fri Oct 19 10:26:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

$ NetworkManager --version
0.9.6.0

$ usb_modeswitch --version
* usb_modeswitch: handle USB devices with multiple modes
* Version 1.2.3 (C) Josua Dietze 2012
* Based on libusb0 (0.1.12 and above)
----------

EDIT:
We have now started debugging of modem and NM.
There are debug-logs attached in https://bugzilla.gnome.org/show_bug.cgi?id=680545#c9
usb_modeswitch may have crashed at least once. See last line in dmesg1.txt.

Josh
Site Admin
Posts: 6593
Joined: 03 Nov 2007, 00:30

Re: Mode switching of ZTE MF190J.

Post by Josh » 07 Nov 2012, 22:17

I suggest trying to increase the delay of the usb-storage driver. The default was changed in one of the recent kernel versions from 5 to 1 seconds:

Code: Select all

# echo 3 >/sys/module/usb_storage/parameters/delay_use

moma
Posts: 3
Joined: 30 Oct 2012, 17:19

Re: Mode switching of ZTE MF190J.

Post by moma » 07 Nov 2012, 22:49

I added it to the /etc/rc.local file because it's executed at system start as root.

Code: Select all

echo 5 >/sys/module/usb_storage/parameters/delay_use
After reboot
$ cat /sys/module/usb_storage/parameters/delay_use
5

This is the easiest way to run it as sudo (or do sudo -s first):
echo 3 | sudo tee /sys/module/usb_storage/parameters/delay_use
-----------
After reboot the modem and NM-menu are still totally dormant.
This parameter may have effect, not immediately after reboot, but the 3G-modem responds quickly if I repeatedly disconnect/unplug/plugin it to the computer. However I do not have enough tests to say this is absolutely true.

Next: I will make a new installation of Ubuntu 12.10 amanhã. This time a 32bit system. I'll be back.

EDIT:
I made a fresh Ubuntu 12.10 (32bit) installation. The bug is still here. After reboot the modem is passive and there are no modem-entries in the NM-menu. I have to unplug/reconnect it.

Also, I used Windows to disable the PIN-code. This have never been a problem in Ubuntu but I've disabled it now.

This new system has the latest updates from ppa:network-manager/trunk.
$ NetworkManager --verion
0.9.7.0

EDIT 09.nov.2012: For some reason this modem has started to behave correctly. Now it wakes up at boot, lit all its lights to max and correctly connects to the internet. Very good result. I am totally flabbergasted. Later I will test it in 64bit ubuntu too.

Damn, I praised this too early. It did not work (at boot) in 64bit, and it stopped functioning (at/after boot) in 32bit. This is damn not exact science at all. This is a voodoo thing. I will not test it anymore. It works well & ok after re-plugin and that is good. end of story!

Post Reply