Questions tagged [serial-port]

A serial port is a physical interface through which data is transferred (uni- or bidirectionally) one bit at a time. The term usually refers to the RS-232 port with a 9-pin d-sub connector that was once the standard serial interface on a PC.

A serial port is a physical interface through which data is transferred (uni- or bidirectionally) one bit at a time. The term usually refers to the RS-232 port with a 9-pin d-sub connector that was once the standard serial interface on a PC. Serial port may also refer to the logic-level interface of a UART on a SBC (single board computer). Other types of interfaces that use "serial" transfer (such as USB, SATA, SPI, I2C, and TWI) should not be called "serial port", but by their proper protocol name.

Largely superseded in the consumer market by USB, serial connections are still commonly used in many other specialist applications. Typical applications include scientific/medical instruments, industrial controllers and server diagnostics.

More information:

10746 questions
149
votes
2 answers

How to open, read, and write from serial port in C?

I am a little bit confused about reading and writing to a serial port. I have a USB device in Linux that uses the FTDI USB serial device converter driver. When I plug it in, it creates: /dev/ttyUSB1. I thought itd be simple to open and read/write…
gnychis
  • 6,335
  • 15
  • 69
  • 104
148
votes
8 answers

Virtual Serial Port for Linux

I need to test a serial port application on Linux, however, my test machine only has one serial port. Is there a way to add a virtual serial port to Linux and test my application by emulating a device through a shell or script? Note: I cannot remap…
JeffV
  • 47,302
  • 31
  • 96
  • 120
143
votes
8 answers

Python AttributeError: 'module' object has no attribute 'Serial'

I'm trying to access a serial port with Python 2.6 on my Raspberry Pi running Debian. My script named serial.py tries to import pySerial: import serial ser = serial.Serial('/dev/ttyAMA0', 9600) ser.write("hello world!") For some reason it refuses…
hao_maike
  • 2,546
  • 5
  • 23
  • 30
118
votes
11 answers

Python: Making a beep noise

I'm trying to get the program to give me a beeping noise. I'm on a windows machine. I've looked at http://docs.python.org/library/winsound.html But not sure how I can program this with a barcode scanner. Here is my code for the serial barcode…
Marc Brigham
  • 1,684
  • 5
  • 20
  • 24
116
votes
12 answers

How to find all serial devices (ttyS, ttyUSB, ..) on Linux without opening them?

What is the proper way to get a list of all available serial ports/devices on a Linux system? In other words, when I iterate over all devices in /dev/, how do I tell which ones are serial ports in the classic way, that is, those usually supporting…
Thomas Tempelmann
  • 9,137
  • 6
  • 60
  • 120
105
votes
16 answers

IOException: read failed, socket might closed - Bluetooth on Android 4.3

Currently I am trying to deal with a strange Exception when opening a BluetoothSocket on my Nexus 7 (2012), with Android 4.3 (Build JWR66Y, I guess the second 4.3 update). I have seen some related postings (e.g.…
matthes
  • 2,830
  • 3
  • 13
  • 16
92
votes
1 answer

MacOS: what's the difference between /dev/tty.* and /dev/cu.*?

Each serial device shows up twice in /dev, once as a tty.* and once as a cu.*. What is the cu.* device? How does it differ from the tty.* device? mh@maru ~ --> ls -l /dev/*.usbmodem621 crw-rw-rw- 1 root wheel 11, 5 Dec 25 18:00…
Mark Harrison
  • 267,774
  • 112
  • 308
  • 434
89
votes
6 answers

Faking an RS232 Serial Port

I'm developing a project that has a number of hardware sensors connecting to the deployment machine through RS232 serial ports. But ... I'm developing on a machine without an physical RS232 serial ports, but I would like to make fake serial ports…
83
votes
3 answers

What is the difference between DTR/DSR and RTS/CTS flow control?

What's the difference between DTR/DSR and RTS/CTS hardware flow control? When is each one used? Why do we need more than one kind of hardware flow control? :)
Gili
  • 76,473
  • 85
  • 341
  • 624
71
votes
10 answers

How do I connect to a terminal to a serial-to-USB device on Ubuntu 10.10 (Maverick Meerkat)?

I am trying to connect minicom to a serial device that is connected via a USB-to-serial adapter. This is a PL2303 and from everything I've read no additional drivers are required. The device is recognised as a PL2303. I'm a beginner at minicom. Is…
codingJoe
  • 4,053
  • 9
  • 43
  • 60
62
votes
12 answers

Simple serial point-to-point communication protocol

I need a simple communication protocol between two devices (a PC and a microcontroller). The PC must send some commands and parameters to the micro. The micro must transmit an array of bytes (data from sensor). The data must be noise protected…
Vanuan
  • 25,939
  • 9
  • 90
  • 96
61
votes
9 answers

Sysinternals' Portmon: Error 2

When I try to connect to local ports, Computer -> Connect local, using Portmon v. 3.02, I'm getting an error message, Error 2, in a small error dialog box: I run the tool as an administrator (if not, I get error 6). By the way this is a Windows 7…
JAG
  • 1,661
  • 2
  • 15
  • 21
55
votes
5 answers

How do I get a list of available serial ports in Win32?

I have some legacy code that provides a list of the available COM ports on the PC by calling the EnumPorts() function and then filtering for the port names that start with "COM". For testing purposes it would be very useful if I could use this code…
GrahamS
  • 9,095
  • 7
  • 45
  • 61
54
votes
1 answer

How to send characters in PuTTY serial communication only when pressing enter?

I am trying to use PuTTY to communicate over my computer's serial line. I have configured the correct serial line, baud rate, number of data bits, stop bits, parity, and flow control, and established the connection. When I click OK to open the…
tushark
  • 701
  • 1
  • 7
  • 10
54
votes
7 answers

Stable alternative to RXTX

After using RXTX for a number of different projects, I've come across many annoying discrepancies and issues that can only sensibly be put down to bugs in the library - deadlocks, race hazards, and monitor threads deep in the RXTX library being left…
Michael Berry
  • 61,291
  • 17
  • 134
  • 188
1
2 3
99 100