OpenWrt Forum Archive

Topic: Kamikaze trunk 7.09 and HSDPA connection

The content of this topic has been archived on 22 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

UPDATE
The more effective way to connect is by using the comgt package as underlined in this thread by aoz.syn, that I thank very much. More information in this thread is given in the following posts by aoz.syn. So please consider comgt package in order to activate your HSDPA connection (but also the others).
Here some aoz.syn useful informations
"Mostly the comgt package provides is a sane and tested set of PPP and OpenWRT scripts designed to make configuring cellular data connections as painless as possible.  Hopefully the next release will come soon and include it, but here are the additional configuration options it currently provides:



config interface "foo"
    option device       "/dev/ttyUSB0"
    option proto        "3g"
    option apn          "my.provider.apn"
    option service      "hsdpa" # or cdma, evdo, umts_only, or gprs_only
    option pincode      "12345"
    option mtu          "1492"

So, here are my two condensed lists, truths and needs:

Truths:
- Most cellular modems, whether they plug in via PCMCIA, Cardbus, ExpressCard, or direct USB are USB at heart
- Serial speed doesn't matter
- As long as you have a directly supported device and a kernel less than two years old, you don't need to mess with buffer sizes
- Actual throughput almost never matches marketed throughput

Needs:
- For a PCMCIA or Cardbus device, you will need your hardware's PCMCIA or Cardbus drivers in addition to your USB driver
- For an ExpressCard, the base PCI drivers
- A base USB driver (usually ohci_hcd for Cardbus/PCMCIA/ExpressCard)
- usb-serial (2.6) or usbserial (2.4)
- device-specific driver, if available
At this point, if you plug in your device you should see /dev/ttyUSB0 or higher.  If you don't, you are missing a driver or driver option
- pppd
- A chat script (there are dozens of examples out there, comgt does provide one that should work for most people)"


The Following is DEPRECATED (better use of comgt)


UPDATE!!! Dear all, I am terribly sorry, but there was a mistake in my router. In the tag on the bottom part the putted asus wl500GP v2 and
they sell to me as V2, but in reality is a V1!!!! You can see the picture here
http://wl500g.info/showthread.php?p=96239#post96239
You should be able to read in the bottom picture wl500GP v2 but in reality is
a wl500G Premium (v1!!!!) as it is shown on the picture (antenna on the left). In the following everything refers to V1

I would like to share with you my last two week experience in connecting a router with a HSDPA usb modem.I am newby but I hope my results could help someone in connecting and maybe improve my solution. I am newby so I am sorry for my naif methods, but it worked. Of course, I will decline any responsibility. Update: It is noteworthy that "HSDPA usb modems" can be used with any router with usb port and they do not need router with special features, like PCMCIA and datacard!!!

You need:

1) Any kamikaze trunk 7.09 router with usb. I used a brand new ASUS wl500GP v2
2) Any HSDPA modem with its initialization commands. I used a modem Onda MH600HS (HSDPA 7.2 Mega). I will support some information about
Huawei E220, since I have the documentation.
3) Internet connection, used for installation


History
Before using a kamikaze trunk based solution I tried, on my Asus wl500GP v2, a product specific firmware, koppel firmware, that I found in http://koppel.cz/cdmawifi/. Koppel is derivated from oleg firmware, http://oleg.wl500g.info/ and oleg comes from the asus original firmware.
I used Koppel firmware within a good Italian Howto (http://forum.telefonino.net/showthread. … ost4976685)
The problem was that the version used of Koppel did not work, because the new v2 was quite different from old v1.
Anyway Koppel and Oleg forums were important to me to learn a little bit about usb HSDPA connection.
Then I decided to use Kamikaze.

How to
1) Look for a suitable Kamikaze trunk software. I used this I found in this post http://forum.openwrt.org/viewtopic.php?id=14856&p=2 a suitable v2 Kamikaze trunk 7.09 (broadcom 2.4)  firmware version here http://web03.tzmo.com.pl/~bartek/asuswl500gpv2/.

