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 | 90570b9 | 2015-08-04 03:32:02 +0200 | [diff] [blame] | 16 | Copyright (C) 2001-2015 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 | 90570b9 | 2015-08-04 03:32:02 +0200 | [diff] [blame] | 49 | - Python 2.7 or newer, including Python 3.4 and newer |
cliechti | ec4ac1b | 2009-08-02 00:47:21 +0000 | [diff] [blame] | 50 | - "Java Communications" (JavaComm) or compatible extension for Java/Jython |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 51 | |
cliechti | 5134aab | 2009-07-21 19:47:59 +0000 | [diff] [blame] | 52 | |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 53 | Installation |
| 54 | ============ |
| 55 | |
| 56 | pyserial |
| 57 | -------- |
cliechti | 5134aab | 2009-07-21 19:47:59 +0000 | [diff] [blame] | 58 | This installs a package that can be used from Python (``import serial``). |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 59 | |
cliechti | 4cb9466 | 2013-10-17 03:17:50 +0000 | [diff] [blame] | 60 | To install for all users on the system, administrator rights (root) |
| 61 | may be required. |
| 62 | |
| 63 | From PyPI |
| 64 | ~~~~~~~~~ |
| 65 | pySerial can be installed from PyPI, either manually downloading the |
| 66 | files and installing as described below or using:: |
| 67 | |
| 68 | pip install pyserial |
| 69 | |
| 70 | or:: |
| 71 | |
| 72 | easy_install -U pyserial |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 73 | |
| 74 | From source (tar.gz or checkout) |
| 75 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
cliechti | 5c72e4d | 2010-07-21 14:04:54 +0000 | [diff] [blame] | 76 | Download the archive from http://pypi.python.org/pypi/pyserial. |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 77 | Unpack the archive, enter the ``pyserial-x.y`` directory and run:: |
| 78 | |
| 79 | python setup.py install |
| 80 | |
cliechti | 5c72e4d | 2010-07-21 14:04:54 +0000 | [diff] [blame] | 81 | For Python 3.x:: |
| 82 | |
| 83 | python3 setup.py install |
| 84 | |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 85 | Packages |
| 86 | ~~~~~~~~ |
| 87 | There are also packaged versions for some Linux distributions and Windows: |
| 88 | |
| 89 | Debian/Ubuntu |
cliechti | 5c72e4d | 2010-07-21 14:04:54 +0000 | [diff] [blame] | 90 | A package is available under the name "python-serial". Note that some |
cliechti | 4cb9466 | 2013-10-17 03:17:50 +0000 | [diff] [blame] | 91 | distributions may package an older version of pySerial. |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 92 | |
| 93 | Windows |
| 94 | There is also a Windows installer for end users. It is located in the |
cliechti | 4cb9466 | 2013-10-17 03:17:50 +0000 | [diff] [blame] | 95 | PyPi_. Developers also may be interested to get the source archive, |
| 96 | because it contains examples, tests and the this documentation. |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 97 | |
| 98 | .. _PyPi: http://pypi.python.org/pypi/pyserial |
| 99 | |
| 100 | |
| 101 | References |
| 102 | ========== |
cliechti | 86e8787 | 2009-07-21 13:32:45 +0000 | [diff] [blame] | 103 | * Python: http://www.python.org/ |
cliechti | 86e8787 | 2009-07-21 13:32:45 +0000 | [diff] [blame] | 104 | * Jython: http://www.jython.org/ |
cliechti | 5134aab | 2009-07-21 19:47:59 +0000 | [diff] [blame] | 105 | * Java@IBM: http://www-106.ibm.com/developerworks/java/jdk/ (JavaComm links are |
| 106 | on the download page for the respective platform JDK) |
| 107 | * Java@SUN: http://java.sun.com/products/ |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 108 | * IronPython: http://www.codeplex.com/IronPython |
| 109 | * setuptools: http://peak.telecommunity.com/DevCenter/setuptools |
| 110 | |
| 111 | |
| 112 | Older Versions |
| 113 | ============== |
cliechti | 4cb9466 | 2013-10-17 03:17:50 +0000 | [diff] [blame] | 114 | Older versions are still available in the old download_ page. pySerial 1.21 |
| 115 | is compatible with Python 2.0 on Windows, Linux and several un*x like systems, |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 116 | MacOSX and Jython. |
| 117 | |
Chris Liechti | 32ccf2e | 2015-12-19 23:42:40 +0100 | [diff] [blame] | 118 | On Windows releases older than 2.5 will depend on pywin32_ (previously known as |
cliechti | daf47ba | 2009-07-28 01:28:16 +0000 | [diff] [blame] | 119 | win32all) |
cliechti | 6066f84 | 2009-07-24 00:05:45 +0000 | [diff] [blame] | 120 | |
Chris Liechti | 90570b9 | 2015-08-04 03:32:02 +0200 | [diff] [blame] | 121 | .. _download: https://pypi.python.org/pypi/pyserial |
cliechti | 6066f84 | 2009-07-24 00:05:45 +0000 | [diff] [blame] | 122 | .. _pywin32: http://pypi.python.org/pypi/pywin32 |