The script was working fine but this morning I got the following error:
Code: Select all
COM4 (AQ043AA4)
COM9 (S/N not available)
COM13 (S/N not available)
1000 (Exit)
Select available COM number from list (e.g. 1-256) or '1000' to exit: 4
CoolTerm is already running...
ERROR: Could not connect to CoolTerm
Traceback (most recent call last):
File "H:\Python\_PyProjects\usbser2ct\usbser2ct.pyw", line 234, in <module>
ID1 = s.LoadSetting(template_settings_file) # myapp.cooltermsettings
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H:\Python\_PyProjects\usbser2ct\CoolTerm.py", line 345, in LoadSetting
Response = self._SendPacket(Packet)
^^^^^^^^^^^^^^^^^^^^^^^^
File "H:\Python\_PyProjects\usbser2ct\CoolTerm.py", line 278, in _SendPacket
self.skt.sendall(Packet)
OSError: [WinError 10057] A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied
TIA.
---
Edit 20260111-1530
OK, I got confirmation that the socket is connected but I got similar error:
Code: Select all
COM4 (AQ043AA4)
COM9 (S/N not available)
COM13 (S/N not available)
1000 (Exit)
Select available COM number from list (e.g. 1-256) or '1000' to exit: 4
CoolTerm is already running...
ERROR: Could not connect to CoolTerm
2) Creating Socket...
ERROR: Could not connect to CoolTerm
CoolTermSocket('127.0.0.1',51413) connected.
Traceback (most recent call last):
File "H:\Python\_PyProjects\usbser2ct\usbser2ct.pyw", line 281, in <module>
ID1 = s.LoadSetting(template_settings_file) # myapp.cooltermsettings
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H:\Python\_PyProjects\usbser2ct\CoolTerm.py", line 345, in LoadSetting
Response = self._SendPacket(Packet)
^^^^^^^^^^^^^^^^^^^^^^^^
File "H:\Python\_PyProjects\usbser2ct\CoolTerm.py", line 278, in _SendPacket
self.skt.sendall(Packet)
OSError: [WinError 10057] A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied
Edit 20260111-1609
The only way to get the script working again was to shut down and restart CoolTerm. Then the script worked again. But:
a) What is the issue and why did the issue occur?
b) Is this only way to fix (manually restart)?