2) Install Kamikaze. I putted in the recovery mode and used window recovery program to upload the firmware.

3) I followed the howto in http://wiki.openwrt.org/MobileAPHowTo2# … 1fb39fd5cf.
I did the following packages:
[s]ipkg install kmod-usb-ohci[/s] UPDATE: ipkg install kmod-usb-uhci, kmod-usb-uhci-iv, kmod-usb-ohci is not necessary
ipkg install kmod-usb-serial
ipkg install microcom
ipkg install kmod-ppp
ipkg install ppp
ipkg install chat

reboot
in the dsmeg, if you connect your modem your should recognize your modem:

 USB Mass Storage support registered.
hub.c: new USB device 01:03.0-2, assigned address 2
usb.c: USB device 2 (vend/prod 0x19d2/0x1) is not claimed by any active driver.
device wl0 entered promiscuous mode
wl0: attempt to add interface with same source address.
br-lan: port 2(wl0) entering learning state
br-lan: port 2(wl0) entering forwarding state
br-lan: topology change detected, propagating

Here you see Vendor  and Product ID of my modem (for E220 0x12d1 0x1003)


4) you should set vid and pid and maxSize in usbserial

usbserial vendor=0x19d2 product=0X0001 maxSize=4096
E220 usbserial vendor=0x12d1 product=0x1003 maxSize=4096
IMPORTANT!!! maxSize=4096 buffer size it is necessary for HSDPA. Otherwise default it will go as gprs...
reboot
in dmesg you should have the three devices ttyUSB0 ttyUSB1 ttyUSB2 now:


.............
USB Mass Storage support registered.
hub.c: new USB device 01:03.0-2, assigned address 2
usbserial.c: Generic converter detected
usbserial.c: Generic converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
usbserial.c: Generic converter detected
usbserial.c: Generic converter now attached to ttyUSB1 (or usb/tts/1 for devfs)
usbserial.c: Generic converter detected
usbserial.c: Generic converter now attached to ttyUSB2 (or usb/tts/2 for devfs)
device wl0 entered promiscuous mode
wl0: attempt to add interface with same source address.
...........

5) now you can test if  modem works by sending command via microcom.
microcom -D/dev/usb/tts/0
AT
OK
6) Config files. This part depend on specific modem, type of connection. In
http://www.advantedgecomputing.com/open … linux.html you can find useful information, otherwise google it!
IMPORTANT: In order to have HSDPA you have to specify the negotiation speed
my modem negotiation speed: 921600
E220 negotiation speed:460800

mkdir /etc/ppp/peers
vi /etc/ppp/peers/hsdpa
my modem hsdpa file (comments in Italian)

 root@OpenWrt:/etc/ppp/peers# cat hsdpa
#informazioni sul dispositivo
/dev/usb/tts/0 #dispositivo assegnato al modem ONDA
921600 #velocit� 
#echo 'settata velocit� '
hide-password
noauth
debug
defaultroute
noipdefault
noccp
nobsdcomp
usepeerdns
connect-delay 10000
nodetach
user ""
password ""
#echo 'chiamo lachat'

connect "/usr/sbin/chat -t 60 -f /etc/ppp/peers/hsdpa.chat

E220 HSDPA should look like:
hide-password
noauth
debug
/dev/usb/tts/0
460800
defaultroute
noipdefault
noccp
nobsdcomp
usepeerdns
connect-delay 10000
nodetach
user "$username$"
connect "/usr/sbin/chat -t 60 -f /tmp/ppp/peers/hsdpa.chat

My modem chat file:
vi /etc/ppp/peers/hsdpa.chat

 root@OpenWrt:/etc/ppp/peers# cat hsdpa.chat
