Search This Blog

Saturday, July 31, 2010

Plasma NM, modem Sony MD300 and more...

During the time I implemented ModemManager support in Solid I did the tests with my Sony MD300 modem. For anyone to use this modem in Linux do this as root (or use sudo):

  1. Install networkmanager-0.8 and modemmanager-0.4;
  2. Create the file /etc/udev/rules.d/50-md300modem.rules with the follwing contents:





    1. ACTION!="add", GOTO="3G_End"
    2. SUBSYSTEM=="usb_device", ATTRS{idProduct}=="d0cf", ATTRS{idVendor}=="0fce", PROGRAM+="md300modem.sh %p"
    3. SUBSYSTEM=="usb", ATTRS{idProduct}=="d0cf", ATTRS{idVendor}=="0fce", KERNEL=="ttyACM*", SYMLINK+="modem3G-%n"
    4. LABEL="3G_End"
    
  3. Create the script /lib/udev/md300modem.sh with the following contents:





    1. #!/bin/sh
    2. echo 3 > /sys/$1/device/bConfigurationValue
    3. sleep 3
    4. # enables/activates the modem (turns radio on and registers to operator network).
    5. chat -V -s '' "AT +CFUN=1" 'OK' '' < /dev/ttyACM0 > /dev/ttyACM0
  4. Run: udevadm control --reload-rules;
  5. Click on Plasma NM's system tray icon -> Manage Connections -> Mobile broadband  -> Add -> GSM Connection and use the parameters:





    Number: *99#
    Username: <operator's username>
    Senha: <operator's password>
    APN: <operator's apn>
    Type: Any
    For instance my configuration is as follow:
    Number: *99#
    Nome do usuário: tim
    Senha: tim
    APN: tim.br
    Type: Any
    
    OBS: some cell phones, like my Samsung i8910, only connects if "Type" is set to "Any". The MD300 connects with any of the types listed.
  6. Hook up the modem to the USB port, wait until it powers up and register itself to the operator network (takes about 30 seconds to do both);
  7. In the Plasma NM initial window clicks on the connection you have created.
My modem connects only once in ethernet mode (default mode), to connect again I have to remove it from USB port and hook it up again. I do not know why that happens and one guy told me his MD300 does not behave like that. Oddly enough with wvdial and kppp, which uses ppp mode, it does have this problem.

To make it easier to set up a Mobile Broadband connection I have started to port the nm-applet connection wizard to KDE. It is still in early stage and I am working on it only during weekends. Probably it will be ready for KDE release 4.6 early next year. The initial window is like this:



It takes some time to understand how both nm-applet wizard and Plasma NM kcm modue work and since I can only work on it during weekends do not expected something usefull until September.

Wednesday, July 14, 2010

Plasma NM: testing mode

I am back to Brasil after a great time in Tampere and Helsinki. During Akademy I commited my changes to Solid and Plasma NetworkManagement to trunk, now anyone brave anough to use trunk can try them :-)

Today I have added a hack to Plasma NM to make the traffic graph work with ppp connections. The problem was that NetworkManager only provides the serial device name (e.g. /dev/ttyACM0 or /dev/ttyUSB0) and Plasma::DataEngine expects the network interface name (ppp0) used by the device. I hacked Plasma NM by changing the Plasma::DataEngine::connectSource parameter to always use ppp0 when the interface name contains ttyACM or ttyUSB. I know that is ugly and error prone, if anyone knows how to convert serial device names to network interface names let me know. The only way to do it I have found so far is monitoring /var/log/daemon (or /var/log/messages) for the line pppd[]: Connect: ppp0 <--> /dev/ttyACM0, but that is also ugly and the log file containing the needed information can be different on each platform KDE SC is installed.

I have also tested Plasma NM with my Samsung i8910 cell phone. It only connects if I set Plasma NM's tray icon -> Manage Connections -> Mobile Broadband -> -> Edit -> Type to "Any" (it was "Prefer3G" before the change). Maybe someone else also needs to change that to make his/her phone connect. The number to dial also needs to be *99# instead of *99***1# . That is strange because my Sony MD300 modem works with *99***1# and as far as I know *99# is a short name for *99***1#.

Modem Manager does not report the access technology (Edge, HSDPA, etc) for my cell phone. I have received the report that Nokia N95 also connects and MM also does not report the access technology for that phone too.

There are other changes I am working on, when they are ready I will let you know :-)