LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Laptop and Netbook (http://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/)
-   -   How to find COMPORT numbers in linux (http://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/how-to-find-comport-numbers-in-linux-4175431291/)

nHulk 10-09-2012 04:49 AM

How to find COMPORT numbers in linux
 
i am using ubuntu 11.04, have connected an dongle to it,i am trying to find the comport no to which dongle is connected ,As in windows i get com23,com24 etc .how can i get it in linux ?

michaelk 10-09-2012 05:10 AM

What do you mean by dongle?
Post the output of the console command lspci.

A USB serial port adapter will be /dev/ttyUSB0 if it is recognised.

nHulk 10-09-2012 05:19 AM

$ lsusb
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 003: ID 15d9:0a4c Trust International B.V.
Bus 003 Device 002: ID 08ff:2580 AuthenTec, Inc. AES2501 Fingerprint Sensor
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 005: ID 12d1:1436 Huawei Technologies Co., Ltd.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub



dongel is airtel 3g stick from which i can access internet

i need to use port no in my project ....plz help me to find port no

private static String port = " "; //Modem Port.
private static int bitRate = 115200; //this is also optional. leave as it is.
private static String modemName = "ZTE"; //this is optional.
private static String modemPin = "0000"; //Pin code if any have assigned to the modem.
private static String SMSC = ""; //Message Center Number ex. Mobitel

nHulk 10-09-2012 05:35 AM

How to COMPORT numbers in linux
 
reply me plz

nHulk 10-09-2012 05:45 AM

help
 
Quote:

Originally Posted by michaelk (Post 4801128)
What do you mean by dongle?
Post the output of the console command lspci.

A USB serial port adapter will be /dev/ttyUSB0 if it is recognised.

reply me, even after using /dev/ttyUSB0 its throwing NoSuchPortException

pan64 10-09-2012 05:55 AM

do you really have com ports? What kind of dongle is it?

nHulk 10-09-2012 05:57 AM

Quote:

Originally Posted by pan64 (Post 4801152)
why did you post it several times?


sorry !! as i am new here ,

nHulk 10-09-2012 06:01 AM

How to COMPORT numbers in linux
 
Quote:

Originally Posted by pan64 (Post 4801152)
do you really have com ports? What kind of dongle is it?

Sir, its airtel 3g stick from which i can access internet,


in windows i get as COM21.COM23 etc but what is used in Linux to indicate that

pan64 10-09-2012 06:06 AM

can you follow this description? http://vinay.gvc.in/2011/03/my-first...ith-linux.html

michaelk 10-09-2012 06:10 AM

As I understand this device requires usb_modeswitch so that it can be recognised as a modem device. What distribution are you running? No experience using a 3G MODEM so hopefully others will chime in.

http://www.draisberghof.de/usb_modeswitch/

nHulk 10-09-2012 06:51 AM

Quote:

Originally Posted by michaelk (Post 4801159)
As I understand this device requires usb_modeswitch so that it can be recognised as a modem device. What distribution are you running? No experience using a 3G MODEM so hopefully others will chime in.

http://www.draisberghof.de/usb_modeswitch/


http://www.harshadura.net/2011/10/si...with-your.html

i am implementing this in my project....but not able to get portno.... its easily working in windows 7 but in linux i am facing problem

Wim Sturkenboom 10-09-2012 10:52 AM

This is what I get running dmesg after I inserted a 3G dongle.

Code:

wim@i3-2120:~$ dmesg
[ 1543.610989] usb 2-1.4.4.4: new high-speed USB device number 9 using ehci_hcd
[ 1543.742011] Initializing USB Mass Storage driver...
[ 1543.742144] scsi6 : usb-storage 2-1.4.4.4:1.0
[ 1543.742233] usbcore: registered new interface driver usb-storage
[ 1543.742235] USB Mass Storage support registered.
[ 1543.820666] usbcore: registered new interface driver uas
[ 1544.746480] scsi 6:0:0:0: CD-ROM            Vodafone CD ROM (Huawei)  2.31 PQ: 0 ANSI: 2
[ 1544.753785] sr1: scsi-1 drive
[ 1544.753924] sr 6:0:0:0: Attached scsi CD-ROM sr1
[ 1544.754724] sr 6:0:0:0: Attached scsi generic sg4 type 5
[ 1545.198543] usb 2-1.4.4.4: USB disconnect, device number 9
[ 1549.494918] usb 2-1.4.4.4: new high-speed USB device number 10 using ehci_hcd
[ 1549.592931] scsi7 : usb-storage 2-1.4.4.4:1.5
[ 1549.593216] scsi8 : usb-storage 2-1.4.4.4:1.6
[ 1549.633520] usbcore: registered new interface driver usbserial
[ 1549.633533] USB Serial support registered for generic
[ 1549.633842] usbcore: registered new interface driver usbserial_generic
[ 1549.633845] usbserial: USB Serial Driver core
[ 1549.659399] USB Serial support registered for GSM modem (1-port)
[ 1549.659479] option 2-1.4.4.4:1.0: GSM modem (1-port) converter detected
[ 1549.659591] usb 2-1.4.4.4: GSM modem (1-port) converter now attached to ttyUSB0
[ 1549.659631] option 2-1.4.4.4:1.3: GSM modem (1-port) converter detected
[ 1549.659689] usb 2-1.4.4.4: GSM modem (1-port) converter now attached to ttyUSB1
[ 1549.659702] option 2-1.4.4.4:1.4: GSM modem (1-port) converter detected
[ 1549.659745] usb 2-1.4.4.4: GSM modem (1-port) converter now attached to ttyUSB2
[ 1549.659770] usbcore: registered new interface driver option
[ 1549.659772] option: v0.7.2:USB Driver for GSM modems
[ 1549.692194] cdc_ether 2-1.4.4.4:1.1: wwan0: register 'cdc_ether' at usb-0000:00:1d.0-1.4.4.4, Mobile Broadband Network Device, 02:50:f3:00:00:00
[ 1549.692216] usbcore: registered new interface driver cdc_ether
[ 1550.592089] scsi 7:0:0:0: CD-ROM            Vodafone CD ROM (Huawei)  2.31 PQ: 0 ANSI: 2
[ 1550.593030] scsi 8:0:0:0: Direct-Access    Vodafone Storage (Huawei) 2.31 PQ: 0 ANSI: 2
[ 1550.596101] sr1: scsi-1 drive
[ 1550.596314] sr 7:0:0:0: Attached scsi CD-ROM sr1
[ 1550.596450] sr 7:0:0:0: Attached scsi generic sg4 type 5
[ 1550.596856] sd 8:0:0:0: Attached scsi generic sg5 type 0
[ 1550.600744] sd 8:0:0:0: [sdd] Attached SCSI removable disk

It should be one of the red ones, I guess. So run dmesg on your system would be mu suggestion.

And you have seen the remark on the page you linked to about disconnecting from the internet before using the code?

NOTE:
this is probably not exactly the same device as yours !

JaseP 10-15-2012 02:14 PM

Your airtel is most likely this one:

Bus 001 Device 005: ID 12d1:1436 Huawei Technologies Co., Ltd.

For how to get it working, see here...
http://ubuntuforums.org/showthread.php?t=1996734

Note that udev maps devices all over the place, especially serial ports,... so you can have your modem plugged into the first USB port, and this time it'll be /dev/ttyUSB0,... but next time it could be /dev/ttyUSB1 ... No rhyme or reason... The Roman Catholic Church has the mysteries of faith,... Linux users have udev. Udev rules help tidy it up.

To determine the details of the ACTUAL physical device you'd be looking at the /proc system... Which is part of what lsusb does... In the above case, bus 1, assigned as device 5.


All times are GMT -5. The time now is 10:10 PM.