blob: adec99848e07e090886cf7a1ceb4170c67ab373f [file] [log] [blame]
cliechti22978142009-07-21 01:58:11 +00001==========
2 pySerial
3==========
4
5Overview
6========
Chris Liechti418262d2015-10-01 23:25:17 +02007
cliechti22978142009-07-21 01:58:11 +00008This module encapsulates the access for the serial port. It provides backends
Chris Liechti418262d2015-10-01 23:25:17 +02009for Python_ running on Windows, OSX, Linux, BSD (possibly any POSIX compliant
10system) and IronPython. The module named "serial" automatically selects the
11appropriate backend.
cliechti22978142009-07-21 01:58:11 +000012
cliechti5134aab2009-07-21 19:47:59 +000013It is released under a free software license, see LICENSE_ for more
cliechti22978142009-07-21 01:58:11 +000014details.
15
Chris Liechti19688bf2016-05-06 23:48:36 +020016Copyright (C) 2001-2016 Chris Liechti <cliechti(at)gmx.net>
cliechti22978142009-07-21 01:58:11 +000017
cliechti8e814dc2009-07-30 22:19:08 +000018Other pages (online)
cliechti22978142009-07-21 01:58:11 +000019
Chris Liechti90570b92015-08-04 03:32:02 +020020- `project page on GitHub`_
cliechti4cb94662013-10-17 03:17:50 +000021- `Download Page`_ with releases (PyPi)
Chris Liechti2c278a82016-05-02 23:51:59 +020022- This page, when viewed online is at https://pyserial.readthedocs.io/en/latest/ or
Chris Liechti418262d2015-10-01 23:25:17 +020023 http://pythonhosted.org/pyserial/ .
cliechti22978142009-07-21 01:58:11 +000024
Chris Liechti418262d2015-10-01 23:25:17 +020025.. _Python: http://python.org/
cliechti5134aab2009-07-21 19:47:59 +000026.. _LICENSE: appendix.html#license
Chris Liechti90570b92015-08-04 03:32:02 +020027.. _`project page on GitHub`: https://github.com/pyserial/pyserial/
cliechti4cb94662013-10-17 03:17:50 +000028.. _`Download Page`: http://pypi.python.org/pypi/pyserial
cliechti22978142009-07-21 01:58:11 +000029
30
31Features
32========
cliechtiec4ac1b2009-08-02 00:47:21 +000033- Same class based interface on all supported platforms.
34- Access to the port settings through Python properties.
35- Support for different byte sizes, stop bits, parity and flow control with
cliechti5134aab2009-07-21 19:47:59 +000036 RTS/CTS and/or Xon/Xoff.
cliechtiec4ac1b2009-08-02 00:47:21 +000037- Working with or without receive timeout.
38- File like API with "read" and "write" ("readline" etc. also supported).
39- The files in this package are 100% pure Python.
40- The port is set up for binary transmission. No NULL byte stripping, CR-LF
cliechti22978142009-07-21 01:58:11 +000041 translation etc. (which are many times enabled for POSIX.) This makes this
42 module universally useful.
Chris Liechti90570b92015-08-04 03:32:02 +020043- Compatible with :mod:`io` library
cliechtia2d8f962009-08-10 23:59:27 +000044- RFC 2217 client (experimental), server provided in the examples.
cliechti22978142009-07-21 01:58:11 +000045
46
47Requirements
48============
Chris Liechtid3168892016-09-07 03:26:03 +020049- Python 2.7 or Python 3.4 and newer
50
Chris Liechtibc6031c2017-03-21 01:54:03 +010051- If running on Windows: Windows 7 or newer
Chris Liechtid3168892016-09-07 03:26:03 +020052
Chris Liechtic600e232016-09-15 21:24:24 +020053- If running on Jython: "Java Communications" (JavaComm) or compatible
54 extension for Java
55
56For older installations (older Python versions or older operating systems), see
57`older versions`_ below.
cliechti22978142009-07-21 01:58:11 +000058
cliechti5134aab2009-07-21 19:47:59 +000059
cliechti22978142009-07-21 01:58:11 +000060Installation
61============
62
cliechti5134aab2009-07-21 19:47:59 +000063This installs a package that can be used from Python (``import serial``).
cliechti22978142009-07-21 01:58:11 +000064
cliechti4cb94662013-10-17 03:17:50 +000065To install for all users on the system, administrator rights (root)
66may be required.
67
68From PyPI
Chris Liechtid3168892016-09-07 03:26:03 +020069---------
Chris Liechtid389f8a2016-07-11 23:32:21 +020070pySerial can be installed from PyPI::
cliechti4cb94662013-10-17 03:17:50 +000071
Chris Liechtid389f8a2016-07-11 23:32:21 +020072 python -m pip install pyserial
cliechti4cb94662013-10-17 03:17:50 +000073
Chris Liechtid3168892016-09-07 03:26:03 +020074Using the `python`/`python3` executable of the desired version (2.7/3.x).
cliechti22978142009-07-21 01:58:11 +000075
Chris Liechti1770e502016-08-11 23:43:55 +020076Developers also may be interested to get the source archive, because it
77contains examples, tests and the this documentation.
78
shaunwbell6bab3ca2017-08-03 09:19:21 -070079From Conda
80----------
81pySerial can be installed from Conda::
82
83 conda install pyserial
84
85 or
86
87 conda install -c conda-forge pyserial
88
89Currently the default conda channel will provide version 2.7 whereas the
90conda-forge channel provides the current 3.x version.
91
92Conda: https://www.continuum.io/downloads
93
Chris Liechtid3168892016-09-07 03:26:03 +020094From source (zip/tar.gz or checkout)
95------------------------------------
Chris Liechtid389f8a2016-07-11 23:32:21 +020096Download the archive from http://pypi.python.org/pypi/pyserial or
97https://github.com/pyserial/pyserial/releases.
cliechti22978142009-07-21 01:58:11 +000098Unpack the archive, enter the ``pyserial-x.y`` directory and run::
99
100 python setup.py install
101
Chris Liechtid3168892016-09-07 03:26:03 +0200102Using the `python`/`python3` executable of the desired version (2.7/3.x).
cliechti5c72e4d2010-07-21 14:04:54 +0000103
cliechti22978142009-07-21 01:58:11 +0000104Packages
Chris Liechtid3168892016-09-07 03:26:03 +0200105--------
Chris Liechti1770e502016-08-11 23:43:55 +0200106There are also packaged versions for some Linux distributions:
cliechti22978142009-07-21 01:58:11 +0000107
Chris Liechtid3168892016-09-07 03:26:03 +0200108- Debian/Ubuntu: "python-serial", "python3-serial"
109- Fedora / RHEL / CentOS / EPEL: "pyserial"
110- Arch Linux: "python-pyserial"
Chris Liechtibc6031c2017-03-21 01:54:03 +0100111- Gentoo: "dev-python/pyserial"
Chris Liechtid3168892016-09-07 03:26:03 +0200112
113Note that some distributions may package an older version of pySerial.
114These packages are created and maintained by developers working on
115these distributions.
cliechti22978142009-07-21 01:58:11 +0000116
cliechti22978142009-07-21 01:58:11 +0000117.. _PyPi: http://pypi.python.org/pypi/pyserial
118
119
120References
121==========
cliechti86e87872009-07-21 13:32:45 +0000122* Python: http://www.python.org/
cliechti86e87872009-07-21 13:32:45 +0000123* Jython: http://www.jython.org/
cliechti22978142009-07-21 01:58:11 +0000124* IronPython: http://www.codeplex.com/IronPython
cliechti22978142009-07-21 01:58:11 +0000125
126
127Older Versions
128==============
Chris Liechti1770e502016-08-11 23:43:55 +0200129Older versions are still available on the current download_ page or the `old
130download`_ page. The last version of pySerial's 2.x series was `2.7`_,
131compatible with Python 2.3 and newer and partially with early Python 3.x
132versions.
133
134pySerial `1.21`_ is compatible with Python 2.0 on Windows, Linux and several
135un*x like systems, MacOSX and Jython.
cliechti22978142009-07-21 01:58:11 +0000136
Chris Liechtid389f8a2016-07-11 23:32:21 +0200137On Windows, releases older than 2.5 will depend on pywin32_ (previously known as
Chris Liechtid3168892016-09-07 03:26:03 +0200138win32all). WinXP is supported up to 3.0.1.
cliechti6066f842009-07-24 00:05:45 +0000139
Chris Liechti1770e502016-08-11 23:43:55 +0200140
141.. _`old download`: https://sourceforge.net/projects/pyserial/files/pyserial/
Chris Liechti961234d2016-09-18 23:54:49 +0200142.. _download: https://pypi.python.org/simple/pyserial/
cliechti6066f842009-07-24 00:05:45 +0000143.. _pywin32: http://pypi.python.org/pypi/pywin32
Chris Liechti1770e502016-08-11 23:43:55 +0200144.. _`2.7`: https://pypi.python.org/pypi/pyserial/2.7
145.. _`1.21`: https://sourceforge.net/projects/pyserial/files/pyserial/1.21/pyserial-1.21.zip/download