Tuesday, April 28, 2009

[solved] PROLINK PHS100 HSDPA workout for Debian lenny and Ubuntu intrepid


* check wethre system is up-to-date ( apt-get update && apt-get upgrade)
1. wget http://www.draisberghof.de/usb_modeswitch/usb_modeswitch-0.9.7.tar.bz2
2. tar xjvf usb_modeswitch-0.9.7.tar.bz2 && cd usb_modeswitch-0.9.7 && make install
3. Edit /etc/usb_modeswitch.conf and add following section (similar to iCON 210 section) to end of the file
########################################################
# Option PROLINK PHS100
#
# Contributor: laxaman

DefaultVendor= 0x1e0e
DefaultProduct= 0xf000

TargetVendor= 0x1e0e
TargetProduct= 0x9000

# Not really necessary because IDs of target device are different
TargetClass= 0xff

MessageEndpoint=0x1
MessageContent="555342431234567800000000000006bd000000020000000000000000000000"

ResponseEndpoint=0x1


4. Create /usr/sbin/prolink_hsdpa.sh with the content given bellow and make it executable (chmod +x /usr/sbin/prolink_hsdpa.sh)
#!/bin/bash
# Copyright (C) 2008 Nayanajit Mahendra Laxaman mail: nmlaxaman@gmail.com

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

PATH=/usr/bin:/bin:/usr/sbin:/sbin
modprobe -r usbserial
sleep 1
modprobe usbserial vendor=0x1e0e product=0x9000


5. Create /etc/udev/rules.d/45-prolink_hsdpa.rules with the content given bellow
# Copyright (C) 2008 Nayanajit Mahendra Laxaman mail: nmlaxaman@gmail.com

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.


ACTION=="add", SUBSYSTEMS=="scsi", DRIVERS=="sr", \
ATTR{manufacturer}=="PROLINK ", \
RUN:=""

SUBSYSTEM=="usb", SYSFS{idProduct}=="f000", SYSFS{idVendor}=="1e0e", \
RUN:="/usr/sbin/usb_modeswitch"

SUBSYSTEM=="usb", SYSFS{idProduct}=="9000", SYSFS{idVendor}=="1e0e", \
RUN:="/usr/sbin/prolink_hsdpa.sh"


6. Thats it now you can plug your PROLINK PHS100 hsdpa dongle you will see some devices in /dev/ such as ttyUSB0 ttyUSB1 ttyUSB2 ttyUSB3 ttyUSB3 will the working one for data connection

7. You can use wvdial to dial your connection. If you don't have wvdial then install it (apt-get install wvdial). copy following content to /etc/wvdial.conf and type wvdial in your terminal to connect.


[Dialer Defaults]
Modem = /dev/ttyUSB3
Baud = 1843200
Modem Type = Analog Modem
Init2 = ATZ
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init4 = AT+CGDCONT=1,"IP",""
Dial Command = ATDT
Phone = *99***1#
Username = ''
Password = ''
Stupid Mode = yes

Friday, April 24, 2009

Script to add applications to fvwm-crystal menu

Following script will add applications to fvwm-crystal menu

Screenshot of fvwm-crystal:



#!/bin/bash
APP_BASE=/usr/share/fvwm-crystal/fvwm/Applications
#APP_BASE=~/.fvwm/Applications/

if [[ $1 == '' ]]
then
echo "Usage:"
echo "$0 [icon name]"
exit 0
fi


if [[ ! -e $APP_BASE ]]
then
echo "Menu base does not exists!"
exit 0
#mkdir -p $APP_BASE
fi

MENUS=($( ls $APP_BASE ));
MENU=
APP=$1
APP_NAME=`basename $1`
ICON=$2
SCRIPT=

if [[ `which $APP` == '' && ! -e $APP ]]
then
echo "$APP does not exists!"
exit 0
fi

i=0
while true
do
[[ ${MENUS[$i]} == '' ]] && break;
echo "$i. ${MENUS[$i]}"
i=`expr $i + 1`
done

OPT=''
echo "Enter Menu number to insert item:"
read OPT
if [[ $OPT -lt $i && $OPT -ge 0 ]]
then
MENU=${MENUS[$OPT]}
else
echo "wrong"
fi

if [[ $2 == '' ]]
then
ICON=$APP_NAME
fi

SCRIPT="~$ICON~$APP_NAME"


ANS=""
echo "Menu item: $APP_BASE/$MENU/$SCRIPT"
echo "Continue creating menu item? [y/n]: "
read ANS
if [[ $ANS == 'y' ]]
then
if [[ -e $SCRIPT ]]
then
echo "Script exists!";
else
echo "#!/bin/sh
exec $APP \$@
" > $APP_BASE/$MENU/$SCRIPT
chmod +x $APP_BASE/$MENU/$SCRIPT
fi
else
echo "Not creating menu item!"
fi


Save the script in /usr/bin/fvwm-crystal-menu-gen.sh and make it executable (chmod +x /usr/bin/fvwm-crystal-menu-gen.sh). Use following sytax to add applications to menus

/usr/bin/fvwm_crystal_menu_gen.sh [icon name]


If the application is in PATH you don't have to enter absolute path as just give application name. If you want to acompany an icon with a different name input it in place [icon name]

Intel Corporation XMM7360 LTE Advanced Modem in ArchLinux

The required packages are available in ArchLinux User Repository (AUR) so it will be easier if you can use an AUR helper package like yay . ...