SAY 'Inizio connessione...'
'' 'ATZ'
'' 'AT+ZOPRT=5'
TIMEOUT 5
'' 'AT'
'' 'ATV1'
'' 'AT&F&D2&C1S0=0'
'' 'ATS7=60S30=0'
'' 'AT+CGDCONT=1,"IP","datacard.tre.it"'
'' 'AT+COPS=1,0,"3 ITA"'
'' 'ATDT*99***1#'
SAY 'connesso infine'

In particular:
'AT+CGDCONT=1,"IP","datacard.tre.it <-connection type, my APN
'AT+COPS=1,0,"3 ITA"'<---- no Roaming, only my operator[/color]
'ATDT*99***1#'<---dial number


E220 chat file should be like:

'' ''
'' 'ATZ'
TIMEOUT 5
'OK' 'AT+CGDCONT=1,"IP","$apn$"'
'OK' 'ATDT$dialno$'
'CONNECT' ''


7) Device setup and Lock file directory creation
You can try:
root@OpenWrt:~# pppd call hsdpa
You may have:
pppd: pppd is unable to open the /dev/ppp device.

In this case, as suggested in http://wiki.openwrt.org/MobileAPHowTo2# … 1fb39fd5cf
you may need (I did not) to do the following:

mknod /dev/ppp c 108 0
root@OpenWrt:~# mkdir /var/lock
root@OpenWrt:~# vi /etc/modules.d/70-ppp
slhc
ppp_generic
ppp_async

also if you have lock option you may add the following

root@OpenWrt:~# vi /etc/init.d/S80ppp
#!/bin/sh
mkdir -p /var/lock
root@OpenWrt:~# chmod +x /etc/init.d/S80ppp


8) Setting the WAN


 root@OpenWrt:/# cat /etc/config/network
#### VLAN configuration
config switch eth0
        option vlan0    "1 2 3 4 5*"
        option vlan1    "0 5"


#### Loopback configuration
config interface loopback
        option ifname   "lo"
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0


#### LAN configuration
config interface lan
        option type     bridge
        option ifname   "eth0.0"
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0


#### WAN configuration
config interface        wan
        option ifname   "ppp0"
        option device   "ppp0"
root@OpenWrt:/# cat /etc/config/wireless
config wifi-device  wl0
        option type     broadcom
        option channel  5

        # REMOVE THIS LINE TO ENABLE WIFI:
        #option disabled 1



option wifi-iface
        option device wl0
        option network lan
        option mode ap
        option ssid KamikazeHSDPA
        option encryption psk
        option key 'HSDPAconnect!'
root@OpenWrt:/#

9) test drive :
pppd call hsdpa


 root@OpenWrt:/# ifconfig ppp0
ppp0      Link encap:Point-to-Point Protocol
          inet addr:10.112.4.3  P-t-P:10.64.64.64  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:43354 errors:583 dropped:0 overruns:0 frame:0
          TX packets:31102 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:50288275 (47.9 MiB)  TX bytes:3923668 (3.7 MiB)

root@OpenWrt:/etc/ppp/peers# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.64.64.64     0.0.0.0         255.255.255.255 UH        0 0          0 ppp0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 br-lan
0.0.0.0         10.64.64.64     0.0.0.0         UG        0 0          0 ppp0

10) For the moment I reach the end. I discharghe at [s]500 kb from Itunes[/s] 1300 kb/s (same result I had with computer direct connection)

(Last edited by againmoon on 12 May 2008, 06:15)

Just for sake of completeness I attach the ipkg list_installed output.
Here there are all the package I used for connection (i.e there is not kmod-usb-ohci)


 root@OpenWrt:~# ipkg list_installed
