Wednesday, October 07, 2009

Mobile Broadband USB Modem Fun - Ubuntu Linux - GRL Mobile, Three and Crazy John!

I have spent a lot of time working this out and patching us I go. I am pleased to say I can get three different modems (K3565-z, ZTE MF627, and the U6T) working one after the other without a reboot. I can repeat with success. Happy Happy Joy Joy!

For the benefit of others I thought I'd write about it and include my notes at the end (normally these are inside the computerbank intranet and sometimes make it on to google code issue tracker for our computerbank project).

It all started out with our upgraded Jaunty Jackalope Computerbank distro. The bugs i encountered exist in a straight JJ install too. It is not just us.

A few things that had to be resolved first; Nautilus crashes whenever you try and eject the USB modem media (GRL) from the desktop. You need to do this to switch the modem.

I also found that Network Manager in Jaunty is slightly broken (a config file needs some editing for it to use CHAP authentication). Also network manager wizard fires up when it sees the USB nodes created, so sometimes I would get two wizards. Only one connection could be correct. Eventually I ended up using jaunty ppa for network manager as the issues above had been resolved.

I'm not sure about the option module, I guess I need to compile it into the kernel. It must have been used last time because we had one of these modems working (K3565-z) in Hardy with gnome-ppp. Now it needs to be modprobed.

After that happens you can flip the modem by changing its ID. This is done by working out (getting the IDs) what USB ID the device ends up (USB or CDROM) after settling, and what ID it is when it is a modem. Some devices need ejecting to change ID again (GRL). Timing is everything. So wait!

For one of the devices, the MF627 - the UK version is different to the AU version and so are the hex codes! Mad.

For the record:
MF627 0x19d2 0x0064
U6T 0x05c6 0x9000 (needs an eject to get the initial code)
K3565-z 0x19d2 0x0052

The first value is what the device ends up as, and the second is what you want it to be, a modem.

When you get the device recognised as a modem, the /dev/ttyUSBx will be created. One of the modems I tested had five. One had two. It varies.

As soon as this happens network manager sees the USB modem and Creates a "Configure Mobile Broadband Connection" option from the applet. The wizard does not appear as this ended up causing other issues.

I also edited the serviceprovider.xml (warning it is different layout to previous version) so it was correct and had extra info for GRL, Crazy John, Dodo and other plans. Tested and works. I should see about contributing that back. I need more time to look into it.

I'll stick my notes up here soon. I need to tidy them up so they make sense. I'm still not there yet, I need to create a script or a button that runs the modprobe option command and then echos the id to a file. Or I need option already in the kernel. To be discussed...

Phew!

Notes:

Grl Hot Pink Modem: U6T model

GRL Mobile - U6T modem. Hot pink. LEDs are hard to see. The red one is bright.

NB: If the device stays red for a long time and its activated, the SIM is not in
correctly. Even though these are coded it is easy enough to do. wvdial error: Invalid
dial command. NetworkManager error: Can't get broadband capabilities of device.

When ever this device was plugged in it would cause nautilus to segfault. Ditto other
devices.

nautilus[3603]: segfault at 8bf5010 ip b4da4dc6 sp b6df4fb0 error 4 in
libbrasero-media.so.0.1.1[b4d93000+1f000]

Fixed via https://bugs.launchpad.net/ubuntu/+source/brasero/+bug/363435

To fix: sudo chmod a-r /usr/lib/nautilus/extensions-2.0/libnautilus-brasero-extension.so

There was also a network manager bug in the jaunty package.

https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/391608

Something to do with UTMS and authentication.

Error message: No CHAP secret found for authenticating us to UMTS_CHAP_SRVR

http://ubuntuforums.org/showthread.php?p=7563412

Wisdom here http://www.linuxhorizon.ro/nm_root_bug.html

Fix. (only apply to jaunty version)

1. Locate and remove the following section in /etc/dbus-1/system.d/NetworkManager.conf:

send_interface="org.freedesktop.NetworkManager.PPP"/>


2. Restart the NetworkManager

/etc/init.d/NetworkManager restart

Network manager would get confused and throw up a couple of wizards at a time. One
would be wrong. The device would get confused if the wrong wizard was chosen.

I found that the ppa version had tried to solve this. So added the ppa jaunty sources
for network manager.

Sources:

deb http://ppa.launchpad.net/network-manager/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/network-manager/ppa/ubuntu jaunty main

Getting the modem working.

* Eject the device from the desktop or using nautilus.

* sudo modprobe option

* sudo echo "0x05c6 0x9000" > /sys/bus/usb-serial/drivers/option1/new_id

This creates the devices for USBx and network manager will detect them shortly after.
Wait a bit.

The wizard no longer works - so when the connection appears (click network computer
icon) - it will say Configure Mobile Broadband Connection. Click and the (corrected)
wizard appears.

Crazy John Vodafone Modem - K3565-z model

I can't remember if this made nautilus crash. In any case there is no need to eject the VMC Lite icon that appears. It works ok without doing that. I've done so much testing I can not remember if it works when ejected?

Computerbank systems need to support multiple models of USB modem.

Fix bugs as reported for GRL U6T modem. Get up to date ppa sources for jaunty (see above).

Then when you want to use the modem:

* sudo modprobe option
* sudo echo "0x19d2 0x0052" > /sys/bus/usb-serial/drivers/option1/new_id

In a few moments, network manager and Vodafone Mobile Connect will see the modem.

Black and Green Three Modem - MF627 model

I can't remember if this made nautilus crash. I don't think I had to eject anything? It works ok without doing that. I've done so much testing with these things I could be confused.

Fix bugs as reported for GRL U6T modem. Get up to date ppa sources for jaunty network manager.

Then when you want to use the modem:

* sudo modprobe option
* sudo echo "0x19d2 0x0064" >> /sys/bus/usb-serial/drivers/option1/new_id

In a few moments, network manager will see the modem.

A script has been made for user friendly way to make this happen. Being zenity-fied.

I could not get this working with any version of vodafone mobile connect.

1 comment:

  1. Anonymous4:56 am

    It seems you have found a good solution for all users of linux.You have showed what good use you can have of Bash.Thanks mate you have saved my day after 20 pages of google.We tend to make things complicated but you have really found something worth trying.You also made me realize it is worth trying to learn Bash.

    ReplyDelete