darkness

Thursday, 11 August 2005

pySerial in Cygwin

darkness @ 18:30:31

Trying to talk to a serial device spitting out DEADBEEF\n wasn’t working from Python (within Emacs) on Cygwin. Turns out the trick was setting the environment variable CYGWIN=reset_com. All of a sudden, I can do:

import serial
port = serial.Serial(0, baudrate=115200)
print port.readline()

without incident. (To clarify, from bash for testing this I just ran CYGWIN=reset_com emacs and then Emacs started Python, so Python saw this variable.)

Powered by WordPress