Questions tagged [pyserial]

pySerial is a Python module that encapsulates the access for the serial port. It provides backends for different platforms and Python implementations.

pySerial 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.

This is an example extracted from the introduction of the documentation:

>>> import serial
>>> ser = serial.Serial(0)  # open first serial port
>>> print(ser.portstr)      # check which port was really used
>>> ser.write("hello")      # write a string
>>> ser.close()             # close port

References:

1951 questions
0
votes
1 answer

Cannot configure port with pyserial 3.4 with Python 2.17.13 under Windows 10

I'm using pyserial 3.4 with Python 2.17.13 under Windows 10. When open COM5 port, I obtained the error below. Same source, same pyserial, same python versions, they run correctly under Windows 7 and 8.1 Traceback (most recent call last): File…
0
votes
0 answers

Unable to write all binary data from serial port to text file in Python

I am currently trying to save binary data from a serial port. The problem for me now is that it is only saving one value to the text file. I would like to save all the values obtained from the serial port to the text file. Below I attached my code.…
M.Hui
  • 3
  • 2
0
votes
0 answers

serial port data sending got splitted in receiver

I send a data from the serial port as 1H|\^&|||c111^Roche^c111^2.0.0.0710^1^3334 44|||||host|TSREQ^REAL| To serial port and at receiving end string got split as 1H|\^ and &|||c111^Roche^c111^2.0.0.0710^1^3334 44|||||host|TSREQ^REAL| why it…
Sunil Jose
  • 221
  • 1
  • 15
0
votes
2 answers

Python : write to serial port as /x06

I need to write 06 as /x06 to serial port to give an acknowledement for a machine, my code is given below, what is the correction needed import time import serial ser =…
Sunil Jose
  • 221
  • 1
  • 15
0
votes
1 answer

detect the specific serial port which is conneced to FTDI chip

I'm working on a FTDI chip and want to connect this chip to the operating system Windows 10 via a serial port. I'm using this code below and the results show me the all visible ports what I don't want. what I need is to detect only the port which…
0
votes
0 answers

Serial data issue

I want to make a program that receives data from the serial port so it can be looked for as an entry of a dictionary on Python 2.7.5 and Arduino 1.8. : import serial #Import Serial Library arduinoSerialData…
0
votes
1 answer

Pyserial communication with Sparkfun Bluetooth mate only responding to one message

I am building a robot using an Arduino Mega 2560 and a number of stepper motors and magnetic encoders to record its motion. My environment is: Arduino Mega 2560 Bluetooth Mate from Sparkfun Python 3.6.1 Pyserial 2.7 Windows 10 This…
0
votes
0 answers

PySerial Works in a different way with USB to rs232 and MAX3232CDR

Can anyone explain where my mistake is import time, serial from _poll_msg import * from exception import BadCRC ser = serial.Serial() ser.parity = serial.PARITY_NONE ser.baudrate= 19200 ser.port = '/dev/ttyUSB0' ser.open() def write(cmd): …
0
votes
1 answer

python pyserial how to store data after some certain value

I'm reading data through seral port of my computer using python pyserial package. The source is an FPGA board. The source sending 24 pieces of bytes accordingly and then there is an idle period. This process repeats itself. So to find out the first…
macellan
  • 3
  • 8
0
votes
1 answer

how to combine following three values in python/pyserial to get one value

I'm trying to combine three values that I got through serial port using pyserial. These values are corresponding to 3 parts of a 24bit data transmitted from and fpga board and I want to get the 24 bit data in python script. What kind of a conversion…
macellan
  • 3
  • 8
0
votes
0 answers

What format is this serial data in?

I have a Multimeter taking readings that I want to transfer directly to my PC. It has a USB port for PC connectivity and has its own software to take the readings directly, however, this software can only store a maximum of 50,000 readings per…
0
votes
1 answer

pyserial code working on Windows (COM1) but not on Linux (/dev/ttyS0)

I am using python 3.6. The following code works just fine on Windows 10 Pro: import serial import binascii ser = serial.Serial("COM1") # "COM1" will be "/dev/ttyS0" on Linux if ser.is_open == True: print("COM open") ser.baudrate =…
0
votes
0 answers

How to use information in a serial port config file?

OK. I'm trying to store camera parameters for a cameralink camera in a Python config file, and then pass those parameters on to the camera via a serial port. Does any one know how to do this? This is what I have so far: Config…
0
votes
0 answers

network redirection of 2 physical serial ports

I have a question about the best way to redirect over a TCP-IP connection a serial stream and I have some restrictions: The network connection might be unstable Communication is one way only Communication has to be as real-time as possible to avoid…
0
votes
0 answers

Function continuously running in background to collect data for instance variables without blocking

Question: How can I read data from the serial port without blocking operations occuring in the rest of my GUI. Current Problem: I have a GUI that can't perform all of the tasks in the time that I need it to. I need to read data -> store the incoming…
emg184
  • 608
  • 5
  • 16
1 2 3
99
100