Serial & reset of the device

Tim Chase python.list at tim.thechases.com
Fri Jul 8 08:58:13 EDT 2011


On 07/08/2011 02:45 AM, Tim Roberts wrote:
> yorick<yorick.brunet at gmail.com>  wrote:
>> I'm trying to access a hardware board of my company through a serial
>> connection using a Python script and the pyserial module.
>>
>> The board to which I'm trying to connect works correctly with serial
>> as some other guys did some TCL scripts to manage it.
>> My problem is that every time I open a new connection, the device is
>> reset. I'd like to not have the device reset.
>
> I'm not sure what that means.  The RS-232 standard does not have the
> concept of "reset".  What is it that triggers a device reset?

While not a "reset" per-se, it might be triggered by the RTS/CTS, 
DSR/DTR, or carrier-detect pins depending on the configuration. 
Without the code and with minimal pySerial experience, I don't 
know whether opening a serial-port in pySerial automatically 
lights up one of those aux. lines and unsignals it when the 
connection is closed.  If the device expects a "power on" signal 
on one of those pins, I'd start by looking to see if pySerial's 
.close() drops the signal on those pins and if it offers a way to 
keep the signal high while releasing the port.  Otherwise, you 
may have to open once, do all your work and only close the port 
when you're done (and the device can be reset)

-tkc





More information about the Python-list mailing list