You are on page 1of 46

pySerial Documentation

Release 2.6

Chris Liechti

December 08, 2011

CONTENTS

1

pySerial 1.1 Overview . . . 1.2 Features . . . . 1.3 Requirements . 1.4 Installation . . 1.5 References . . 1.6 Older Versions

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

3 3 3 4 4 5 5 7 7 7 8 8 9 9 10 11 12 13 13 13 15 15 23 23 24 26 29 29 30 30 30 31 33 33 33 i

2

Short introduction 2.1 Opening serial ports . 2.2 Configuring ports later 2.3 Readline . . . . . . . 2.4 Testing ports . . . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

3

Examples 3.1 Miniterm . . . . . . . . . . . . . . . . . . . . 3.2 TCP/IP - serial bridge . . . . . . . . . . . . . 3.3 Single-port TCP/IP - serial bridge (RFC 2217) 3.4 Multi-port TCP/IP - serial bridge (RFC 2217) . 3.5 wxPython examples . . . . . . . . . . . . . . 3.6 Wrapper class . . . . . . . . . . . . . . . . . 3.7 Unit tests . . . . . . . . . . . . . . . . . . . . pySerial API 4.1 Classes . . . . . . . . . . . . . 4.2 Exceptions . . . . . . . . . . . 4.3 Constants . . . . . . . . . . . . 4.4 Module functions and attributes 4.5 Tools . . . . . . . . . . . . . . pyParallel 5.1 Overview . . . . . 5.2 Short introduction 5.3 API . . . . . . . . 5.4 Notes . . . . . . . 5.5 Misc . . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

4

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

5

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

6

Appendix 6.1 How To . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6.3 6.4 7

Related software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

34 34 37 39 41

Indices and tables

Python Module Index Index

ii

It provides backends for Python running on Windows.pySerial Documentation. when viewed online. Other pages (online) • project page on SourceForge • SVN repository • Download Page with releases • This page. is at http://pyserial. The module named “serial” automatically selects the appropriate backend.NET and Mono).net. Jython and IronPython (.sf. Release 2.6 This module encapsulates the access for the serial port. BSD (possibly any POSIX compliant system). Contents: CONTENTS 1 . Linux.

6 2 CONTENTS .pySerial Documentation. Release 2.

CHAPTER ONE PYSERIAL 1. It is released under a free software license. • Working with or without receive timeout. • Support for different byte sizes. • Compatible with io library (Python 2. BSD (possibly any POSIX compliant system). Jython and IronPython (.sf. when viewed online is at http://pyserial. It provides backends for Python running on Windows.net.1 Overview This module encapsulates the access for the serial port. 3 . (which are many times enabled for POSIX. stop bits. No NULL byte stripping. Linux. • Access to the port settings through Python properties. see LICENSE for more details.6+) • RFC 2217 client (experimental). Copyright (C) 2001-2010 Chris Liechti <cliechti(at)gmx. 1. CR-LF translation etc. • The port is set up for binary transmission. also supported). • The files in this package are 100% pure Python. • File like API with “read” and “write” (“readline” etc.) This makes this module universally useful.net> Other pages (online) • project page on SourceForge • SVN repository • Download Page with releases • This page.NET and Mono). parity and flow control with RTS/CTS and/or Xon/Xoff. server provided in the examples. The module named “serial” automatically selects the appropriate backend.2 Features • Same class based interface on all supported platforms.

gz or checkout) Download the archive from http://pypi. To install the module for all users on the system. Release 2. pySerial . enter the pyserial-x.python. Note that some distributions package an older version of pySerial. It is located in the PyPi. including Python 3. administrator rights (root) is required.y directory and run: python setup. either manually downloading the files and installing as described above or using: pip pyserial or: easy_install -U pyserial Packages There are also packaged versions for some Linux distributions and Windows: Debian/Ubuntu A package is available under the name “python-serial”.x: python3 setup.py install For Python 3.3 Requirements • Python 2.1 pyserial This installs a package that can be used from Python (import serial).pySerial Documentation. because it contains examples and the readme.5+) • “Java Communications” (JavaComm) or compatible extension for Java/Jython 1.3 or newer. Developers may be interested to get the source archive. Unpack the archive.4 Installation 1.py install From PyPI Alternatively it can be installed from PyPI.. Windows There is also a Windows installer for end users.org/pypi/pyserial. 4 Chapter 1.x • ctypes extensions on Windows (is in standard library since Python 2.4.6 1. From source (tar.

codeplex.org/ • Jython: http://www.sun.ibm.org/ • Java@IBM: http://www-106.0 on Windows. MacOSX and Jython.python.com/DevCenter/setuptools 1. References 5 . Linux and several un*x like systems.5 will depend on pywin32 (previously known as win32all) 1. Release 2. On windows releases older than 2.21 is compatible with Python 2.5 References • Python: http://www.jython.5.pySerial Documentation.6 Older Versions Older versions are still available on the Download Page.telecommunity.com/IronPython • setuptools: http://peak.com/developerworks/java/jdk/ (JavaComm links are on the download page for the respective platform JDK) • Java@SUN: http://java.com/products/ • IronPython: http://www. pySerial 1.6 1.

6 6 Chapter 1.pySerial Documentation. Release 2. pySerial .

read(10) # read up to ten bytes (timeout) line = ser..close() # # # # open first serial port check which port was really used write a string close port Open named port at “19200. 1s timeout: >>> >>> >>> >>> >>> ser = serial.close() >>> ser. bytesize=8.isOpen() False 7 .E.close() Open second port at “38400.readline() # read a ’\n’ terminated line ser.baudrate = 19200 >>> ser.CHAPTER TWO SHORT INTRODUCTION 2. parity=serial. timeout=1) x = ser.1 Opening serial ports Open port 0 at “9600.8.Serial(0) print ser.read(100) # read up to one hundred bytes .read() # read one byte s = ser.Serial(1.Serial() >>> ser.1”. open=False>(port=’COM1’.open() >>> ser.. 38400. non blocking HW handshaking: >>> ser = serial. rtscts=1) >>> s = ser..PARITY_EVEN. # or as much is in the buffer 2. time >>> ser.8.portstr ser.1”. no timeout: >>> >>> >>> >>> >>> import serial ser = serial.1”. . timeout=0.isOpen() True >>> ser..N.write("hello") ser.N.2 Configuring ports later Get a Serial instance and configure/open it later: >>> ser = serial. parity=’N’. stopbits=1.port = 0 >>> ser Serial<id=0xa81c10.Serial(’/dev/ttyS1’.8. baudrate=19200. 19200.

3.2 Accessing ports pySerial includes a small terminal console based terminal program called Miniterm. Do also have a look at the example files in the examples directory in the source distribution or online. 2.BufferedRWPair(ser.list_ports will print a list of available ports. 2. Do specify a timeout when opening the serial port otherwise it could block forever if no newline character is received. It raises an exception if the port is not opened correctly.tools.6 2. it is advised to use io.pySerial Documentation. It may be incomplete.4 Testing ports 2. ser)) sio. It ca be started with python -m serial.TextIOWrapper(io. list unavailable ports or may lack detailed descriptions of the ports.miniterm <port name> (use option -h to get a listing of all options).serial_for_url(’loop://’. required to get the data out *now* hello = sio.4. Note: The eol parameter for readline() is no longer supported when pySerial is run with newer Python versions (V2. It is also possible to add a regexp as first argument and the list will only include entries that matched. Also note that readlines() only works with a timeout. Note: The enumeration may not work on all operating systems. timeout=1) sio = io. Short introduction . 8 Chapter 2.write(unicode("hello\n")) sio.6+) where the module io is available.flush() # it is buffering.1 EOL To specify the EOL character for readline() or to use universal newline mode. Release 2. readlines() depends on having a timeout and interprets that as EOF (end of file).1 Listing ports python -m serial.readline() print hello == unicode("hello\n") 2.tools.4.3 Readline Be carefully when using readline().TextIOWrapper: import serial import io ser = serial.

newlines too 3: hex dump everything --rts=RTS_STATE set initial RTS line state (possible values: 0.sys is loaded it supports some escapes. one of [N. Command line options python -m serial. When ANSI. send CR only --lf do not send CR+LF. However it inherits these features from the terminal it is run.py [options] [port [baudrate]] Miniterm . a number (default 0) or a device name (deprecated option) -b BAUDRATE. --quiet suppress non error messages 9 . For example on GNU/Linux running from an xterm it will support the escape sequences of the xterm. 1) --dtr=DTR_STATE set initial DTR line state (possible values: 0. S.miniterm -h: Usage: miniterm. Miniterm supports RFC 2217 remote serial ports and raw sockets using URLs such as rfc2217:://<host>:<port> respectively socket://<host>:<port> as port argument when invoking. M]. send LF only -D.CHAPTER THREE EXAMPLES 3. default=N -e. Options: -h. do newlines as unusual 2: escape non-printable characters. On Windows the typical console window is dumb and does not support any escapes. --port=PORT show this help message and exit port. --baud=BAUDRATE set baud rate. --debug debug received data (escape non-printable chars) --debug can be given multiple times: 0: just print what is received 1: escape non-printable characters.Miniterm on /dev/ttyS0: 9600.A simple terminal program for the serial port.1 Miniterm This is a console application that provides a small terminal application. E.N.Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- Command line options can be given so that binary data including escapes for terminals are escaped or output as hex. Miniterm: --. --help -p PORT. default 9600 --parity=PARITY set parity. --echo enable local echo (default off) --rtscts enable RTS/CTS flow control (default off) --xonxoff enable software flow control (default off) --cr do not send CR+LF.tools.8.1 ----. O. Miniterm itself does not implement any terminal features such as VT102 compatibility. 1) -q.

This example only exports a raw socket connection. with telnet) it forwards all data to the serial port and vice versa. When a connection is made to that port (e. setup-miniterm-py2exe.5) change baud rate disable/enable software flow control disable/enable hardware flow control Changed in version 2. Mark) set stop bits (1.Changed in version 2. miniterm. 10 Chapter 3. Release 2. Examples .exe. followed by: Send the menu character itself to remote Send the exit character to remote Show info Upload file (prompt will be shown) RTS DTR line feed Ctrl+E Ctrl+B Ctrl+A local echo BREAK Cycle repr mode (Ctrl+T followed by the following): change port set data bits change parity (None.5: Added Ctrl+T menu and added support for opening URLs.tools. It can be used to create a standalone miniterm.help Ctrl+] Exit Ctrl+T Menu Menu keys: Ctrl+T Ctrl+] Ctrl+I Ctrl+U Toggles: Ctrl+R Ctrl+D Ctrl+L Port settings p 7 8 n e o s m 1 2 3 b x X r R program escape key. The next example below gives the client much more control over the remote serial port.py [options] [port [baudrate]] Simple Serial to Network (TCP/IP) redirector.serial bridge This program opens a TCP/IP port.pySerial Documentation.py This is a py2exe setup script for Windows.g. Even. • All data is passed through as-is. Odd. Typing Ctrl+T Ctrl+H when it is running shows the help text: --------------------------------------------pySerial . 1.2 TCP/IP .6 --exit-char=EXIT_CHAR ASCII code of special character that is used to exit the application --menu-char=MENU_CHAR ASCII code of special character that is used to control miniterm (menu) Miniterm supports some control functions.6: File moved from the examples to serial. • The serial port settings are set on the command line when starting the program. Usage: tcp_serial_redirect. Space. 2.miniterm . • There is no possibility to change settings from remote.miniterm.py The miniterm program. 3.

When the connection is terminated it waits for the next connect.serial bridge (RFC 2217) 11 . --port=PORT port. --localport=LOCAL_PORT local TCP port --rfc2217 allow control commands with Telnet extension RFC-2217 Newline Settings: Convert newlines between network and serial port.6 Options: -h. tcp_serial_redirect. --quiet --spy show this help message and exit suppress non error messages peek at the communication and print all data to the console Serial Port: Serial port settings -p PORT. --baud=BAUDRATE set baud rate. 3. --help -q. 1) --dtr=DTR_STATE set initial DTR line state (possible values: 0. Windows. • RTS/DTR are activated on client connect and deactivated on disconnect.pySerial Documentation. • Telnet negotiation commands are sent when connecting to the server. 1) Network settings: Network configuration.3. E. Release 2. It uses threads and is portable (runs on POSIX.3 Single-port TCP/IP . O].py Main program. --convert enable newline conversion (default off) --net-nl=NET_NEWLINE type of newlines that are expected on the network (default: LF) --ser-nl=SER_NEWLINE type of newlines that are expected on the serial port (default: CR+LF) NOTE: no security measures are implemented. • The port settings and control lines (RTS/DTR) can be changed at any time using RFC 2217 requests. Anyone can remotely connect to this service over the network. etc).serial bridge (RFC 2217) Simple cross platform RFC 2217 serial port server. IAC followed by an other value is interpreted as Telnet command sequence. Conversion is normally disabled and can be enabled by --convert. default=N --rtscts enable RTS/CTS flow control (default off) --xonxoff enable software flow control (default off) --rts=RTS_STATE set initial RTS line state (possible values: 0. The status lines (DSR/CTS/RI/CD) are polled every second and notifications are sent to the client. -P LOCAL_PORT. Only one connection at once is supported. one of [N. -c. a number (default 0) or a device name -b BAUDRATE. 3. • Telnet character IAC (0xff) needs to be doubled in data stream. Single-port TCP/IP . default: 9600 --parity=PARITY set parity.

e. Service name: _serial_port. --help show this help message and exit -p LOCAL_PORT.exe.5) Installation as daemon: • Copy the script port_publisher.d.g. • Send zeroconf announcements when port appears or disappears (uses python-avahi and dbus). • Copy the script port_publisher. Examples .py to /usr/local/bin. use the poll_modem option in the URL when using a pySerial client.5..py This is a py2exe setup script for Windows.8.pySerial Documentation.. Only one connection at once is supported. Options: -h. It can be used to create a standalone rfc2217_server. • Full control over the serial port with RFC 2217. It uses select. e. 12 Chapter 3.py [options] port RFC 2217 Serial to Network (TCP/IP) redirector. • The script can be started as daemon. This is done every 5 seconds using os. Release 2. • modem status lines (CTS/DSR/RI/CD) are not polled periodically and the server therefore does not send NOTIFY_MODEMSTATE on its own. rfc2217_server.path. --localport=LOCAL_PORT local TCP port NOTE: no security measures are implemented.sh to /etc/init. • Check existence of /tty/USB0.) Requirements: • Python (>= 2. no threads. setup-rfc2217_server-py2exe. New in version 2. /dev/ttyUSB0 is reachable at <host>:7000.4 Multi-port TCP/IP .6 • Default port settings are set again when client disconnects. • Logging to stdout or when run as daemon to syslog. • Default port settings are set again when client disconnects. for the serial ports and the network sockets and therefore runs on POSIX systems only.serial bridge (RFC 2217) This example implements a TCP/IP to serial port service that works with multiple ports at once. • Single process for all ports and sockets (not per port). • Each serial port becomes available as one TCP/IP server. Usage: rfc2217_server._tcp. Anyone can remotely connect to this service over the network.4) • python-avahi • python-dbus • python-serial (>= 2.exists. However it responds to request from the client (i. 3.py Main program. When the connection is terminated it waits for the next connect.

wxg The wxGlade design file for the configuration dialog. test_readline.6 • Add links to the runlevels using update-rc. Release 2. They all need a loop back connector.py Tests involving readline.py A class with alternative readline() implementation.pySerial Documentation.d port_publisher.d script. test_high_load.py Multi-port TCP/IP-serial converter (RFC 2217) for POSIX environments. port_publisher. test.6 and newer. run_all_tests. By default.5: new example port_publisher.py Test more advanced features (properties). Only available for Python 2.sh start as root. The unit tests are performed on port 0 unless a different device name or rfc2217:// URL is given on the command line (argv[1]). 3.5 wxPython examples A simple terminal application for wxPython and a flexible serial port configuration dialog are shown here. the loop:// device is used. The scripts itself contain more information. test_iolib. timeout. wxTerminal.py Tests involving the io library. wxTerminal. Alternatively run invoke-rc.sh Example init.wxg A wxGlade design file for the terminal application.py A simple terminal application.py A flexible serial port configuration dialog. control lines). 3.6 Wrapper class This example provides a subclass based on Serial that has an alternative implementation of readline() enhancedserial.sh defaults 99 • Thats it :-) the service will be started on next reboot.py Tests involving the URL feature. port_publisher.py Collect all tests from all test* files and run them.py Tests involving sending a lot of data. Note that the length of the buffer is limited by wx and it may suddenly stop displaying new input.5. test_url. test_advanced. All test scripts are contained in the directory test. wxSerialConfigDialog. wxPython examples 13 . wxSerialConfigDialog. New in version 2. setup-wxTerminal-py2exe. 3.d 3.py A py2exe setup script to package the terminal application.7 Unit tests The project uses a number of unit test to verify the functionality.py Basic tests (binary capabilities.

pySerial Documentation. Release 2. Examples .6 14 Chapter 3.

rtscts=False. 15 . baudrate=9600. The port is immediately opened on object creation. None to disable (default). • bytesize – Number of data bits. SIXBITS. • baudrate – Baud rate such as 9600 or 115200 etc. baud rate. interCharTimeout=None) Parameters • port – Device name or port number number or None. PARITY_EVEN. Possible values: FIVEBITS.1 Classes 4. writeTimeout=None. Raises • ValueError – Will be raised when parameter are out of range.1 Native ports class serial. PARITY_SPACE • stopbits – Number of stop bits. • xonxoff – Enable software flow control. stopbits=STOPBITS_ONE. • rtscts – Enable hardware (RTS/CTS) flow control.1. • writeTimeout – Set a write timeout value. SEVENBITS. e. Possible STOPBITS_ONE_POINT_FIVE. Possible values for the parameter port: values: STOPBITS_ONE. bytesize=EIGHTBITS. data bits. STOPBITS_TWO • timeout – Set a read timeout value. PARITY_ODD PARITY_MARK. parity=PARITY_NONE. • dsrdtr – Enable hardware (DSR/DTR) flow control. Possible values: PARITY_NONE.CHAPTER FOUR PYSERIAL API 4. • interCharTimeout – Inter-character timeout. It is not opened when port is None and a successive call to open() will be needed. when a port is given. xonxoff=False. timeout=None.g. dsrdtr=False. EIGHTBITS • parity – Enable parity checking. • SerialException – In case the device can not be found or can not be configured.Serial __init__(port=None.

Setting it to None has the effect that its state follows rtscts.g. /dev/ttyUSB0 on GNU/Linux or COM3 on Windows. 150. unless writeTimeout is set. 300. read(size=1) Parameters size – Number of bytes to read. close port when serial port instance is freed.6 and newer) and str otherwise. 600. 1200. These are well supported on all platforms. 200. MAC OSX >= Tiger.5: dsrdtr now defaults to False (instead of None) open() Open port. __del__() Destructor. Write the string data to the port. e. 57600. pySerial API . write(data) Parameters data – Data to send. not both. 921600.5: Returns an instance of bytes when available (Python 2. dsrdtr is not supported by all platforms (silently ignored). Standard values above 115200 such as: 230400. 134. 576000. Read size bytes from the serial port. The parameter baudrate can be one of the standard values: 50. Raises SerialTimeoutException In case a write timeout is configured for the port and the time is exceeded. 1800. 500000. Release 2. Changed in version 2. It is common to use one of the methods at once.Changed in version 2. Non-standard values are also supported on some platforms (GNU/Linux. 2000000. Possible values for the parameter timeout: •timeout = None: wait forever •timeout = 0: non-blocking mode (return immediately on read) •timeout = x: set timeout to x seconds (float allowed) Writes are blocking by default. 19200. 115200. Note that enabling both flow control methods (xonxoff and rtscts) together may not be supported. 460800. If a timeout is set it may return less characters as requested. even on these platforms some serial ports may reject non-standard values. 16 Chapter 4. 4800. Returns Number of bytes written. 3000000. 75. 110. 2400. numbering starts at zero.5: Write returned None in previous versions. 1500000. close() Close port immediately. Windows). 38400.6 and newer) and str otherwise. 1000000. 1152000. Changed in version 2. Changed in version 2. 9600. Though.5: Accepts instances of bytes and bytearray when available (Python 2. The following methods may raise ValueError when applied to a closed port. 4000000 also work on many platforms. For possible values refer to the list for timeout above.pySerial Documentation. Also consider using the function serial_for_url() instead of creating Serial instances directly. •Device name: depending on operating system. 3500000. 2500000. Returns Bytes read from the port. With no timeout it will block until the requested number of bytes is read.6 •Number: number of device.

setRTS(level=True) Parameters level – Set control line to logic level.6 inWaiting() Return the number of chars in the receive buffer.5. Set break: Controls TXD. flush() Flush of file like objects.pySerial Documentation.25) Parameters duration – Time (float) to activate the BREAK condition. wait until all data is written. flushOutput() Clear output buffer. discarding all it’s contents. This is always the device name even if the port was opened by a number. getRI() Returns Current state (boolean) Return the state of the RI line. sendBreak(duration=0. In this case. Set RTS line to specified logic level. aborting the current output and discarding all that is in the buffer. Release 2. Timed. New in version 2. getDSR() Returns Current state (boolean) Return the state of the DSR line. Set DTR line to specified logic level. Send break condition. returns to idle state after given duration. (Read Only). When active. getCD() Returns Current state (boolean) Return the state of the CD line Read-only attributes: name Device name.1. setBreak(level=True) Parameters level – when true activate BREAK condition. no transmitting is possible. flushInput() Flush input buffer. setDTR(level=True) Parameters level – Set control line to logic level. Classes 17 . getCTS() Returns Current state (boolean) Return the state of the CTS line. portstr Deprecated use name instead 4. else disable.

the port will be reconfigured. readable() Returns True New in version 2. interCharTimeout Read or write current inter character timeout setting. parity Read or write current parity setting. even if it’s opened at that time: port Read or write port. writeTimeout Read or write current write timeout setting.5. writable() Returns True New in version 2. STOPBITS A list of valid stop bit widths for the device (Read Only). The following methods are for compatibility with the io library. Release 2.5.pySerial Documentation.6 New values can be assigned to the following attributes (properties). PARITIES A list of valid parities for the device (Read Only). it will be closed and reopened with the new setting. timeout Read or write current read timeout setting. The following constants are also provided: BAUDRATES A list of valid baud rates. (Read Only). When the port is already open. The list may be incomplete such that higher baud rates may be supported by the device and that values in between the standard baud rates are supported. rtscts Read or write current hardware flow control setting. seekable() 18 Chapter 4. BYTESIZES A list of valid byte sizes for the device (Read Only). baudrate Read or write current baud rate setting. stopbits Read or write current stop bit width setting. bytesize Read or write current data byte size setting. dsrdtr Read or write current hardware flow control setting. xonxoff Read or write current software flow control rate setting. pySerial API .

Note that control lines (RTS/DTR) are not changed.6 and newer). For all others from FileLike.1. Release 2. Warning: Programs using the following methods are not portable to other platforms! nonblocking() Platform Unix Configure the device for nonblocking operation. Note: For systems that provide the io library (Python 2. applySettingsDict(d) Parameters d – a dictionary with port settings. the class Serial will derive from io.5.5. Platform specific methods. setXON(level=True) Platform Windows Parameters level – Set flow control state. Applies a dictionary that was created by getSettingsDict(). Return file descriptor number for the port that is opened by this object. New in version 2. New in version 2. getSettingsDict() Returns a dictionary with current port settings. The port settings can be read and written as dictionary. This is useful to backup the current settings so that a later point in time they can be restored using applySettingsDict(). Only changes are applied and when a key is missing it means that the setting stays unchanged.RawIOBase. 4.6 Returns False New in version 2. Set software flow control state. Implementation detail: some attributes and functions are provided by the class SerialBase and some by the platform specific class and others by the base class mentioned above.pySerial Documentation. Note that control lines (RTS/DTR) are part of the settings.5. New in version 2.5. This can be useful if the port is used with select. Classes 19 . It is useful when serial ports are used with select. Get a dictionary with port settings. readinto(b) Parameters b – bytearray or array instance Returns Number of byte read Read up to len(b) bytes into bytearray b and return the number of bytes read. fileno() Platform Unix Returns File descriptor.

eol=’\n’) Parameters • size – Max number of bytes to read. Release 2. read() Raises NotImplementedError.. isatty() Raises IOError always. flush() Flush of file like objects. needs to be overridden by subclass. • eol – The end of line character. may be overridden. as method is not supported on serial port New in version 2. as method is not supported on serial port New in version 2. None -> no limit. The following functions are implemented for compatibility with other file-like objects. needs to be overridden by subclass. seek(pos.pySerial Documentation. usage: 20 Chapter 4. whence=0) Raises IOError always. readline(size=None. __iter__() Returns self.g.FileLike An abstract file like class. write(data) Raises NotImplementedError. The following three methods are overridden in Serial. as method is not supported on serial port New in version 2.. tell() Raises IOError always. It is used as base class for Serial when no io module is available. . It’s a no-op in this class. To be able to use the file like object as iterator for e.5. pySerial API . that readline() blocks until it sees a newline (or the specified size is reached) and that readlines() would never return and therefore refuses to work (it raises an exception in this case)! writelines(sequence) Write a list of strings to the port.5.5. for line in Serial(0): next() Return the next line by calling readline(). Note that when the serial port was opened with no timeout. as method is not supported on serial port New in version 2. Other high level access functions. however serial ports are not seekable. n=None) Raises IOError always.5. This class implements readline() and readlines() based on read() and writelines() based on write().6 class serial. truncate(self.

eol=’\n’) Parameters • sizehint – Ignored parameter. Deprecated since version 2. until timeout. •Reading the status lines (DSR/DTR etc. Unlike readlines (that only returns on a timeout) is this function yielding lines as they are received. Due to the nature of the network and protocol involved there are a few extra points to keep in mind: •All operations have an additional latency time.Changed in version 2.) returns a cached value.) names are URLs in the form: 4.1.2 RFC 2217 Network ports Warning: This implementation is currently in an experimental state. class rfc2217. sizehint is ignored and only present for API compatibility with built-in File objects.Serial port object on open()/close(). instead. This method is not available in Python 2.5: Use for line in Serial(.. This means that flush(). flushInput() and flushOutput() may work with additional delay. xreadlines(sizehint=None) Read lines.): . Port rfc2217://<host>:<port>[/<option>[/<option>]] This class API is compatible to Serial with a few exceptions: •numbers as port name are not allowed.Serial This implements a RFC 2217 compatible client. Note that this function only returns on a timeout. Read a list of lines. 4. implemented as generator. Classes 21 . The thread is managed automatically by the rfc2217. •No authentication support (servers may not prompt for a password etc. The server itself may implement a polling at a certain rate and quick changes may be invisible. readlines(sizehint=None.. However it may be a problem for user applications that like to use select instead of threads.5: Implement as generator.6 Read a line which is terminated with end-of-line (eol) character (\n by default) or until timeout. Likewise inWaiting() returns the size of the data arrived at the object internal buffer and excludes any bytes in the network buffers or any server side buffer. When that cache is updated depends entirely on the server. Release 2.6 and newer where the io library is available and pySerial bases on it.. •Closing and immediately reopening the same port may fail due to time needed by the server to get ready again. Use at your own risk. only URLs in the form described above. •Setting control lines (RTS/CTS) needs more time.. Not implemented yet / Possible problems with the implementation: •RFC 2217 flow control between client and server (objects internal buffer may eat all your memory when never read). •The network layer also has buffers. • eol – The end of line character.pySerial Documentation. •writeTimeout is not implemented •The current implementation starts a thread that keeps reading from the (internal) socket.1.

6 •No encryption. escape(data) Parameters data – data to be sent over the network. free from Telnet and RFC 2217 controls. The user of this class must take care of the data transmission itself. debug_output=False) Parameters • serial_port – a Serial instance that is managed. class rfc2217. escaped for Telnet/RFC 2217 A generator that escapes all data to be compatible with RFC 2217.g. this class supports all programming models such as threads and select.server’)). Initializes the Manager and starts negotiating with client in Telnet and RFC 2217 protocol. Basically.Logger (e. Returns data. It can be converted to bytes using serial. connection. debug_output can be set to an instance of a logging.serial converters are shown. i. __init__(serial_port. The negotiation starts immediately so that the class should be instantiated in the moment the client connects. The reason for that is.) and control lines (RTS/DTR) send BREAK etc. The caller should configure the logger using setLevel for the desired detail level of the logs. All data must be sent in its raw form (escape() must not be used) as it is used to send Telnet and RFC 2217 control commands. This object will modify the port settings (baud rate etc. one using threads (the single port server) and an other using select (the multi port server). 22 Chapter 4. Due to lack of authentication and encryption it is not suitable to use this client for connections across the internet and should only be used in controlled environments.getLogger(’rfc2217. This function must ensure that data is written at once (no user data mixed in. Note: Each new client connection must create a new instance as this object (and the RFC 2217 protocol) has internal state. Usage examples can be found in the examples where two TCP/IP . logging. The connection object must implement a write(data)() function. pySerial API .to_bytes(). The function returns a generator which can be used in for loops.Logger instance or None. when the corresponding commands are found by the filter() method. including Telnet and RFC 2217 controls. filter(data) Parameters data – data read from the network. For diagnostics of the connection or the implementation. New in version 2.PortManager This class provides helper functions for implementing RFC 2217 compatible servers. • connection – an object implementing write().5. it implements every thing needed for the RFC 2217 protocol.e. The serial_port can be controlled by RFC 2217 commands. Release 2. It just does not open sockets and read/write to serial ports (though it changes other port settings). it must be thread-safe). • debug_output – enables debug messages: a logging.pySerial Documentation. Returns data. Implementors of servers should use this function to process all data sent over the network. used to write to the network. that this way.

3 Constants Parity serial.5.SEVENBITS 4. check_modem_lines(force_notification=False) Parameters force_notification – Set to false.2 Exceptions exception serial.6 A generator that filters and processes all data related to RFC 2217. New in version 2.SIXBITS serial. 4.STOPBITS_ONE_POINT_FIVE serial.to_bytes().PARITY_EVEN serial.PARITY_MARK serial.g.STOPBITS_TWO Note that 1. Parameter is for internal use. Byte size serial.SerialException Base class for serial port exceptions. Changed in version 2. The function returns a generator which can be used in for loops. Implementors of servers should use this function to process all data received from the network.FIVEBITS serial.PARITY_NONE serial.PARITY_ODD serial.5: Now derrives from IOError instead of Exception exception serial.PARITY_SPACE Stop bits serial.5 stop bits are not supported on POSIX.2. This is required to support the client for reading CTS/DSR/RI/CD status lines. The function reads the status line and issues the notifications automatically. This function needs to be called periodically (e.STOPBITS_ONE serial. every second) when the server wants to send NOTIFY_MODEMSTATE messages.Telnet Com Port Control Option 4. Release 2. See Also: RFC 2217 . Exceptions 23 . It will fall back to 2 stop bits. It can be converted to bytes using serial.pySerial Documentation.SerialTimeoutException Exception that is raised on write timeouts.

6 serial. that is. There is also support for other types.g. Convert a port number to a platform dependent device name.pySerial Documentation.protocol_XY with each candidate for PACKAGE from this list. see URL section below.XON serial. New in version 2.append("my_handlers") s = serial. number or URL • do_not_open – When set to true. pySerial API . **kwargs) Parameters • url – Device name.g. Get a native or a RFC 2217 implementation of the Serial class.5. 4. The port is not opened when a keyword parameter called do_not_open is given and true. Returns an instance of Serial or a compatible object.3.protocol_handler_packages This attribute is a list of package names (strings) that is searched for protocol handlers.protocol_handler_packages. New in version 2. such as 2. Deprecated Use device names directly.VERSION A string indicating the pySerial version.to_bytes(sequence) Parameters sequence – String or list of integers 24 Chapter 4. by default it is opened.serial_for_url(url. New in version 2. there is no guarantee that the returned device name really exists on the system. we want to support a URL foobar://.5. Unfortunately this does not work well for all platforms. the serial port is not opened. *args. some may miss USB-Serial converters and enumerate only internal serial ports.6.serial_for_url("foobar://") For an URL starting with XY:// is the function serial_for_url() attempts to import PACKAGE.4 Module functions and attributes serial. serial. This factory function is useful when an application wants to support both. e.EIGHTBITS Others Default control characters (instances of bytes for Python 3. depending on port/url. e. Release 2. A module my_handlers. serial. The conversion may be made off-line.protocol_foobar is provided by the user: serial. serial. local ports and remote ports.XOFF Module version: serial.device(number) Parameters number – Port number.0+) for software flow control: serial. Returns String containing device name.

Module functions and attributes 25 . for servers that do not send notifications. Implemented by rfc2217. New in version 2. It uses the logging module and a logger called pySerial.x. The timeout applies to the initial Telnet / RFC 2271 negotiation as well as changing port settings or control line change commands. Since pySerial 2. Release 2. Enable this option when getCTS() does not work as expected. This is used to write code that is compatible to Python 2. All serial port functions are supported. rfc2217:// Used to connect to RFC 2217 compatible servers. • logging=[debug|info|warning|error]: Prints diagnostic messages (not useful for end users).stderr (if no logging was set up already).socket so that the application can setup up logging handlers etc. 4. Without this option it relies on the server sending the notifications automatically (that’s what the RFC suggests and most servers do). This is useful when the server takes a little more time to send its answers.4. i. This function is used internally and in the unit tests. socket:// The purpose of this connection type is that applications using pySerial can connect to TCP/IP to serial port converters that do not support RFC 2217.x and 3.x.pySerial Documentation. All serial port settings. It will call logging.5.stderr (if no logging was set up already). bytes is a subclass of str.: • /dev/ttyUSB0 (Linux) • COM3 (Windows) Future releases of pySerial might add more types.rfc2217 so that the application can setup up logging handlers etc.1 URLs The function serial_for_url() accepts the following types of URLs: • rfc2217://<host>:<port>[/<option>[/<option>]] • socket://<host>:<port>[/<option>[/<option>]] • loop://[<option>[/<option>]] Device names are also supported. It uses the logging module and a logger called pySerial. In Python versions prior 3.6 Returns an instance of bytes Convert a sequence to a bytes type. This option can be used for non compliant servers (i. Uses a TCP/IP socket.4.basicConfig() which initializes for output on sys. • poll_modem: The client issues NOTIFY_MODEMSTATE requests when status lines are read (CTS/DTR/RI/CD). 4. Supported options in the URL are: • ign_set_control does not wait for acknowledges to SET_CONTROL. They convert str([17]) to ’[17]’ instead of ’\x11’ so a simple bytes(sequence) doesn’t work for all versions of Python.6 it is also possible for the user to add protocol handlers using protocol_handler_packages. It will call logging. • timeout=<value>: Change network timeout (default 3 seconds).e. Only data is transmitted and received.e. when getting an remote rejected value for option ’control’ error when connecting).g.basicConfig() which initializes for output on sys. control and status lines are ignored.Serial. Supported options in the URL are: • logging=[debug|info|warning|error]: Prints diagnostic messages (not useful for end users). e.

basicConfig() which initializes for output on sys.comports() Returns an iterable. even for the same device. registry) serial. sysfs and lsusb) Platform Windows (setupapi. see comports().tools. Note: Support is limited to a number of operating systems.5 • socket://localhost:7777 • loop://logging=debug 4.serial_for_url() •description in human readable form •sort of hardware ID.stderr (if no logging was set up already). It also contains the following functions.tools. Also note that the reported strings are different across platforms and operating systems.6.grep(regexp) Parameters regexp – regular expression (see stdlib re) Returns filtered sequence. Release 2. It may make sense to sort the items. Supported options in the URL are: • logging=[debug|info|warning|error]: Prints diagnostic messages (not useful for end users). This module can be executed to get serial.pySerial Documentation.1 serial.g.loop so that the application can setup up logging handlers etc.5 Tools 4. Platform Posix (/dev files) Platform Linux (/dev files. The function returns an iterable that yields tuples of three strings: •port name as it can be passed to serial. E. may contain VID:PID of USB-serial adapters. a list of ports (python -m 26 Chapter 4. It simulates a loop back connection (RX<->TX RTS<->CTS DTR<->DSR).Serial or serial. pySerial API .list_ports. Items are returned in no particular order. It uses the logging module and a logger called pySerial.5. It will call logging.list_ports.list_ports New in version 2. On some systems description and hardware ID will not be available (None). serial.tools.6 loop:// The least useful type.list_ports). It could be used to test applications or run the unit tests. Examples: • rfc2217://localhost:7000 • rfc2217://localhost:7000/poll_modem • rfc2217://localhost:7000/ign_set_control/timeout=5.tools.

The function returns an iterable that contains the same tuples that comport() generates but only those that match the regexp. description and hardware ID are searched (case insensitive).5.tools. Port name. Miniterm is now available as module instead of example.6. see Miniterm for details. 4.2 serial.miniterm New in version 2. 4.6 Search for ports using a regular expression.5. Tools 27 .pySerial Documentation. Release 2.

Release 2.6 28 Chapter 4. pySerial API .pySerial Documentation.

But it may be useful for developers. 29 .txt for more details.1. see LICENSE. The extension module can be compiled with Distutils with either MSVC or GCC/mingw32.1.2 or newer • “Java Communications” (JavaComm) extension for Java/Jython 5. Copyright (C) 2001-2003 Chris Liechti <cliechti(at)gmx.1.3 Installation Extract files from the archive.1 Overview This module encapsulates the access for the parallel port. The windows version needs a compiled extension and the giveio.2 Requirements • Python 2. 5.CHAPTER FIVE PYPARALLEL Note: This module is in development (since years . It is released under a free software license. It provides backends for Python running on Windows and Linux. no need to know the port name in the user program • port string (device name) can be specified if access through numbering is inappropriate 5. This module is still under development.net> Here is the project page on SourceForge and here is the SVN repository. Other platforms are possible too but not yet integrated.1 Features • same class based interface on all supported platforms • port numbering starts at zero.-) 5.py install The files get installed in the “Lib/site-packages” directory in newer Python versions.sys driver for Windows NT/2k/XP. open a shell/console in that directory and let Distutils do the rest: python setup.

D7) e. setInitOut(level) Set “initialize” line to given state. setData(value) Apply the given byte to the data pins of the parallel port. setAutoFeed(level) Set “auto feed” line to given state. getInPaperOut() Read level of “paper out” line.. p.VirtualParallelPort This class provides a virtual parallel port implementation. class parallel. useful for tests and simulations without real hardware. 30 Chapter 5. getInAcknowledge() Read level of “Acknowledge” line.4. setDataStrobe(level) Set the “data strobe” line to the given state. http://pyserial. rmmod lp.6 5.pySerial Documentation.D0 refers to the first bit of the data lines.Parallel() >>> p.3 API class parallel. There is an example directory where you can find a simple terminal and more.setData(0x55) # open LPT1 5.g.1 Examples Please look in the SVN Repository. class parallel.BitaccessMeta This mix-in class adds a few properties that allow easier bit access to the data lines.parallelutil.2. lp claims exclusive access to the port and other programs won’t be able to use it. (D0 .net/viewvc/pyserial/trunk/pyparallel/examples/ 5.parallelutil.1 Linux 1. The lp(4) module must be unloaded.Parallel __init__(port) Open given parallel port.2 Short introduction >>> import parallel >>> p = parallel.sourceforge. pyParallel .svn. Release 2. getInSelected() Read level of “select” line.4 Notes 5. 5.

ibm.5 Misc 5.6 2. 3. The ppdev(4) module needs to be loaded.org/ • Jython: http://www. Misc 31 .com/products/ 5. Many distributions have an lp group that owns the device. modprobe ppdev.python. the simplest is to add the user account to this group.6 kernels) this will create a /dev/parport0.pySerial Documentation. 5.com/developerworks/java/jdk/ (JavaComm links are on the download page for the respective platform JDK) • Java@SUN: http://java.5. 5. (default with 2.5.jython.4. The user needs to have write permissions to /dev/parport0. This also means that USB parallel port adapters won’t be supported. Release 2. Simply changing permissions on the device is not the best strategy as they will be reverted to their defaults next time the driver is loaded.org/ • Java@IBM: http://www-106. When udev is in use.2 Windows The giveio driver must be installed as the module needs direct access to the hardware.sun.1 References • Python: http://www.

pySerial Documentation. pyParallel .6 32 Chapter 5. Release 2.

Test your setup. the desired handlers have to be included manually (e. The RTS and DTR lines are switched when the port is opened..urlhandler.) Assuming the application already stores port names as strings that’s all that is required. time. The user just needs a way to change the port setting of your application to an rfc2217:// URL (e. is recommended in this situation. a Application works when .Serial(.) except AttributeError: s = serial.. GUI dialog etc. it’s safe to exclude ‘serialposix’. before the first write(). ‘serial.). Patch the code where the serial.. On Windows. To test cables. 6. ‘serialjava’ and ‘serialcli’ as these are not used. pySerial may create two issues with that: • implementations for other modules are found. connecting RX to TX (loop back) and typing some characters in Miniterm is a simple test.py file is run. then at least RX and TX work (they still could be swapped though).CHAPTER SIX APPENDIX 6. A delay after opening the port. Miniterm from the Examples can be used to open the serial port and do some basic tests.g. Replace it with: try: s = serial.protocol_socket’. Please note that this enables all URL types supported by pySerial and that those involving the network are unencrypted and not protected against eavesdropping. • serial. ‘se- 33 . but fails when packaged (py2exe etc.sleep(1) E..serial_for_url() does a dynamic lookup of protocol handlers at runtime.) py2exe and similar packaging programs scan the sources for import statements and create a list of modules that they package. When the characters are displayed on the screen. If this function is used. Is the device not working as expected? Maybe it’s time to check the connection before proceeding.g. In such a cases an immediately following call to write() may not be received by the device. This may cause some processing or reset on the connected device.2 FAQ Example works in Miniterm but not in script.g. by editing a configuration file.Serial is instantiated.1 How To Enable RFC 2217 in programs using pySerial.serial_for_url(.

redistribute it. or joint venture between the copyright holder and Licensee.). for the RFC 2217: rfc2217:://.serial_for_url() can be used to access “virtual” serial ports identified by an URL scheme. EVEN IF ADVISED OF THE POSSIBILITY THEREOF. and wants to make the derivative work available to others as provided herein. User supplied URL handlers serial. partnership. that copyright holders License Agreement and copyright holders notice of copyright are retained in this product alone or in any derivative version prepared by Licensee. Custom URL handlers can be added by extending the module search serial. prepare derivative works. etc.net/ Provides virtual serial ports for Windows. modify it.3 Related software com0com .4 License Copyright (C) 2001-2011 Chris Liechti <cliechti(at)gmx. Nothing in this License Agreement shall be deemed to create any relationship of agency. 34 Chapter 6.6 rial.net>. Appendix . the copyright holder hereby grants Licensee a nonexclusive. This License Agreement does not grant permission to use trademarks or trade names from the copyright holder in a trademark sense to endorse or promote products or services of Licensee. path in 6. DISTRIBUTING. All Rights Reserved. In short. and the Individual or Organization (“Licensee”) accessing and otherwise using this product in source or binary form and its associated documentation. In the event Licensee prepares a derivative work that is based on or incorporates this product or any part thereof. 5. EXPRESS OR IMPLIED.6.protocol_handler_packages. and otherwise use this product alone or in any derivative version. Release 2. then Licensee hereby agrees to include in any such work a brief summary of the changes made to this product. Subject to the terms and conditions of this License Agreement. you can use this product in commercial and non-commercial applications. This License Agreement will automatically terminate upon a material breach of its terms and conditions. world-wide license to reproduce. This LICENSE AGREEMENT is between the copyright holder of this product. THE COPYRIGHT HOLDER SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THIS PRODUCT FOR ANY INCIDENTAL. however. BUT NOT LIMITATION. This is possible starting from pySerial V2.g. OR OTHERWISE USING THIS PRODUCT. 4. OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING. 6. E. 3. 2. perform and/or display publicly. The copyright holder is making this product available to Licensee on an “AS IS” basis. THE COPYRIGHT HOLDER MAKES NO REPRESENTATIONS OR WARRANTIES.http://com0com. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING THIS SOFTWARE LICENSE AGREEMENT 1. 7. This can be done either with the “includes” option in setup.py or by a dummy import in one of the packaged modules. BY WAY OF EXAMPLE. or any third party. A notification to the author when you use and/or modify it is welcome. distribute. 6. OR ANY DERIVATIVE THEREOF. test. provided.sourceforge.pySerial Documentation.protocol_rfc2217’. royalty-free. THE COPYRIGHT HOLDER MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THIS PRODUCT WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. This is the Python license. SPECIAL. analyze.urlhandler.

Licensee agrees to be bound by the terms and conditions of this License Agreement. By copying.6 8. installing or otherwise using this product. License 35 .pySerial Documentation. Release 2.4. 6.

pySerial Documentation. Release 2.6 36 Chapter 6. Appendix .

CHAPTER SEVEN INDICES AND TABLES • genindex • modindex • search 37 .

pySerial Documentation. Release 2.6 38 Chapter 7. Indices and tables .

miniterm.list_ports.tools.PYTHON MODULE INDEX p parallel. 30 parallel. 26 serial.tools. 27 39 .parallelutil. 15 serial. 30 s serial.

pySerial Documentation. Release 2.6 40 Python Module Index .

Serial attribute). 17 getSettingsDict() (serial. 22 __iter__() (serial.Serial attribute). 17 getCTS() (serial. 16 __init__() (parallel. 20 flush() (serial.Parallel method).Serial attribute).tools.Parallel method). 18 BYTESIZES (serial.list_ports). 18 portstr (serial. 20 41 .FileLike method).Serial method). 18 PARITY_EVEN (in module serial). 18 BAUDRATES (serial. 18 I interCharTimeout (serial.PortManager next() (serial. 15 __init__() (serial. 18 inWaiting() (serial. 23 port (serial. 23 PARITY_SPACE (in module serial). 20 G getCD() (serial. 20 nonblocking() (serial.INDEX Symbols __del__() (serial. 23 PARITY_ODD (in module serial).Serial method). 19 grep() (in module serial. 30 getInSelected() (parallel. 16 isatty() (serial.parallelutil). 23 close() (serial. 24 E EIGHTBITS (in module serial). 17 check_modem_lines() (serial.Serial method).rfc2217. 23 flush() (serial.Serial attribute). 17 getDSR() (serial.FileLike method). 30 bytesize (serial.tools.Parallel method).Serial method).Serial method).Serial method).Serial attribute).Serial method). 22 F FileLike (class in serial).PortManager method).Serial attribute). 19 fileno() (serial. 18 parity (serial. 30 __init__() (serial.Serial method).Serial attribute). 30 getInPaperOut() (parallel. 18 BitaccessMeta (class in parallel.Serial method). 17 protocol_handler_packages (in module serial). 16 D device() (in module serial).Serial attribute).Serial attribute). 30 parallel.Serial method).Serial method). 26 A applySettingsDict() (serial.Parallel method). 16 O comports() (in module serial.Serial attribute). 19 B baudrate (serial.parallelutil (module). 23 escape() (serial.PortManager method). 18 P Parallel (class in parallel).PortManager method).FileLike method). 30 getRI() (serial.list_ports). 26 open() (serial. 17 getInAcknowledge() (parallel. 17 flushInput() (serial.FileLike method).Serial method). 30 parallel (module).Serial method).rfc2217.rfc2217. 22 FIVEBITS (in module serial). 17 flushOutput() (serial. 23 PARITY_MARK (in module serial).Serial method). 30 PARITIES (serial. 19 method). 17 R read() (serial.Serial method). 23 PARITY_NONE (in module serial). 24 dsrdtr (serial.rfc2217.FileLike method). 20 N C name (serial. 19 filter() (serial.Serial attribute).Serial method).

33. 18 sendBreak() (serial.Serial method).Serial (class in serial). 30 setRTS() (serial.FileLike method). 15 serial (module). Release 2.tools.Serial method). 18 stopbits (serial. 21 rtscts (serial. 17 setInitOut() (parallel. 24 SerialException. 21–25. 24 truncate() (serial.list_ports (module). 23 STOPBITS (serial.parallelutil). 24 VirtualParallelPort (class in parallel. 30 setDTR() (serial. 17 Serial (class in serial). 18 X XOFF (in module serial).Serial method).Serial attribute).FileLike method). 17 setXON() (serial.Serial attribute). 23 SIXBITS (in module serial).Serial method). 25 rfc2217.miniterm (module).FileLike method).FileLike method). 19 SEVENBITS (in module serial). 18 STOPBITS_ONE (in module serial). 20 write() (serial.FileLike method).Serial method).Parallel method). 22 rfc2217. 26 serial.Serial attribute). 20 readlines() (serial. 19 readline() (serial. 23 SerialTimeoutException.Serial attribute). 18 xreadlines() (serial. 18 writelines() (serial. 16 readable() (serial.Parallel method). 23 T tell() (serial.Serial method). 16 42 Index .Serial method).Serial method). 21 S seek() (serial.Parallel method). 27 serial_for_url() (in module serial). 21 RFC RFC 2217. 12. 30 setBreak() (serial. 20 writeTimeout (serial.Serial method). 30 W writable() (serial.Serial method).Serial attribute).FileLike method). 20 timeout (serial. 23 STOPBITS_TWO (in module serial). 24 XON (in module serial). 20 seekable() (serial.FileLike method).pySerial Documentation.FileLike method). 17 setData() (parallel.Parallel method). 24 xonxoff (serial. 11. 18 write() (serial. 15 serial.PortManager (class in serial). 30 setDataStrobe() (parallel.tools. 20 V VERSION (in module serial). 34 RFC 2271. 18 readinto() (serial.Serial attribute). 18 to_bytes() (in module serial).Serial method). 23 setAutoFeed() (parallel.6 read() (serial. 23 STOPBITS_ONE_POINT_FIVE (in module serial). 9.