LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 10-09-2012, 04:49 AM   #1
nHulk
LQ Newbie
 
Registered: Oct 2012
Posts: 9

Rep: Reputation: Disabled
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 ?
 
Old 10-09-2012, 05:10 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,592

Rep: Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880
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.
 
Old 10-09-2012, 05:19 AM   #3
nHulk
LQ Newbie
 
Registered: Oct 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
$ 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

Last edited by nHulk; 10-09-2012 at 05:34 AM.
 
Old 10-09-2012, 05:35 AM   #4
nHulk
LQ Newbie
 
Registered: Oct 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
How to COMPORT numbers in linux

reply me plz

Last edited by nHulk; 10-09-2012 at 05:39 AM.
 
Old 10-09-2012, 05:45 AM   #5
nHulk
LQ Newbie
 
Registered: Oct 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
help

Quote:
Originally Posted by michaelk View Post
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

Last edited by nHulk; 10-09-2012 at 05:50 AM.
 
Old 10-09-2012, 05:55 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,686

Rep: Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274
do you really have com ports? What kind of dongle is it?

Last edited by pan64; 10-09-2012 at 05:57 AM.
 
Old 10-09-2012, 05:57 AM   #7
nHulk
LQ Newbie
 
Registered: Oct 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
why did you post it several times?

sorry !! as i am new here ,
 
Old 10-09-2012, 06:01 AM   #8
nHulk
LQ Newbie
 
Registered: Oct 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
How to COMPORT numbers in linux

Quote:
Originally Posted by pan64 View Post
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

Last edited by nHulk; 10-09-2012 at 06:04 AM.
 
Old 10-09-2012, 06:06 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,686

Rep: Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274
can you follow this description? http://vinay.gvc.in/2011/03/my-first...ith-linux.html
 
Old 10-09-2012, 06:10 AM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,592

Rep: Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880
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/
 
Old 10-09-2012, 06:51 AM   #11
nHulk
LQ Newbie
 
Registered: Oct 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
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
 
Old 10-09-2012, 10:52 AM   #12
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
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 !

Last edited by Wim Sturkenboom; 10-09-2012 at 11:10 AM.
 
Old 10-15-2012, 02:14 PM   #13
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 18.04-14.04, Scientific Linux 6.3-6.4, Android-x86, Pretty much all distros at one point...
Posts: 1,802

Rep: Reputation: 157Reputation: 157
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
opening a comport in linux batman4 Programming 4 09-24-2012 09:12 AM
how to find the 1 number out of 10 numbers, if I have taken 9 numbers from my brain ? rpittala Linux - Newbie 4 01-30-2012 05:40 PM
[SOLVED] find the total of numbers that are higher than x in a text file with numbers (using awk??) Mike_V Programming 12 11-24-2010 09:51 AM
Where can i find major and minor numbers yugandhar Linux - Software 1 06-02-2006 03:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 06:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration