You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The pyserial.Serial instance has the timeout attribute set correctly, and is working fine. The problem is that the execution never exits from the following while loop:
# dlms_cosem/io.py:HdlcTransport.next_eventdefnext_event(self):
""" Will read the serial line until a proper response event is read. :return: """whileTrue:
# If we already have a complete event buffered internally, just# return that. Otherwise, read some data, add it to the internal# buffer, and then try again.event=self.hdlc_connection.next_event()
ifeventisstate.NEED_DATA:
self.hdlc_connection.receive_data(self.recv_frame())
# ^ recv_frame is actually returning empty bytes: b'' after the Serial timeout, but receive_data doesn't do anything with it, and next_event just continues execution indefinitelycontinuereturnevent
Thanks fort the troubleshooting. The timeout is actually redundant as we now are using compostion of the IO-layer and the transport layer.
Instead this timeout should handle the transport and should be in the next_event method. But we then would want maybe 30 seconds as default so we get a couple of tries on the IO-layer first.
The default timeout is 10 seconds, but it will wait forever
The text was updated successfully, but these errors were encountered: