cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 1 | ========== |
| 2 | pySerial |
| 3 | ========== |
| 4 | |
| 5 | Overview |
| 6 | ======== |
Chris Liechti | 418262d | 2015-10-01 23:25:17 +0200 | [diff] [blame] | 7 | |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 8 | This module encapsulates the access for the serial port. It provides backends |
Chris Liechti | 418262d | 2015-10-01 23:25:17 +0200 | [diff] [blame] | 9 | for Python_ running on Windows, OSX, Linux, BSD (possibly any POSIX compliant |
| 10 | system) and IronPython. The module named "serial" automatically selects the |
| 11 | appropriate backend. |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 12 | |
cliechti | 5134aab | 2009-07-21 19:47:59 +0000 | [diff] [blame] | 13 | It is released under a free software license, see LICENSE_ for more |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 14 | details. |
| 15 | |
Chris Liechti | 19688bf | 2016-05-06 23:48:36 +0200 | [diff] [blame] | 16 | Copyright (C) 2001-2016 Chris Liechti <cliechti(at)gmx.net> |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 17 | |
cliechti | 8e814dc | 2009-07-30 22:19:08 +0000 | [diff] [blame] | 18 | Other pages (online) |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 19 | |
Chris Liechti | 90570b9 | 2015-08-04 03:32:02 +0200 | [diff] [blame] | 20 | - `project page on GitHub`_ |
cliechti | 4cb9466 | 2013-10-17 03:17:50 +0000 | [diff] [blame] | 21 | - `Download Page`_ with releases (PyPi) |
Chris Liechti | 2c278a8 | 2016-05-02 23:51:59 +0200 | [diff] [blame] | 22 | - This page, when viewed online is at https://pyserial.readthedocs.io/en/latest/ or |
Chris Liechti | 418262d | 2015-10-01 23:25:17 +0200 | [diff] [blame] | 23 | http://pythonhosted.org/pyserial/ . |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 24 | |
Chris Liechti | 418262d | 2015-10-01 23:25:17 +0200 | [diff] [blame] | 25 | .. _Python: http://python.org/ |
cliechti | 5134aab | 2009-07-21 19:47:59 +0000 | [diff] [blame] | 26 | .. _LICENSE: appendix.html#license |
Chris Liechti | 90570b9 | 2015-08-04 03:32:02 +0200 | [diff] [blame] | 27 | .. _`project page on GitHub`: https://github.com/pyserial/pyserial/ |
cliechti | 4cb9466 | 2013-10-17 03:17:50 +0000 | [diff] [blame] | 28 | .. _`Download Page`: http://pypi.python.org/pypi/pyserial |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 29 | |
| 30 | |
| 31 | Features |
| 32 | ======== |
cliechti | ec4ac1b | 2009-08-02 00:47:21 +0000 | [diff] [blame] | 33 | - 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 |
cliechti | 5134aab | 2009-07-21 19:47:59 +0000 | [diff] [blame] | 36 | RTS/CTS and/or Xon/Xoff. |
cliechti | ec4ac1b | 2009-08-02 00:47:21 +0000 | [diff] [blame] | 37 | - 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 |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 41 | translation etc. (which are many times enabled for POSIX.) This makes this |
| 42 | module universally useful. |
Chris Liechti | 90570b9 | 2015-08-04 03:32:02 +0200 | [diff] [blame] | 43 | - Compatible with :mod:`io` library |
cliechti | a2d8f96 | 2009-08-10 23:59:27 +0000 | [diff] [blame] | 44 | - RFC 2217 client (experimental), server provided in the examples. |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 45 | |
| 46 | |
| 47 | Requirements |
| 48 | ============ |
Chris Liechti | d316889 | 2016-09-07 03:26:03 +0200 | [diff] [blame] | 49 | - Python 2.7 or Python 3.4 and newer |
| 50 | |
Chris Liechti | bc6031c | 2017-03-21 01:54:03 +0100 | [diff] [blame] | 51 | - If running on Windows: Windows 7 or newer |
Chris Liechti | d316889 | 2016-09-07 03:26:03 +0200 | [diff] [blame] | 52 | |
Chris Liechti | c600e23 | 2016-09-15 21:24:24 +0200 | [diff] [blame] | 53 | - If running on Jython: "Java Communications" (JavaComm) or compatible |
| 54 | extension for Java |
| 55 | |
| 56 | For older installations (older Python versions or older operating systems), see |
| 57 | `older versions`_ below. |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 58 | |
cliechti | 5134aab | 2009-07-21 19:47:59 +0000 | [diff] [blame] | 59 | |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 60 | Installation |
| 61 | ============ |
| 62 | |
cliechti | 5134aab | 2009-07-21 19:47:59 +0000 | [diff] [blame] | 63 | This installs a package that can be used from Python (``import serial``). |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 64 | |
cliechti | 4cb9466 | 2013-10-17 03:17:50 +0000 | [diff] [blame] | 65 | To install for all users on the system, administrator rights (root) |
| 66 | may be required. |
| 67 | |
| 68 | From PyPI |
Chris Liechti | d316889 | 2016-09-07 03:26:03 +0200 | [diff] [blame] | 69 | --------- |
Chris Liechti | d389f8a | 2016-07-11 23:32:21 +0200 | [diff] [blame] | 70 | pySerial can be installed from PyPI:: |
cliechti | 4cb9466 | 2013-10-17 03:17:50 +0000 | [diff] [blame] | 71 | |
Chris Liechti | d389f8a | 2016-07-11 23:32:21 +0200 | [diff] [blame] | 72 | python -m pip install pyserial |
cliechti | 4cb9466 | 2013-10-17 03:17:50 +0000 | [diff] [blame] | 73 | |
Chris Liechti | d316889 | 2016-09-07 03:26:03 +0200 | [diff] [blame] | 74 | Using the `python`/`python3` executable of the desired version (2.7/3.x). |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 75 | |
Chris Liechti | 1770e50 | 2016-08-11 23:43:55 +0200 | [diff] [blame] | 76 | Developers also may be interested to get the source archive, because it |
| 77 | contains examples, tests and the this documentation. |
| 78 | |
shaunwbell | 6bab3ca | 2017-08-03 09:19:21 -0700 | [diff] [blame] | 79 | From Conda |
| 80 | ---------- |
| 81 | pySerial can be installed from Conda:: |
| 82 | |
| 83 | conda install pyserial |
| 84 | |
| 85 | or |
| 86 | |
| 87 | conda install -c conda-forge pyserial |
| 88 | |
| 89 | Currently the default conda channel will provide version 2.7 whereas the |
| 90 | conda-forge channel provides the current 3.x version. |
| 91 | |
| 92 | Conda: https://www.continuum.io/downloads |
| 93 | |
Chris Liechti | d316889 | 2016-09-07 03:26:03 +0200 | [diff] [blame] | 94 | From source (zip/tar.gz or checkout) |
| 95 | ------------------------------------ |
Chris Liechti | d389f8a | 2016-07-11 23:32:21 +0200 | [diff] [blame] | 96 | Download the archive from http://pypi.python.org/pypi/pyserial or |
| 97 | https://github.com/pyserial/pyserial/releases. |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 98 | Unpack the archive, enter the ``pyserial-x.y`` directory and run:: |
| 99 | |
| 100 | python setup.py install |
| 101 | |
Chris Liechti | d316889 | 2016-09-07 03:26:03 +0200 | [diff] [blame] | 102 | Using the `python`/`python3` executable of the desired version (2.7/3.x). |
cliechti | 5c72e4d | 2010-07-21 14:04:54 +0000 | [diff] [blame] | 103 | |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 104 | Packages |
Chris Liechti | d316889 | 2016-09-07 03:26:03 +0200 | [diff] [blame] | 105 | -------- |
Chris Liechti | 1770e50 | 2016-08-11 23:43:55 +0200 | [diff] [blame] | 106 | There are also packaged versions for some Linux distributions: |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 107 | |
Chris Liechti | d316889 | 2016-09-07 03:26:03 +0200 | [diff] [blame] | 108 | - Debian/Ubuntu: "python-serial", "python3-serial" |
| 109 | - Fedora / RHEL / CentOS / EPEL: "pyserial" |
| 110 | - Arch Linux: "python-pyserial" |
Chris Liechti | bc6031c | 2017-03-21 01:54:03 +0100 | [diff] [blame] | 111 | - Gentoo: "dev-python/pyserial" |
Chris Liechti | d316889 | 2016-09-07 03:26:03 +0200 | [diff] [blame] | 112 | |
| 113 | Note that some distributions may package an older version of pySerial. |
| 114 | These packages are created and maintained by developers working on |
| 115 | these distributions. |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 116 | |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 117 | .. _PyPi: http://pypi.python.org/pypi/pyserial |
| 118 | |
| 119 | |
| 120 | References |
| 121 | ========== |
cliechti | 86e8787 | 2009-07-21 13:32:45 +0000 | [diff] [blame] | 122 | * Python: http://www.python.org/ |
cliechti | 86e8787 | 2009-07-21 13:32:45 +0000 | [diff] [blame] | 123 | * Jython: http://www.jython.org/ |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 124 | * IronPython: http://www.codeplex.com/IronPython |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 125 | |
| 126 | |
| 127 | Older Versions |
| 128 | ============== |
Chris Liechti | 1770e50 | 2016-08-11 23:43:55 +0200 | [diff] [blame] | 129 | Older versions are still available on the current download_ page or the `old |
| 130 | download`_ page. The last version of pySerial's 2.x series was `2.7`_, |
| 131 | compatible with Python 2.3 and newer and partially with early Python 3.x |
| 132 | versions. |
| 133 | |
| 134 | pySerial `1.21`_ is compatible with Python 2.0 on Windows, Linux and several |
| 135 | un*x like systems, MacOSX and Jython. |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 136 | |
Chris Liechti | d389f8a | 2016-07-11 23:32:21 +0200 | [diff] [blame] | 137 | On Windows, releases older than 2.5 will depend on pywin32_ (previously known as |
Chris Liechti | d316889 | 2016-09-07 03:26:03 +0200 | [diff] [blame] | 138 | win32all). WinXP is supported up to 3.0.1. |
cliechti | 6066f84 | 2009-07-24 00:05:45 +0000 | [diff] [blame] | 139 | |
Chris Liechti | 1770e50 | 2016-08-11 23:43:55 +0200 | [diff] [blame] | 140 | |
| 141 | .. _`old download`: https://sourceforge.net/projects/pyserial/files/pyserial/ |
Chris Liechti | 961234d | 2016-09-18 23:54:49 +0200 | [diff] [blame] | 142 | .. _download: https://pypi.python.org/simple/pyserial/ |
cliechti | 6066f84 | 2009-07-24 00:05:45 +0000 | [diff] [blame] | 143 | .. _pywin32: http://pypi.python.org/pypi/pywin32 |
Chris Liechti | 1770e50 | 2016-08-11 23:43:55 +0200 | [diff] [blame] | 144 | .. _`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 |