bridge - 1.0.6-1 -
bzip2 - 1.0.5-1 -
chat - 2.4.3-9 -
dnsmasq - 2.41-1 -
dropbear - 0.50-3 -
e2fsprogs - 1.39-1 -
fdisk - 2.13.0.1-1 -
gsm-utils - 1.0.10-1 -
gzip - 1.3.3-1 -
hdparm - 8.5-1 -
hotplug2 - 0.9+r102-2 -
iptables - 1.3.8-2 -
kernel - 2.4.35.4-brcm-2.4-1 -
kmod-brcm-wl - 2.4.35.4+4.150.10.5.1-brcm-2.4-1 -
kmod-diag - 2.4.35.4-brcm-2.4-2 -
kmod-fs-cifs - 2.4.35.4-brcm-2.4-1 -
kmod-fs-ext2 - 2.4.35.4-brcm-2.4-1 -
kmod-fs-ext3 - 2.4.35.4-brcm-2.4-1 -
kmod-fs-ntfs - 2.4.35.4-brcm-2.4-1 -
kmod-fs-vfat - 2.4.35.4-brcm-2.4-1 -
kmod-ipt-nathelper - 2.4.35.4-brcm-2.4-1 -
kmod-nls-cp1250 - 2.4.35.4-brcm-2.4-1 -
kmod-nls-iso8859-1 - 2.4.35.4-brcm-2.4-1 -
kmod-nls-iso8859-2 - 2.4.35.4-brcm-2.4-1 -
kmod-nls-utf8 - 2.4.35.4-brcm-2.4-1 -
kmod-ppp - 2.4.35.4-brcm-2.4-1 -
kmod-pppoe - 2.4.35.4-brcm-2.4-1 -
kmod-scsi-core - 2.4.35.4-brcm-2.4-1 -
kmod-switch - 2.4.35.4-brcm-2.4-1 -
kmod-usb-core - 2.4.35.4-brcm-2.4-1 -
kmod-usb-serial - 2.4.35.4-brcm-2.4-1 -
kmod-usb-storage - 2.4.35.4-brcm-2.4-1 -
kmod-usb-uhci - 2.4.35.4-brcm-2.4-1 -
kmod-usb-uhci-iv - 2.4.35.4-brcm-2.4-1 -
kmod-wlcompat - 2.4.35.4+4.150.10.5.1-brcm-2.4-1 -
libblkid - 1.39-1 -
libgcc - 3.4.6-12 -
libgsm - 1.0.10-1 -
libncurses - 5.6-1 -
libuci - 0.3.0-1 -
libusb - 0.1.12-1 -
libuuid - 1.39-1 -
lsof - 4.77-1 -
microcom - 1.02-1 -
minicom - 2.3-1 -
mtd - 6 -
nas - 4.150.10.5.1-1 -
nvram - 1 -
pciutils - 2.2.9-1 -
ppp - 2.4.3-9 -
ppp-mod-pppoe - 2.4.3-9 -
qc-usb-utils - 0.6.5-1 -
screen - 4.0.3-1 -
tar - 1.18-1 -
uci - 0.3.0-1 -
uclibc - 0.9.29-12 -
usbutils - 0.73-1 -
wireless-tools - 29-2 -
wlc - 4.150.10.5.1-1 -
zlib - 1.2.3-5 -
Done.
root@OpenWrt:~#

(Last edited by againmoon on 3 May 2008, 07:47)

I would like to integrate the howto
In order to connect automatically i made the following files

 cat /usr/local/hsdpastarter
#!/bin/sh


while true; do
        killall -9 pppd
        sleep 5

        pppd call hsdpa

        sleep 25
done

make an exe chmod +x hsdpastarter

and put this  /usr/local/hsdpastarter in initialization files.

I putted in my last file of initialization 

root@OpenWrt:/etc/init.d# cat /etc/init.d/sysctl

#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org

START=99
start() {
        [ -f /etc/sysctl.conf ] && sysctl -p >&-
       [b] /usr/local/hsdpastarter[/b]
}

I know you're talking specifically about 7.09, but trunk has a much-improved 'comgt' package that covers just about everything you'll need for EvDO/HSDPA modems, be they on pcmcia or USB.

