Top Widgets


Giveaway of the Day



Samsung G800 as USB Modem in Ubuntu (Linux)

June 28th, 2009

Was charging my wife’s soon-to-be defunct Samsung G800 (due to a suspected faulty LCD flex cable/ribbon), when I thought I’d try to use it as a USB modem. Set the phone’s PC Connection option to “PC Studio” and connected. dmesg showed:

[116046.169752] usb 1-2: new full speed USB device using ohci_hcd and address 74
[116046.264136] usb 1-2: configuration #1 chosen from 1 choice
[116046.130088] cdc_acm 1-2:1.0: ttyACM0: USB ACM device
[116046.332116] usbcore: registered new interface driver cdc_acm
[116046.332125] /build/buildd/linux-2.6.24/drivers/usb/class/cdc-acm.c: v0.25:USB Abstract Control Model driver for USB modems and ISDN adapters

Tweaked my wvdial.conf a little, and tried this at first (I’m using M1 Mobile Broadband in Singapore):

[Dialer Defaults]
Baud = 460800
ISDN = 0
Stupid Mode = yes
New PPPD = yes
Modem Type = Analog Modem
Username = blank
Password = blank
Phone = *99#
Modem = /dev/ttyACM0
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,”IP”,”sunsurf”
Dial Command = ATDT
Username = 6594763418
Password = user123

did a wvdial, and got this:

--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ERROR
--> Bad init string.
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ERROR
--> Bad init string.
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ERROR
--> Bad init string.

Fine. Commented out the line that the phone didn’t like…

[Dialer Defaults]
Baud = 460800
ISDN = 0
Stupid Mode = yes
New PPPD = yes
Modem Type = Analog Modem
Username = blank
Password = blank
Phone = *99#
Modem = /dev/ttyACM0
Init1 = ATZ
#Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,”IP”,”sunsurf”
Dial Command = ATDT
Username = 6594763418
Password = user123

Tada!

--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: AT+CGDCONT=1,"IP","sunsurf"
AT+CGDCONT=1,"IP","sunsurf"
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Sun Jun 28 01:34:22 2009
--> Pid of pppd: 27727
--> Using interface ppp0
--> pppd: ���� �[06][08]��[06][08][03]
–> pppd: ���� �[06][08]��[06][08][03]
–> pppd: ���� �[06][08]��[06][08][03]
–> pppd: ���� �[06][08]��[06][08][03]
–> pppd: ���� �[06][08]��[06][08][03]
–> local IP address 112.199.153.7
–> pppd: ���� �[06][08]��[06][08][03]
–> remote IP address 10.64.64.64
–> pppd: ���� �[06][08]��[06][08][03]
–> primary DNS address 202.65.247.31
–> pppd: ���� �[06][08]��[06][08][03]
–> secondary DNS address 202.65.244.32
–> pppd: ���� �[06][08]��[06][08][03]

As my mobile broadband is on a 1Mbps plan, I couldn’t test how fast the phone could go.
But on Speedtest.net, it was hitting the max on my plan for sure. No complaints there.
Speedtest.net Test Result

On another note, for those whose distro couldn’t pick up the phone and/or automatically modprobe and/or doesn’t support cdc_acm, you could fall back on the trusty old usbserial.
lsusb gave me

Bus 001 Device 074: ID 04e8:6601 Samsung Electronics Co., Ltd Z100 Mobile Phone,

so I

sudo modprobe usbserial vendor=0x04e8 product=0x6601

and got a /dev/ttyUSB0 to play with.
Simple follow the same wvdial configurations as above, except replacing ACM0 with USB0.
My tests with usbserial displayed a max of 0.5Mbps on Speedtest, so I believe that’s the legacy limitation of usbserial and something related to its buffers.

ManUtd Belt?

May 15th, 2009

Never thought I’d see this, but I snatched it up the moment I spotted it. Not gonna say from where in case the manufacturer gets pursued for making counterfeit goods. ;p

Some things you just don’t hesitate in buying. :)

ZTE K3565-Z in (Ubuntu) Linux

May 15th, 2009

Just to add on to my previous post - after removing the deb of Vodafone Mobile Connect for Linux, the ZTE modem no longer auto-switched. Following is the udev rules file I added to make it auto-switch:

ACTION==”add”, SUBSYSTEM==”block”, SYSFS{idProduct}==”2000″, SYSFS{idVendor}==”19d2″, RUN+=”/usr/bin/eject /dev/sr1″
RUN+=”/sbin/modprobe usbserial vendor=0×19d2 product=0×0063″
ACTION==”add”, SUBSYSTEM==”block”, SYSFS{idProduct}==”0063″, SYSFS{idVendor}==”19d2″, RUN+=”/sbin/modprobe usbserial vendor=0×19d2 product=0×0063″

Put the above code in /etc/udev/rules.d/46-ZTE.rules and do a “udevadm control ––reload_rules” (that’s a dashdash as per standard Linux command arguments). After that, once you insert the K3565-Z modem, check dmesg and it should report that ttyUSB1-5 have been attached to the device, and you can follow the wvdial procedures below.

Vodafone/ZTE K3565-Z 3G USB Modem in Ubuntu (Linux)

April 18th, 2009

Well, got the modem some time back, but because it wasn’t automatically detected in Ubuntu Hardy 8.04, I didn’t mess with it again. Just the other day, decided to give it a shot again. I believe there was an update to udev on 11 Apr, and now the “ZeroCD” that gets detected and created is automatically ejected by the /etc/udev/rules.d/45-vmc-zte.rules… or was it because I had earlier tried to install the linux version of VMC Connect? Anyway, if the CDROM doesn’t get auto-ejected, eject it yourself. That serves as a trigger to the modem to switch to SD/MMC card reader mode, with the modem interface being available once you modprobe usbserial.

sudo modprobe usbserial vendor=0×19d2 product=0×0063

Thereafter, if you check the dmesg log, you should see 5 ttyUSB devices being created, 0-4. /dev/ttyUSB3 is the right modem interface, at least for me. Salient parts of my /etc/wvdial.conf:

[Dialer Defaults]
Baud = 460800
ISDN = 0
Stupid Mode = yes
New PPPD = yes
Modem Type = Analog Modem
Username = blank
Password = blank
Phone = *99#

[Dialer K3565]
Modem = /dev/ttyUSB3
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Baud = 9600

And thereafter, a simple

sudo wvdial K3565

does the trick! Funny why the same sequence didn’t seem to work a month back… but no matter, as long as it works now. Sometimes, it’s just easier to use a stick modem than the clunky Huawei E220.

The English FA’s Reputation

February 3rd, 2009

is at stake.

If they don’t do something about this Bosingwa-asskick-Benayoun incident then they truly ought to just dissolve themselves. And if the team wearing red doesn’t care about getting some justice done just because they won they game, then their players truly deserve a kick in the ass whenever they win the game. Heck, I wish United would lose to them so that we can kick every single player’s ass, even the manager’s!

Edit: It’s official. The English FA are a bunch of wussies. For something as seriously blatant as this, whatever rules should be secondary. It was a dangerous tackle, butt-high! It wasn’t a poorly timed tackle, it wasn’t a slip of the foot, it was a calculated aimed kick at Benayoun’s ass! Gosh. Time for the FA to see how stupid their organisational rules are. The linesman Mo Matadar, ought to be relagated to officiating Blue Square Premier League matches.