pyserial

Error on Python serial import

Error on Python serial import Question: When I try to import the serial I get the following error: Traceback (most recent call last): File “C:Documents and Settingseduardo.pereiraworkspacethgspeaktst.py”, line 7, in <module> import serial File “C:Python27libsite-packagesserial__init__.py”, line 27, in <module> from serial.serialwin32 import Serial File “C:Python27libsite-packagesserialserialwin32.py”, line 15, in <module> from serial import win32 File “C:Python27libsite-packagesserialwin32.py”, …

Total answers: 4

Issues with PySerial: Port must be configured before it can be used

Issues with PySerial: Port must be configured before it can be used Question: I am writing code (in python) to use serial communication with an Arduino, using the pySerial library, on Windows 7. However, I am having issues using the ports correctly. Here is my code: import serial #sets the connection parameters, relook at when …

Total answers: 2

Reading serial data in realtime in Python

Reading serial data in realtime in Python Question: I am using a script in Python to collect data from a PIC microcontroller via serial port at 2Mbps. The PIC works with perfect timing at 2Mbps, also the FTDI usb-serial port works great at 2Mbps (both verified with oscilloscope) Im sending messages (size of about 15 …

Total answers: 4

Convert an int value to unicode

Convert an int value to unicode Question: I am using pyserial and need to send some values less than 255. If I send the int itself the the ascii value of the int gets sent. So now I am converting the int into a unicode value and sending it through the serial port. unichr(numlessthan255); However …

Total answers: 4

PySerial non-blocking read loop

PySerial non-blocking read loop Question: I am reading serial data like this: connected = False port = ‘COM4’ baud = 9600 ser = serial.Serial(port, baud, timeout=0) while not connected: #serin = ser.read() connected = True while True: print(“test”) reading = ser.readline().decode() The problem is that it prevents anything else from executing including bottle py web …

Total answers: 4

pySerial 2.6: specify end-of-line in readline()

pySerial 2.6: specify end-of-line in readline() Question: I am sending commands to Eddie using pySerial. I need to specify a carriage-return in my readline, but pySerial 2.6 got rid of it… Is there a workaround? Here are the Eddie command set is listed on the second and third pages of this PDF. Here is a …

Total answers: 5

pyserial: No module named tools

pyserial: No module named tools Question: I have installed the latest pySerial on my Ubuntu box with python 2.7.2, and it works fine for most things, but whenever I try to import the ‘tools’ package, it says that it can’t find ‘tools’. The documentation for pySerial explicitly references this ‘tools’ package. >>> from serial import …

Total answers: 11

Efficient and fast Python While loop while using sleep()

Efficient and fast Python While loop while using sleep() Question: I am attempting to communicate with a device over serial using Pyserial. As commands need to be continually sent, they have to be placed in a while loop in Python. I am currently using this code, and have taken a look at python process takes …

Total answers: 3

pyserial for Python 2.7.2

pyserial for Python 2.7.2 Question: I’m new to Python. According to the internets I was looking for the module pyserial after receiving this error: ImportError: No module named serial I first tried to install pywin32, it went well. But it seems not to contain pyserial. 🙁 Then I found a single module installer for pyserial, …

Total answers: 9

Is there a way to "compile" Python code onto an Arduino (Uno)?

Is there a way to "compile" Python code onto an Arduino (Uno)? Question: I have a robotics type project with an Arduino Uno, and to make a long story short, I am experimenting with some AI algorithms. However, I need to implement some high level matrix algorithms that would be quite simple using NumPy/SciPy, but …

Total answers: 4