Thanks,
In effect I considered comgt but here http://josefsson.org/grisslan/internet.html it is written
"The next step is to get dial-up PPP working. The “comgt��  package contains several 3G/UMTS scripts that appear to be intended for the WRT54G3G or similar devices. "
So I was unsure about the possibility to use it in asus500gp v2 , no documentation.
Anyway I will consider comgt, even if I am happy with my solution....
thanks

P.S comgt refers explicitelly to PCMCIA and datacard  HSDPA connection (see for instance http://www.pharscape.org/content/view/46/70/). This post concerns usb modem that are connected to usb router like any other device. They can be used in a general router such as ASUS wl500GP and they do not need a specific router with PCMCIA for instance.   
Please tell me if I am wrong....

(Last edited by againmoon on 6 May 2008, 05:35)

I try to setup a E220 on a Netgear WGT634 - it works only with Kamikaze Kernel 2.6

1) the E220 needs the kmod-usb-ohci package

But still it does not recognice the modem correctly:

my dmesg part concerning usb:

ohci_hcd: 2006 August 04 USB 1.1 'Open' Host Controller (OHCI) Driver
PCI: Enabling device 0000:00:02.0 (0000 -> 0002)
PCI: Fixing up device 0000:00:02.0
PCI: Setting latency timer of device 0000:00:02.0 to 64
ohci_hcd 0000:00:02.0: OHCI Host Controller
ohci_hcd 0000:00:02.0: new USB bus registered, assigned bus number 1
ohci_hcd 0000:00:02.0: irq 5, io mem 0x40010000
eth0.1: add 01:00:5e:00:00:01 mcast address to master interface
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
PCI: Enabling device 0000:00:02.1 (0000 -> 0002)
PCI: Fixing up device 0000:00:02.1
PCI: Setting latency timer of device 0000:00:02.1 to 64
ohci_hcd 0000:00:02.1: OHCI Host Controller
ohci_hcd 0000:00:02.1: new USB bus registered, assigned bus number 2
ohci_hcd 0000:00:02.1: irq 5, io mem 0x40011000
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
USB Universal Host Controller Interface driver v3.0
usbcore: registered new interface driver usbserial
drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
drivers/usb/serial/usb-serial.c: USB Serial Driver core
usb 1-1: new full speed USB device using ohci_hcd and address 2
usb 1-1: configuration #1 chosen from 1 choice

how do I set vid and pid and maxSize in usbserial - when I do

root@OpenWrt:~# usbserial vendor=0x12d1 product=0x1003 maxSize=4096
-ash: usbserial: not found

I tried it like described here: http://josefsson.org/grisslan/internet.html

I modifyed “/etc/modules.d/60-usb-serial† into:
usbserial vendor=0x12d1 product=0x1003 maxSize=4096

nothing changed - do you have any idea

generally I thought the E220 is recogniced in Kernels bigger than 2.6.19 and also in Kamikaze bigger than 7.06

kultex wrote:

I try to setup a E220 on a Netgear WGT634 - it works only with Kamikaze Kernel 2.6

I do not know wgt634 netgear and I dont'have e220. I know in asus 2.6 can have some problems...
i had a quick search but no document, i am sorry

1) the E220 needs the kmod-usb-ohci package

This depend on the  netgear, generally they use uhci, some ohci, and not depend on E220. see http://wiki.openwrt.org/UsbStorageHowto … storage%29

But still it does not recognice the modem correctly:

my dmesg part concerning usb:

