Python Library – PySerial

pyserial logo
Download PySerial @ SourceForge

PySerial documentatie @ SourceForge

Informatie (ENG):

This module encapsulates the access for the serial port. It provides backends for Python running on Windows, Linux, BSD (possibly any POSIX compliant system), Jython and IronPython (.NET and Mono). The module named “serial” automatically selects the appropriate backend.

  • Same class based interface on all supported platforms.
  • Access to the port settings through Python properties.
  • Support for different byte sizes, stop bits, parity and flow control with RTS/CTS and/or Xon/Xoff.
  • Working with or without receive timeout.
  • File like API with “read” and “write” (“readline” etc. also supported).
  • The files in this package are 100% pure Python.
  • The port is set up for binary transmission. No NULL byte stripping, CR-LF translation etc. (which are many times enabled for POSIX.) This makes this module universally useful.
  • Compatible with io library (Python 2.6+)
  • RFC 2217 client (experimental), server provided in the examples.

Installatie via PIP

Installeer PySerial met het commando:  pip install pyserial

Installatie via Source (TAR.GZ)

Pak het archief bestand uit en ga de folder binnen, vanuit daar gebruik het commando:

python setup.py install

Voor Python 3:

python3 setup.py install

Installatie via Windows installer

Python Pyserial installatie windows 01

Krijg je deze foutmelding “No Python installation found in the registery” , dit is een bekend probleem bij de Python 2.7.x installers, blijkbaar gaat het schrijven naar het register niet goed.

Python Pyserial installatie windows 02 foutmelding

Download onder de patch voor je windows versie, je moet wel Python geïnstalleerd hebben naar C:\Python27 (zo niet, dan kan je dat in het .reg bestand aanpassen)

Dubbelklik op het .reg bestand om de sleutels toe te voegen aan het register, start de setup opnieuw en Python installatie wordt gevonden.

Python Pyserial installatie windows 03

Python Pyserial installatie windows 04