I figured it out! I forget to set the speed of the serial port. Dumb , dumber, dumbest.
From: twisted-python-bounces@twistedmatrix.com [mailto:twisted-python-bounces@twistedmatrix.com] On Behalf Of Rene Klootwijk
Sent: maandag 1 augustus 2011 18:21
To: 'Twisted general discussion'
Subject: Re: [Twisted-Python] Reconnection to Serialport after connectionLost
I have copied a code snippit to pastebin, http://pastebin.com/us4vL0bk
This is what happens:
When I break the connection, the connectionLost event is triggered and the connectionLost method of the protocol class is called. After a 5 second delay the serialport is reopened successfully because I reconnected the device. The connectionMade event is triggered and the connectionMade method of the protocol class is called. However, data arriving on the serial port no longer triggers the dataReceived event.
--
Rene
From: twisted-python-bounces@twistedmatrix.com [mailto:twisted-python-bounces@twistedmatrix.com] On Behalf Of Laurens Van Houtven
Sent: maandag 1 augustus 2011 1:37
To: Twisted general discussion
Subject: Re: [Twisted-Python] Reconnection to Serialport after connectionLost
Have you tried ReconnectingClientFactory?
http://twistedmatrix.com/documents/current/api/twisted.internet.protocol.ReconnectingClientFactory.html
(Also, could you pastebin some code? What you're describing ought to work.)
--
cheers
lvh