LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 09-29-2004, 07:25 AM   #1
zaheer031
LQ Newbie
 
Registered: Aug 2004
Posts: 9

Rep: Reputation: 0
Cool Using setserial in lInux


HI,

Pls tell me how to use setserial to set the baud rate of the serial port in lInux.
Man pages not clear.[
 
Old 09-29-2004, 09:53 AM   #2
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
To set the com port speed you can do that with stty

stty -F /dev/ttyS0 115200

To setup the DCE speed of the modem you can use setserial like this..

setserial /dev/ttyS0 spd_hi


There are some oddities involved with setting the speed of a port however that could actually cause the performance to be reduced using a speed that's too high for the line so testing should be done. With setserial what you set is not actually what you get depending on the hardware.

Check this out for a detailed explaination...

http://www.ibiblio.org/pub/Linux/doc...dem-HOWTO.html
 
Old 07-28-2005, 05:57 AM   #3
Daniel49
Member
 
Registered: Jul 2005
Location: Washington
Distribution: fedora core3 soon ubuntu
Posts: 50

Rep: Reputation: 15
this post was helpful to me in that indeed my port was set to 9600 baud.
this is on ubuntu hoary hedgehog

this is an external serial modem hooked up to a usb port by a usb--> serial converter. It is at /dev/ttyUSB0

I was able to reset it by stty -F /dev/ttyS0 115200 command, but it is not saving it on reboot.
any suggestions thanks
dan
 
Old 07-30-2005, 11:06 AM   #4
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
I would add the command string to /etc/rc.local
 
Old 08-01-2005, 12:26 AM   #5
Daniel49
Member
 
Registered: Jul 2005
Location: Washington
Distribution: fedora core3 soon ubuntu
Posts: 50

Rep: Reputation: 15
didn't try that here is what I ended up doing:


Apparently udev hasn't been started at all when this module (usbserial)is loaded. So I deferred setting the baud until the very end of the boot process. there is a file called /etc/init.d/bootmisc.sh , which runs at the very end. You can move the stty statement into /etc/init.d/bootmisc.sh.
so in essence what i did was

sudo gedit /etc/init.d/bootmisc.sh

and added

stty -F /dev/ttyUSB0 115200

at the very end of the sh file just before it exits.
it changes my baud rate from 9600 to 15200 on each boot.
is working much better and faster now.


This is working very well for me and was suggested to me by a friend....thank you very much for responding.
 
Old 08-26-2005, 11:33 PM   #6
bongski55
Member
 
Registered: May 2003
Location: Somewhere in Asia
Distribution: ubuntu on Dell, Vista,XP triple boot
Posts: 276
Blog Entries: 1

Rep: Reputation: 30
I also use a prolific usb to serial converter.How do I set it up to use /dev/ttyS0? It is detected in /dev/ttyusb0
 
Old 08-27-2005, 09:29 AM   #7
Daniel49
Member
 
Registered: Jul 2005
Location: Washington
Distribution: fedora core3 soon ubuntu
Posts: 50

Rep: Reputation: 15
I don't use knoppix so I am not familiar with it but on the internet confiuration I simply manually entered it into the network configuration as /dev/ttyUSB0
because it was not able to automatically detect it in ubuntu so I pointed it to the usb.

if it has detected it at usb0 what is the problem?
I have no idea how to make it see it as a serial port when it is plugged into the usb port am not even sure if you can?
 
Old 08-27-2005, 11:14 AM   #8
bongski55
Member
 
Registered: May 2003
Location: Somewhere in Asia
Distribution: ubuntu on Dell, Vista,XP triple boot
Posts: 276
Blog Entries: 1

Rep: Reputation: 30
the problem is that the serial\modem is not working.when I query the modem in kppp it sort of "detects" the modem but there are no lights that show modem activity when I query.Then I detached the modem form the usb to serial converter and query the modem in kppp-it still detects the modem!
so kppp "sees" the usb to serial converter circuitry as the "modem".
I'm stumped.
BTW,modem and usb converster works perfectly in xp.
 
Old 08-27-2005, 05:37 PM   #9
Daniel49
Member
 
Registered: Jul 2005
Location: Washington
Distribution: fedora core3 soon ubuntu
Posts: 50

Rep: Reputation: 15
ok found a live knoppix cd laying around.

couldn't get it to boot without freezing up on my amd64 but I think it was the usb mouse/keyboard it was choking on.

So booted it up on a 32 bit with ps2 mouse/keyboard.That particular machine has an external serial modem on it.

configured kpp dialer it dials but then refuses to connect. seems to me I have had problems with kpp dialer on the other 2 distros i tried also.

On fedora core 3,
I finally just switched to the gnome desktop and it was a piece of cake.

On ubuntu could not get it to work right either. I use the pppconfig for it and then use poff and pon from a terminal.

So you might check to see if there is another dialer available for knoppix?
Have noticed also on mine that I have to use msn/username
for login as I have msn dialup maybe something similar on yours?

If i just entered username and password it would not validate.
 
Old 08-27-2005, 09:50 PM   #10
bongski55
Member
 
Registered: May 2003
Location: Somewhere in Asia
Distribution: ubuntu on Dell, Vista,XP triple boot
Posts: 276
Blog Entries: 1

Rep: Reputation: 30
Thanks for replying.
Now I use kanotix bughunter.Installed it and I got the touch pad scroll to work.also the usb thumb drive displays its icon on desktop when I plug it in.
forgot to mention that the internal modem works on the laptop(toshiba tecra a3).had to install the driver tho.so the kppp dialer works for me.
I have an old practical peripherals ext modem which I want to work also and at the same time test the usb to serial conv.
 
Old 08-29-2005, 10:03 AM   #11
bongski55
Member
 
Registered: May 2003
Location: Somewhere in Asia
Distribution: ubuntu on Dell, Vista,XP triple boot
Posts: 276
Blog Entries: 1

Rep: Reputation: 30
Talking

Problem solved:

ln -b /dev/ttyUSB0 /dev/modem
 
Old 08-29-2005, 03:05 PM   #12
Daniel49
Member
 
Registered: Jul 2005
Location: Washington
Distribution: fedora core3 soon ubuntu
Posts: 50

Rep: Reputation: 15
cool, what exactly does that string do for you?
 
Old 08-29-2005, 11:15 PM   #13
bongski55
Member
 
Registered: May 2003
Location: Somewhere in Asia
Distribution: ubuntu on Dell, Vista,XP triple boot
Posts: 276
Blog Entries: 1

Rep: Reputation: 30
dmesg shows that the usb-serial conv is in ttyUSB0 so I created a link to /dev/modem to use the modem I connected to the serial side of the converter.Had to google a lot to arrive to this but this is linux so it is all "trial and error".I may have to do the same whenever I connect another serial device.
One of the primary reasons why linux at this stage will never be a "mainstream" OS.

Last edited by bongski55; 08-29-2005 at 11:18 PM.
 
Old 10-22-2009, 05:32 PM   #14
jpiel
LQ Newbie
 
Registered: Feb 2003
Location: North of Chicago
Distribution: Arch Linux, on over a dozen machines, some with over 840 days of uptime
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by bongski55 View Post
... this is linux so it is all "trial and error".I may have to do the same whenever I connect another serial device.
One of the primary reasons why linux at this stage will never be a "mainstream" OS.
Yes, it certainly could not be your lack of understanding, it's purely the fault of the kernel...
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
setserial warrant6767 Mandriva 1 06-29-2004 08:01 PM
setserial ziox Linux - General 2 05-07-2004 05:59 PM
Setserial SMACK Mandriva 1 09-20-2003 02:35 PM
setserial command BDW Linux - Newbie 1 07-01-2003 04:03 PM
setserial ErnstVikenstein Linux - General 9 05-24-2003 07:14 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration