cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 1 | ========== |
| 2 | pySerial |
| 3 | ========== |
| 4 | |
| 5 | Overview |
| 6 | ======== |
| 7 | This module encapsulates the access for the serial port. It provides backends |
| 8 | for Python running on Windows, Linux, BSD (possibly any POSIX compliant |
| 9 | system), Jython and IronPython (.NET and Mono). The module named "serial" |
| 10 | automatically selects the appropriate backend. |
| 11 | |
cliechti | 5134aab | 2009-07-21 19:47:59 +0000 | [diff] [blame] | 12 | It is released under a free software license, see LICENSE_ for more |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 13 | details. |
| 14 | |
cliechti | 4cb9466 | 2013-10-17 03:17:50 +0000 | [diff] [blame] | 15 | Copyright (C) 2001-2013 Chris Liechti <cliechti(at)gmx.net> |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 16 | |
cliechti | 8e814dc | 2009-07-30 22:19:08 +0000 | [diff] [blame] | 17 | Other pages (online) |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 18 | |
cliechti | 8e814dc | 2009-07-30 22:19:08 +0000 | [diff] [blame] | 19 | - `project page on SourceForge`_ |
| 20 | - `SVN repository`_ |
cliechti | 4cb9466 | 2013-10-17 03:17:50 +0000 | [diff] [blame] | 21 | - `Download Page`_ with releases (PyPi) |
cliechti | 8e814dc | 2009-07-30 22:19:08 +0000 | [diff] [blame] | 22 | - This page, when viewed online is at http://pyserial.sf.net. |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 23 | |
cliechti | 5134aab | 2009-07-21 19:47:59 +0000 | [diff] [blame] | 24 | .. _LICENSE: appendix.html#license |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 25 | .. _`project page on SourceForge`: http://sourceforge.net/projects/pyserial/ |
cliechti | 4cb9466 | 2013-10-17 03:17:50 +0000 | [diff] [blame] | 26 | .. _`SVN repository`: http://svn.code.sf.net/p/pyserial/code/trunk |
| 27 | .. _`Download Page`: http://pypi.python.org/pypi/pyserial |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 28 | |
| 29 | |
| 30 | Features |
| 31 | ======== |
cliechti | ec4ac1b | 2009-08-02 00:47:21 +0000 | [diff] [blame] | 32 | - Same class based interface on all supported platforms. |
| 33 | - Access to the port settings through Python properties. |
| 34 | - Support for different byte sizes, stop bits, parity and flow control with |
cliechti | 5134aab | 2009-07-21 19:47:59 +0000 | [diff] [blame] | 35 | RTS/CTS and/or Xon/Xoff. |
cliechti | ec4ac1b | 2009-08-02 00:47:21 +0000 | [diff] [blame] | 36 | - Working with or without receive timeout. |
| 37 | - File like API with "read" and "write" ("readline" etc. also supported). |
| 38 | - The files in this package are 100% pure Python. |
| 39 | - 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] | 40 | translation etc. (which are many times enabled for POSIX.) This makes this |
| 41 | module universally useful. |
cliechti | ec4ac1b | 2009-08-02 00:47:21 +0000 | [diff] [blame] | 42 | - Compatible with :mod:`io` library (Python 2.6+) |
cliechti | a2d8f96 | 2009-08-10 23:59:27 +0000 | [diff] [blame] | 43 | - RFC 2217 client (experimental), server provided in the examples. |
cliechti | 2297814 | 2009-07-21 01:58:11 +0000 | [diff] [blame] | 44 | |
| 45 | |
| 46 | Requirements |
| 47 | ============ |
cliechti | ec4ac1b | 2009-08-02 00:47:21 +0000 | [diff] [blame] | 48 | - Python 2.3 or newer, including Python 3.x |
cliechti | 4cb9466 | 2013-10-17 03:17:50 +0000 | [diff] [blame] | 49 | - ctypes extension on Windows (is in standard library since Python 2.5+) |
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 | |
cliechti | daf47ba | 2009-07-28 01:28:16 +0000 | [diff] [blame] | 118 | On windows releases older than 2.5 will depend on pywin32_ (previously known as |
| 119 | win32all) |
cliechti | 6066f84 | 2009-07-24 00:05:45 +0000 | [diff] [blame] | 120 | |
cliechti | 4cb9466 | 2013-10-17 03:17:50 +0000 | [diff] [blame] | 121 | .. _download: http://sourceforge.net/projects/pyserial/files/pyserial/ |
cliechti | 6066f84 | 2009-07-24 00:05:45 +0000 | [diff] [blame] | 122 | .. _pywin32: http://pypi.python.org/pypi/pywin32 |