ohci_hcd: 2006 August 04 USB 1.1 'Open' Host Controller (OHCI) Driver
PCI: Enabling device 0000:00:02.0 (0000 -> 0002)
PCI: Fixing up device 0000:00:02.0
PCI: Setting latency timer of device 0000:00:02.0 to 64
ohci_hcd 0000:00:02.0: OHCI Host Controller
ohci_hcd 0000:00:02.0: new USB bus registered, assigned bus number 1
ohci_hcd 0000:00:02.0: irq 5, io mem 0x40010000
eth0.1: add 01:00:5e:00:00:01 mcast address to master interface
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
PCI: Enabling device 0000:00:02.1 (0000 -> 0002)
PCI: Fixing up device 0000:00:02.1
PCI: Setting latency timer of device 0000:00:02.1 to 64
ohci_hcd 0000:00:02.1: OHCI Host Controller
ohci_hcd 0000:00:02.1: new USB bus registered, assigned bus number 2
ohci_hcd 0000:00:02.1: irq 5, io mem 0x40011000
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
USB Universal Host Controller Interface driver v3.0
usbcore: registered new interface driver usbserial
drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
drivers/usb/serial/usb-serial.c: USB Serial Driver core
usb 1-1: new full speed USB device using ohci_hcd and address 2
usb 1-1: configuration #1 chosen from 1 choice

you cannot do anything if you do not recognize your modemfirst!!!!

how do I set vid and pid and maxSize in usbserial - when I do

root@OpenWrt:~# usbserial vendor=0x12d1 product=0x1003 maxSize=4096
-ash: usbserial: not found

I tried it like described here: http://josefsson.org/grisslan/internet.html

I modifyed “/etc/modules.d/60-usb-serial��  into:
usbserial vendor=0x12d1 product=0x1003 maxSize=4096

nothing changed - do you have any idea

try this
http://wiki.openwrt.org/MobileAPHowTo2# … 1fb39fd5cf

generally I thought the E220 is recogniced in Kernels bigger than 2.6.19 and also in Kamikaze bigger than 7.06

I also think so

(Last edited by againmoon on 7 May 2008, 07:05)

Hi M8ts smile
I would like to know what software or how do u guys change the code from the wl-500gP v2??
Im a learner and i would like to know how u guys flashed the router also...

Thanks...

againmoon wrote:

