PySerial non-blocking read loop

Using a separate thread is totally unnecessary. Just follow the example below for your infinite while loop instead. I use this technique in my eRCaGuy_PyTerm serial terminal program here (search the code for inWaiting() or in_waiting). Notes: To check your python3 version, run this: python3 –version My output when I first wrote and tested this … Read more

Full examples of using pySerial package [closed]

Blog post Serial RS232 connections in Python import time import serial # configure the serial connections (the parameters differs on the device you are connecting to) ser = serial.Serial( port=”/dev/ttyUSB1″, baudrate=9600, parity=serial.PARITY_ODD, stopbits=serial.STOPBITS_TWO, bytesize=serial.SEVENBITS ) ser.isOpen() print ‘Enter your commands below.\r\nInsert “exit” to leave the application.’ input=1 while 1 : # get keyboard input input … Read more

Listing available com ports with Python

This is the code I use. Successfully tested on Windows 8.1 x64, Windows 10 x64, Mac OS X 10.9.x / 10.10.x / 10.11.x and Ubuntu 14.04 / 14.10 / 15.04 / 15.10 with both Python 2 and Python 3. import sys import glob import serial def serial_ports(): “”” Lists serial port names :raises EnvironmentError: On … Read more