Configuring serial port

M

Mike Kelly

I hadn't thought of using perl for this, but I saw a mention on a web
site that someone used a trivial little perl program to set the
parameters on a serial port for barcode scanner input...

What I need to do is set the baud rate, parity, and start and stop
bits so I can talk to a change machine, which is a pretty primitive
device, and wants 9600,7,e,1

Frankly, I don't care whether I use perl or not, but in an hour of
googling and searching various linux sites I haven't come across the
right combination of terms to find an appropriate command line... so ,
whether it's perl or something else... if you can point me in the
right direction, I'd appreciate it.
 
J

Jacob Heider

I hadn't thought of using perl for this, but I saw a mention on a web
site that someone used a trivial little perl program to set the
parameters on a serial port for barcode scanner input...

What I need to do is set the baud rate, parity, and start and stop
bits so I can talk to a change machine, which is a pretty primitive
device, and wants 9600,7,e,1

Frankly, I don't care whether I use perl or not, but in an hour of
googling and searching various linux sites I haven't come across the
right combination of terms to find an appropriate command line... so ,
whether it's perl or something else... if you can point me in the
right direction, I'd appreciate it.

This isn't a perl answer, but the canonical way to deal with the serial
port under linux is 'setserial'. If it's not installed (I don't know
what you're running), you should be able to find it.

GL
Jacob
 
A

Anno Siegel

Mike Kelly said:
I hadn't thought of using perl for this, but I saw a mention on a web
site that someone used a trivial little perl program to set the
parameters on a serial port for barcode scanner input...

What I need to do is set the baud rate, parity, and start and stop
bits so I can talk to a change machine, which is a pretty primitive
device, and wants 9600,7,e,1

Frankly, I don't care whether I use perl or not, but in an hour of
googling and searching various linux sites I haven't come across the
right combination of terms to find an appropriate command line... so ,
whether it's perl or something else... if you can point me in the
right direction, I'd appreciate it.

By a remarkable coincidence just last week I happened to set a serial
port to 9600,7,e,1 to communicate with a barcode scanner.

I used POSIX::Termios. The code is on a machine I can't reach at the
moment. If you have problems applying Termios, mail me or post again.

Anno
 
D

David Efflandt

I hadn't thought of using perl for this, but I saw a mention on a web
site that someone used a trivial little perl program to set the
parameters on a serial port for barcode scanner input...

What I need to do is set the baud rate, parity, and start and stop
bits so I can talk to a change machine, which is a pretty primitive
device, and wants 9600,7,e,1

Frankly, I don't care whether I use perl or not, but in an hour of
googling and searching various linux sites I haven't come across the
right combination of terms to find an appropriate command line... so ,
whether it's perl or something else... if you can point me in the
right direction, I'd appreciate it.

The Perl Device::SerialPort module is a Linux/Unix port of
Win32::SerialPort. I have used the former to chat AT codes with a modem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top