P.S comgt refers explicitelly to PCMCIA and datacard  HSDPA connection (see for instance http://www.pharscape.org/content/view/46/70/). This post concerns usb modem that are connected to usb router like any other device. They can be used in a general router such as ASUS wl500GP and they do not need a specific router with PCMCIA for instance.   
Please tell me if I am wrong....

Does it help you to understand that I'm an active contributor to the comgt package in OpenWRT and do this very thing professionally?

Most 3G modems communicate over USB, whether they plug in via PCMCIA, USB, or ExpressCard.  There are very few exceptions.  The PCMCIA and ExpressCard devices have an internal USB hub that ends up presenting the radio as a USB-serial device.  Everything's the same, the only thing that changes is the physical connection bus.  The comgt package may well specifically reference PCMCIA/Cardbus, but that's just a documentation shortcoming, as it applies generally.  It's not even just for HSDPA - I submitted the patches (which were applied months back) to make it gracefully handle EvDO connections as well.

Aoz I thank you for your very useful information. I apologize but I dont think, as I underlined, there was enough information, to consider such a solution. Now I know a little be more but, please, I really invite you to post an how to, maybe here, to support people like me. I am not professional but with little more right information May be I could have saved time.

In effect I think there are more information I would like to have...
here http://josefsson.org/grisslan/internet.html comgt is used but no HSDPA references are made (packet size in usbserial, max speed settings). This is important if you want to get HSDPA fast connection (I get more than 1300 kb/s on the average and I could max 7200 kb/s, normal UMTS will be at max 400 kb/s).
Also pppd options are not shown and neither modem specific AT commands. You need this informations to make your changes. I know you can find on your own and kamikaze is for expert, but my time is for me.....

This is the motivation I started this how to, where I integrated this http://wiki.openwrt.org/MobileAPHowTo2# … 1fb39fd5cf (very good but no comgt information) with my personal experience.

By the way for me is ok and I got the point. I really will be glad if you could put a  howto (great in this thread!) more comgt based.
Comgt will be more visible also for usb external modem users.

Thanks

(Last edited by againmoon on 8 May 2008, 05:08)

Rodney wrote:

Hi M8ts smile
I would like to know what software or how do u guys change the code from the wl-500gP v2??
Im a learner and i would like to know how u guys flashed the router also...

Thanks...

Rodney I am almost a learner. Up to now v2 it is not yet officially supported in openwrt.
So there are development versions, trunks.
As stated in the howto I used one version that was made by others (here http://forum.openwrt.org/viewtopic.php?id=14856 you find
all information). I flashed it in recovery mode, by using winxp recovery asus utility. Surely there are better methodsbut for me this was fastest.
To enter recovery unplug, press recovery button and keep pressed. Plug and keep pressing few secs until power light blinks.

(Last edited by againmoon on 8 May 2008, 05:32)

I really invite you to post an how to, maybe here, to support people like me. I am not professional but with little more right information May be I could have saved time.

I'm not a big HOWTO fan, they become stale all too quickly and are too often sufficiently incorrect so as to draw unsuspecting readers down a long road, only to make them retrace the steps to find the errors.  However, I am more than willing to share concepts and some specific experience.

(packet size in usbserial, max speed settings). This is important if you want to get HSDPA fast connection

This is precisely the kind of misinformation spread by stale and incorrect documentation.  I am looking for the precise code reference that supports this, but here's the most important point:

- Serial speed settings don't matter

I have experimentally proven this, This Guy has proven it, you can prove it too.  Simply change your 'speed 921600' line to 'speed 9600', dial up, and do a speed test.  Unless you are running over a physical UART (not a USB-based device), whatever speed you tell PPP to negotiate is pretty much ignored.

The second misinformation being spread is that you have to increase your buffer (not packet) size in usb-serial.c (or usbserial.c for 2.4 series).  While you can, it's the wrong place to do it, even though there's an option to do so.  For quite some time now, the drivers have been increasing their buffers from 64 bytes (the problematic size) to 2048 and even 4096 bytes.  Here's the second most important point:

- If your modem is supported directly by the kernel (Sierra, Airprime, IPW, and most Option, Huawei, Audiovox, Novatel, Anydata, and Dell supported by option.c in the 2.6 kernel), you don't need to mess with buffer sizes - they're already 4096 bytes.

However, if you have the USB (and PCMCIA if necessary) drivers installed and your modem isn't recognized by default, you will then probably have to mess with the vendor, product, and buffer parameters to usbserial.  At that point, you are using the usbserial driver as a 'catch-all' one, and although it is suboptimal it will work.  The best way, of course (but not easiest) until the next version is released is to build from scratch.

(I get more than 1300 kb/s on the average and I could max 7200 kb/s, normal UMTS will be at max 400 kb/s)

7.2Mbps is the physical specification; expecting to get that is like expecting to get a full 24Mbps out of an ADSL2+ line.  Your ISP is the limiting factor, and as long as you get over 1Mbps on an HSDPA or EvDO connection, your configuration is the least of your worries.  The only realistic test of the raw speed of your connection is against a server within your own cellular provider's network, and often not really even then.


Mostly the comgt package provides is a sane and tested set of PPP and OpenWRT scripts designed to make configuring cellular data connections as painless as possible.  Hopefully the next release will come soon and include it, but here are the additional configuration options it currently provides:

config interface "foo"
    option device       "/dev/ttyUSB0"
    option proto        "3g"
    option apn          "my.provider.apn"
    option service      "hsdpa" # or cdma, evdo, umts_only, or gprs_only
    option pincode      "12345"
    option mtu          "1492"

So, here are my two condensed lists, truths and needs:

Truths:
- Most cellular modems, whether they plug in via PCMCIA, Cardbus, ExpressCard, or direct USB are USB at heart
- Serial speed doesn't matter
- As long as you have a directly supported device and a kernel less than two years old, you don't need to mess with buffer sizes
- Actual throughput almost never matches marketed throughput

Needs:
- For a PCMCIA or Cardbus device, you will need your hardware's PCMCIA or Cardbus drivers in addition to your USB driver
- For an ExpressCard, the base PCI drivers
- A base USB driver (usually ohci_hcd for Cardbus/PCMCIA/ExpressCard)
- usb-serial (2.6) or usbserial (2.4)
- device-specific driver, if available
At this point, if you plug in your device you should see /dev/ttyUSB0 or higher.  If you don't, you are missing a driver or driver option
- pppd
- A chat script (there are dozens of examples out there, comgt does provide one that should work for most people)

(Last edited by aoz.syn on 9 May 2008, 03:53)

I would like to thank you for the interesting information. Now my idea about connection in general and comgt in particular are much more clear.
I will change the howto taking into account your information. Please tell me if anything is wrong.

thanks

kultex

how do I set vid and pid and maxSize in usbserial - when I do

root@OpenWrt:~# usbserial vendor=0x12d1 product=0x1003 maxSize=4096
-ash: usbserial: not found

you need to unload usbserial, try

rmmod usbserial

then load it again with the vendor options , try

insmod usbserial vendor=0x12d1 product=0x1003 maxSize=4096

double check your vendor and product id's by;

lsusb

FWIW, i have the wgt634u with 7.09 and it using those product id's, and loading usbserial as above makes it appear as ttyUSB0, without the maxSize=4096 option, you will be limited to ~400kbps , with it I get 2mbps+ , sometimes to 3.2mbps network allowing :-)

however It disconnects periodically for me , see http://forum.openwrt.org/viewtopic.php?id=15731

(Last edited by AndyWhite on 20 May 2008, 22:26)

Using the Novatel MC950D USB stick for 3.5G, as provided by Vodafone in Germany, there are some additional peculiarities to consider.
This stick upon power-up identifies itself by USB vendor:product 1410:5010 and as such provides a CDROM storage device.
After several minutes (with mine after 7 minutes), when left alone, it switches itself to 1410:4400 which is the HSDPA/HSUPA modem.

Under windows the idea is that some software gets installed from the CDROM and probably that software changes this behaviour.
For use in OpenWrt this behaviour is not desirable. (pity of the flash space that remains unused while operating as a modem)

The switch from CDROM to modem can be forced by issuing an 'eject' command to the CDROM.
Depending on 2.6 or 2.4 linux compile these are solutions to the problem:

in 'make menuconfig' include the utility 'sdparm'. (utilities/disc/sdparm)

Upon connection of the usb stick issue from 'sdparm' the command eject. And gone is the CDROM and there comes the modem ....

2.6:
root@OpenWrt:/# sdparm --command=eject //dev/sg0
    //dev/sg0: Novatel  Mass Storage  1.00  [cd/dvd]

2.4:
root@OpenWrt:/# sdparm --command=eject /dev/scsi/host0/bus0/target0/lun0/generic

Assuming Kamikaze linux 2.4 on the Asus WL400gp v1 (broadcom mini-pci radio) and the presence of sdparm, the following hotplug script will switch the MC950D device to being modem when booting or connecting it:

---------- //etc/hotplug.d/usb/20-novatel_switch ----------
#!/bin/sh

case "$ACTION" in
    add)
        ( //usr/sbin/lsusb | grep -q '1410:5010' ) && {
            /usr/bin/sdparm --command=eject /dev/scsi/host0/bus0/target0/lun0/generic
        }
        ;;
esac

Of course the problem has been encountered before. This link provides code for a series of G3 adapters.
http://www.draisberghof.de/usb_modeswitch/

(Last edited by doddel on 8 Jun 2008, 22:18)

The discussion might have continued from here.